jwillmer / jekyllDecent

Blog Template for Jekyll
http://jwillmer.github.io/jekyllDecent/
MIT License
133 stars 123 forks source link

Add unique id for post #45

Open jwillmer opened 7 years ago

jwillmer commented 7 years ago

The idea is to set a unique id in the YAML header that is used in the post URL. If you change the title of the post later it does not matter since we only care about the post id. This is search engine and user friendly and an improvement to using redirects if you change the post title.

Example Header:

layout:         post
title:          "This is my title"
id:             5465456
date:           2016-04-06 00:40:00 +0300
author:         jwillmer

Example URL's:

https://site/blog/id/title
https://site/blog/5465456/This-is-my-title
https://site/blog/5465456/This-is-a-different-title-to-the-same-post

Permalink in _config.yml:

permalink:        /blog/:id/:title

Everything after id will be ignored for redirecting to your post.

On-Hold since we need Jekyll and GitHub to support this.

jwillmer commented 7 years ago

Referencing issues: https://github.com/jekyll/jekyll/issues/3725 https://github.com/cauerego/cauerego.github.io/issues/3

joeyhoer commented 6 years ago

I think a setting to allow developers to customize the file output directory structure within Jekyll independent of the permalink could accomplish the same thing. Developers could then program The server to negotiate the filesystem and server the correct files.