Dont' see posts that have date

Hello,

I have site with 2 languages with following config:

baseURL = "https://makvaz.com"

theme = ["hugo-notice","jeffprod"]

# paginate = 5
# uglyurls = true

# disableKinds = ["section"]

PygmentsCodeFences = true
PygmentsStyle = "monokai"

disqusShortname = "makvaz-com"

DefaultContentLanguage = "ru"
copyright = "Everything is mine"

[languages]
[languages.en]
  title = "Makvaz"
  baseURL = "https://notes.makvaz.com"
  weight = 4
  contentDir = "content/en"
  [[languages.en.menu.main]]
    url    = "/about/"
    name   = "About"
    weight = 2
    identifier = "about"
    pre = ""
  [[languages.en.menu.main]]
    name = "Русская версия"
    weight = 1.1
    pre = "<i class='fas fa-rss-square fa-3x'>"
    url = "https://zametki.makvaz.com"
    identifier = "zametki.makvaz.com"
  [[languages.en.menu.main]]
    name = "RSS"
    weight = 3
    pre = "<i class='fas fa-rss-square fa-3x'>"
    url = "/feed.xml"
    identifier = "RSS"
  [[languages.en.menu.bottom]]
    name = "Privacy Policy"
    weight = 3
    url = "/privacy/"
    identifier = "privacy"
  [languages.en.params]
    description = "Technical notes and other"
    googleAnalyticsCode = "UA-124592546-2"
    yandexMetrikaCode = "54471976"
[languages.ru]
  title = "Макваз"
  weight = 2
  contentDir = "content/ru"
  baseURL = "https://zametki.makvaz.com"
  [[languages.ru.menu.main]]
    url    = "/about/"
    name   = "О сайте"
    weight = 2
    identifier = "about"
    pre = ""
  [[languages.ru.menu.main]]
    name = "RSS"
    weight = 3
    pre = "<i class='fas fa-rss-square fa-3x'>"
    url = "/feed.xml"
    identifier = "RSS"
  [[languages.ru.menu.main]]
    url    = "https://notes.makvaz.com"
    name   = "English version"
    weight = 2
    identifier = "notes.makvaz.com"
  [[languages.ru.menu.bottom]]
    name = "Политика конфиденциальности"
    weight = 3
    url = "/privacy/"
    identifier = "privacy"

  [languages.ru.params]
    description = "Технические заметки и не только"
    googleAnalyticsCode = "UA-111183533-1"
    yandexMetrikaCode = "54471931"



enableRobotsTXT = true
rssLimit = 10
[privacy]
  [privacy.disqus]
    disable = false
  [privacy.googleAnalytics]
    anonymizeIP = true
    disable = false
    respectDoNotTrack = true
    useSessionStorage = true

[outputFormats]
[outputFormats.RSS]
mediatype = "application/rss"
baseName = "feed"


[frontmatter]
date  = [":filename", ":default"]

[permalinks]
    post = "/:year/:month/:day/:slug"
    page = "/page:slug"

[taxonomies]
    tag = "tags"
    archive = "archives"

[author]
    name = "Aliaksei Karneyeu"

[pagination]
  pagerSize = 5

[markup.goldmark.renderer]
unsafe= true

privacy_pack = true

[params]
  featureImg = "assets/img/header-pic.jpeg" 
  # description = "Технические заметки и не только"

Now, when I add new post with a date hugo new content/en/post/2025-01-27-postgresql-unknown-type-during-database-restore-p2/index.md I don’t see it it latest posts page, but all older posts are displayed.

Here is a part of html code that generates page:

{{ define "main" }}
{{ $paginator := .Paginate (where .Site.Pages "Section" "post").ByPublishDate }}

<div class="columns">
    <div class="column is-9">
        <div class="tile is-child box">
            <div class="content">
                <hr>
                {{ range $paginator.Pages }}
                    <article class="media">
                        <div class="media-content">
                            <div class="content">
                                <!-- <p class="title is-4"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></p> -->
                                 <h1 class="title is-4"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></h1>
                                <p class="subtitle is-size-6 has-text-grey-light">
                                    {{ .Date.Format "02.01.2006" }} &middot;
                                </p>
                                <div class="tags">
                                {{ range $name := .Params.tags }}
                                    <span class="tag"><a href="{{ "tags" | absURL }}/{{ $name | urlize }}">{{ $name }}</a></span>
                                {{ end }}
                                </div>          
                                <p>
                                {{ .Summary }}...</p>
                            </div>
                        </div>
                    </article>
                {{ end }}
            </div>
        </div>
    </div>

So by experimenting, I found out, that pages with date in filename or in front matter are not labeled as section=post, but if I remove date the section is assigned and I see post, but with wrong date.

Thank you for help.

Привет!) Для нескольких языков я использую вот такую настройку в hugo.toml, настраивал по документации отсюда Multilingual mode

[languages]
  [languages.en]

    languageCode = 'en-DE'
    languageName = 'English'

    weight = 1

  [languages.de]

    languageCode = 'de-DE'
    languageName = 'Deutsch'

    weight = 2

И дальше контент на стандартном языке будет обычным названием content/post.md и в той же папке перевод будет content/post.de.md
а на сайте site.com/post/ - на английском, site.com/de/post/ - на немецком.

Мне кажется такой подход удобнее, не придется держать 2 структуры файлов под разные языки…

Возможно, еще кеш не обновился попробуйте запускать так

hugo server --disableFastRender

