Why do permalinks have year, month, day in them?

You can override the permalink to just be name.

But…, you are bound to run into duplicate issues eventually if you aren’t careful in a few months or years and you won’t even notice so your site will break silently.

Jekyll protects us against ourselves in two ways:

  • by making date compulsory in the filename. So hello.md and hello.md can’t exist together as identical filenames, but 2021-01-02-hello.md
    2021-01-03-hello.md do.
  • by making urls unique by including date. So /hello.html and /hello.html can’t coexist but /2021/01/02/hello.html and /2021/01/03/hello.html do.

If you want to make your permalink result as /2021-01-02-hello.html without folders then you can do that.

But I’d encourage keeping the date in.


And for neatness you can figure out how to put posts in /posts/ or /blog/ as a subdirectory

/blog/2021-01-02-hello.html

by setting permalink on posts collection instead of the root permalink, so they don’t exist at the root. But you’re still as risk of duplicates.


Crawlers don’t care about posts being on a certain date URL, just that the posts can be read and even better if they are in sitemap.