Ananke last posts on startpage - correct arrangement in the content folder

Hello folks,

I’m pretty new to Hugo and have been working on building my website for a few days. So far everything has worked well. only I have a problem which I could not solve so far.

I use the ananke theme. There are normally the last posts on the home page displayed. With me, however, they are not. I think it is related to my structure in the content folder. It actually looks like this:

As you can see, I have created some subfolders according to the topics I want to write about (CNC, CO2 laser, woodturning).
In turn, I have created subfolders for the respective contributions to keep as clear a file structure as possible.

Unfortunately, the latest posts are not displayed on the home page. What did I do wrong? Can someone give me a tip on how I can solve it or maybe make it better?

Thanks for the help!

Regards,
Chris

You are more likely to receive a prompt and accurate response if you post a link to the public repository for your project.

See https://discourse.gohugo.io/t/requesting-help/9132.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

I just set my repository to public - hopefully someone can help me with this issue.

Regards,
Chris

In your site configuration, specify the main sections:

[params]
mainSections = ['posts','Kreatives']

Comments:

  • Using uppercase characters in your file and directory names can bite you later on. Use lower case for everything.

  • The date in content/de/posts/CO2-Laser/posts/laser-fuer-die-werkstatt/index.md is in the future. It looks like you swapped the month and day. With TOML dates, if you set the month to something greater than 12 it will increment the year (example: 2022-13-01 will be 2023-01-01, 2022-25-01 will be 2024-01-01).

  • Your content structure is strange. I’m not sure why you have a path like this:

    content/de/posts/CO2-Laser/posts/laser-fuer-die-werkstatt/index.md
    
  • Consider using Hugo’s taxonomy system to categorize your posts by topic, etc.

Hi Joe,

thank you very much! The parameter mainSections was the solution.

I had thought that the individual posts are displayed on the home page, if only the folder structure was created correctly. Therefore I had experimented with the subdirectories “posts” at different places. These I have now but taken out again because they basically only make everything more confusing and only interfere with the processing. I think this is what you meant, right?

Thanks for the tip with the date which was in the future. I had not even noticed!

The taxonomy system I will look at me in any case still closer. So far I have set tags to group topics from the same area.
If I understood correctly, the taxonomies in my configuration could look like this:

Kreatives ← Taxonomy
Schneidebretter ← Term
Schneidebrett 1 ← Value
Schneidebrett 2 ← Value
Drechseln ← Term
Holzschale 1 ← Value
Holzschale 2 ← Value

Werkstatt ← Taxonomy
CNC ← Term
Maschine ← Value
Tipp 1 ← Value
Tipp 2 ← Value
Drechseln ← Term
Tipp 1 ← Value
Tipp 2 ← Value
Bericht ← Value
Laser ← Term
Tipp 1 ← Value
Tipp 2 ← Value
Bericht ← Value

Regards,
Christian

Yes.

If by “Value” you mean the page title, that looks OK to me.

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