Hello!) For multiple languages, I use this setup in hugo.toml, configured according to the documentation from here Multilingual mode

[languages]
  [languages.en]

    languageCode = 'en-DE'
    languageName = 'English'

    weight = 1

  [languages.de]

    languageCode = 'de-DE'
    languageName = 'Deutsch'

    weight = 2

And the content in the default language will have a regular name content/post.md and the translation will be in the same folder as content/post.de.md On the site, site.com/post/ will be in English, site.com/de/post/ will be in German.

I think this approach is more convenient, you don’t have to keep two file structures for different languages…

Maybe the cache hasn’t been updated yet, try running it like this

hugo server --disableFastRender

translation by filename or folder structure are both convenient. It just depends on personal preference. I would not consider that as part of a solution here.

I suppose your frontmatter is empty for the newly created site, try to use --kind post which at least for the core theme will bring up a valid frontmatter and list the page.

hugo new --kind post content/en/post/2025-01-27-postgresql-unknown-type-during-database-restore-p2/index.md

havent checked in detail, but there’s a rather old issue about that archetype stuff which is still open… (may have been fixed, but as I

BUT: the theme originally has no multilanguge setup and your code is not contained in the theme - so it’s custom to your setup - with maybe more things.

it does not make much sense to try to replicate your setup, so you’ll have to share your repo.


p.s. i tested with the example site, so without multilang - ther’s a rather old issue #5233 in github.


i don’t consider that as part of your problem but

  • your config file .toml is malformed. Toplevel single entries have to be before the first array value when using TOML.

    there are some of that, that will just be appended to the last open array.

    example one enableRobotsTXT = true (there are others) check this with hugo config and see where it ends :wink:

  • if you use this theme https://github.com/Tazeg/hugo-blog-jeffprod.git

    • last commit 7 years ago
    • archived 2021 by the author
    • does not compile with a recent Hugo version
1 Like

I actually tried to run on a fresh system.

i don’t get what you want to tell…

as said… I won’t dig in without having a builable, reproducing repo to test with

Here is full repo GitHub - korney4eg/makvaz.com

The post that is not visible is makvaz.com/content/en/post/2024-06-20-postgresql-unknown-type-during-database-restore/index.md at master · korney4eg/makvaz.com · GitHub

I have forked theme from other fork that seems to be updated

In fact it looks like :slight_smile:

  • you include your own version of the theme from Tazeg as submodule
  • and that submodule has been updated by you and the upstream …
  • so you might miss updates from the submodule OR manually commited some changes …
  • I cannot see any fork of some different other repo

nevertheless I will try to play with your repo you posted: https://github.com/korney4eg/makvaz.com

Here is a fork GitHub - korney4eg/hugo-blog-jeffprod: A free blog theme for HUGO (https://gohugo.io/), with tags, archives, last posts...

yes - that’s what I got when cloning your repo - I just said that this ios NOT a fork from somewhere else that is updated my a third person, but an older fork of the original theme updated BY you to match your needs.

regarding Hugo it’s still outdated :wink: (won’t compile with recent hugo

please post the rsult of hugo version so I test with the same version than yours.

It seems that my fixes were only local copy. Now I pushed changes to forked theme

hugo version

hugo v0.143.1+extended+withdeploy darwin/arm64 BuildDate=2025-02-04T08:57:38Z VendorInfo=brew

updated works with 143

ERROR deprecated: site config key paginate was deprecated in Hugo v0.128.0 and subsequently removed. Use pagination.pagerSize instead.

be prepared for 144 that will fail

you implemented something like “archives” controlled by page front matter:

Your page in question has:

---
layout: post
title: PostgreSQL. Fixing "type does not exist" error during restoring database.
draft: false
---

should be:

---
layout: post
title: PostgreSQL. Fixing "type does not exist" error during restoring database.
draft: false
archives: "2024"
---

maybe you also want to add tags or toc :wink:

For me then it’s listed in the 2024 archive on the english site.

just to mention, your language switcher is not working correctly with the dev server. it always points to your real baseURL

so if I use tags, I this post in proper tags, I just don’t see on the main page.

Also it seems that I started using those languages just as separate sites

I don’t understand, what you are trying to tell me. looks like we both non-native speakers have a problem here. maybe don’t write that short and/or visualize things.

with this frontmatter your page in question is shown on the second paginated page on your English site including tags. And it displays in the Archives for 2024:

---
layout: post
title: PostgreSQL. Fixing "type does not exist" error during restoring database.
draft: false
archives: "2024"
tags: [gcp, certification]
tocEnabled: false
---

btw there’s a missing translation

Thank you for mentioning about translations.

So here is my front matter

---
layout: post
title: PostgreSQL. Fixing "type does not exist" error during restoring database.
draft: false
archives: "2024"
tags: [postgresql, fix]
tocEnabled: false
---

So I don’t see the post on the main page

So my goal is to display those posts also on the main page.

I checked out front matter of older post and haven’t found anything different.

But as you mentioned I do see post on tag postgresql

havent seen the pictures :wink:

the post is on the second page . you paginate

adjust your sort order for your paginator

{{ $paginator := .Paginate (where .Site.Pages "Section" "post").ByPublishDate.Reverse }}
1 Like

Seems like working! Thank you very much!

Only question - why did it work for previous posts?

they all had the archives param
and number of posts was less than page size.

btw. if there is no special requirement you could also collect the containers by .Date or filename or folder from permalink. no need to have a param here

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.