gokarna icon indicating copy to clipboard operation
gokarna copied to clipboard

Can you categorize posts/* locations?

Open dhje0ng opened this issue 2 years ago • 3 comments

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

dhje0ng avatar Oct 13 '22 01:10 dhje0ng

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/

yashmehrotra avatar Oct 17 '22 11:10 yashmehrotra

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.

ramonsuarez avatar Oct 17 '22 11:10 ramonsuarez

@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

mansoorbarri avatar Feb 09 '24 14:02 mansoorbarri