gokarna
gokarna copied to clipboard
Can you categorize posts/* locations?
Hello sir, I have a question. I am using the theme via hugo, When creating a markdown file for a new post, the file is located in the content/posts/* sub-path.
> content
>> posts
>>> index.md
However, I think this method will be very difficult to manage if there are many markdown files. I hope the way I want it to be managed is posts/{new folder}/name.md , but I wonder if that's currently possible.
> content
>> posts
>>> 2022
>>>> title1.md
>>> 2021
>>>> title2.md
Content organization is primarily managed by the hugo library, not the theme itself.
You can read more in detail about hugo's content organization at https://gohugo.io/content-management/organization/
Content organization is ignored by this theme (See @yashmehrotra 's explanation here). We have to set a `type: post" in each post and the theme does not recognize any posts inside a folder just because they are in the folder, which is what the Hugo doc says should happen.
@dhje0ng, you can organise it according to year or even month and it will show up on the website as long as type: post
is present in the frontmatter of the pages. Additionally, you can manage the urls by adding a url
variable.
For example: a file at content/articles/2024/micro.md
will show on the website at {baseurl}/articles/2024/micro
if you want it to show under {baseurl}/artilces/micro, add the following in micro.md
frontmatter
url: "/articles/micro"
you can see example of this at: github repository: https://github.com/mansoorbarri/website/tree/c368fe30dd129c3c6b530da9796c47d2711012ad