From the Jekyll docs it says (using .md
format):
Clean URLs can also be achieved using the
permalink
front matter variable. In the example above, using the first method, you can get URLhttp://example.com/other
for the fileother.md
by setting this at the top of the file:permalink: /other
Here is an example my page front matter:
---
layout: page
title: Contact
permalink: /contact
---
Everything works fine when I'm using jekyll serve
but when I build
and upload to my static host it doesn't work. The file structure Jekyll outputs doesn't make sense for the functionality it claims from the docs.
.
|-- css/
|-- index.html # => http://example.com/
└── contact.md # => http://example.com/contact.html
I want to be able to go to http://example.com/contact
and have it show contact.md
. I know I could have similar functionality by manually putting my files in folders (and then renaming them all to index.html
) like it says in the docs here, but I don't want to have to go through the extra step and I don't prefer the trailing /
e.g. http://example.com/other/
.
I am using Jekyll 3.0.1
I have found these questions but they don't address the problem I'm facing.
How to link to a page with page.url without the html extension in Jekyll?
How to make all posts have a permalink with custom format "domain.com/blog/title"?
permalinks: /:title
in the_config.yml
, looks like a similar case as my previous answer: stackoverflow.com/questions/31791004/… If it works i'll post an answer :) I have my site set up similar to what you want, where a foldercontact
will be created in the folder, inside it is anindex.html
– matrixanomaly