Taming an unweildy blog directory

I currently have my blog posts /content/posts/blogTitle/index.md I currently have 41 posts on my live site. The sort fine on the site by date in the frontmatter but are stored in the directory alphabetically. (If anything, it will help me maintain the site both live and in development environments.)

I’m looking for a way to get the posts into a date structured directories, e.g. /2021/01/blogTitle/index.md

A). Are there any downfalls that I’m not thinking of to order them this way?
B). If I reorganize the file structure, will the slug have the date directory structure as well? .com/posts/2021/01/blogTitle/. I guess I’m ok with that, especially if it’s easier.

I do need to take into consideration seo, and that back-links have .com/posts/blogTitle/. So, is it possible to have the date dirs locally during development, but not live URIs? Or am I asking for trouble somewhere down the line.

Thoughts? Suggestions? Comments?

Not that I can think of.

Yes, but you can control this with permalinks.

Thanks for the pointer. So, if I have the dir structure:


Then in my config.toml:

posts = '/:title'

Am I correct that these posts will render to:

This would be the ideal situation.

1). In my list.html my posts are ordered correctly with the fontmatter date: 2021-08-02T11:48:54-04:00. Will this continue do you think? Yea, it should, as currently they are alpha and ranged into date, but now I have sub-dirs (years and months).

2). Then, while I’m creating a blog post, if I needed to reference another post, would I reference the pre-render (/posts/2021/08/myBlogPost-1/) or post-render (/posts/myBlogPost-1/) location?

Yes. Of course, you could also try it yourself.

Yes. Of course, you could also try it yourself.

Use the built-in relref shortcode.

As I was typing I figured I could try many of those questions, just wanted to think out loud and see if there were any holes that I wouldn’t be able to dig out of.