Hello, I am in the process of creating my theme. The content is created according to the following scheme:
|- content
|— example/2024/05/19/article_name ← content section name/category
|------index.en.md
|------index.fr.md
|------img.jpeg
Is there a way to call the content root section name in the template ← this best for me
Is it possible to get “example”?
or
use front matter to add metadata to each page (index.en.md, index.fr.md):
From your question I understand that you need to know the “section” of a post. The root folders (those folders inside of content) are called section in GoHugo concepts. You should have .Section in the page object saying example for all these posts.
I know it’s sometimes hard to explain something, so if I understand your issue wrong please add more details.
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.