dillonzq / LoveIt

❤️A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题
https://hugoloveit.com
MIT License
3.38k stars 1.07k forks source link

[FEATURE] Ignore posts subfolders #796

Closed jamesdeluk closed 1 year ago

jamesdeluk commented 1 year ago

Describe the feature you want 描述你的功能需求

Current functionality

Posts go in the content/posts/ folder.

  1. If I had a post called post.md in posts, the URL would be mysite.com/posts/post.

  2. If I had a post called post.md in a folder in posts, say topic, the URL would be mysite.com/posts/topic/post.

Requested functionality

  1. (new): If I had a post called post.md in a folder in posts, say topic, the URL would be mysite.com/posts/post.

That is, I can use subfolders within posts for organisation, but this doesn't change the URL.

Example usage: I could put all old posts in an archive subfolder but the URL remains the same.

jamesdeluk commented 1 year ago

Seems it's a config.toml setting:

[permalinks]
  posts = ':sections/:title'

(https://gohugo.io/content-management/urls/)