Pretty, extensionless URLs in GitHub Pages using Jekyll
• blog
If you want to have extensionless URLs in GitHub Pages then you might be inclined to add a permalink to the metadata of your page or post:
permalink: /my-pretty-url
Short answer for TL;DR, you need to put a forward slash at the end of your pretty permalink:
permalink: /my-pretty-url/
If you don’t do this, it will kind of work and you’ll still get the expected URL:
However you may well end up with your browser simply prompting you to download the page rather than actually navigate to it:
The is simply down to how Jekyll
generates pages. Right now you will end up with an extensionless file generated for your page:
What you want is a folder with the pretty name containing your page in an index.html
, like below:
If you put a forward slash on the end of your permalink
pretty URL, you force Jekyll
to do just this:
permalink: /my-pretty-url/
Enjoy!