526avijitgupta / gokarna

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
340 stars 134 forks source link

Can you categorize posts/* locations? #131

Open dhje0ng opened 1 year ago

dhje0ng commented 1 year ago

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
yashmehrotra commented 1 year ago

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/

ramonsuarez commented 1 year ago

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.

mansoorbarri commented 7 months ago

@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