Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
permalinks are incorrect for files other than html #64
I have templates to render files like atom.xml and sitemap.xml
When using the defaults Jekyll renders them as atom.html and sitemap.html.
I tried to get around it by putting permalink: /atom.xml in the YAML frontmatter but that in turn resulted in paths like /atom.xml/index.html
For files without the .html extension the permalink should be the original filename
I have a patch on my fork at http://github.com/jeffrydegrande/jekyll/tree/master
In my opinion, we shouldn't need hard coded checks for the html extension. Instead, let Jekyll assume that any permalink that ends with a slash should create a directory and put an index.html file there.
Permalink "/foo/bar/" corresponds to the file "foo/bar/index.html"
Permalink "foo/baz.xml" corresponds to the file "foo/baz.xml" (edit: was /baz.xml)
Permalink "/atom.xml" corresponds to the file "atom.xml"
Checking for the trailing slash is exactly what web servers do, so this makes good sense to me.
I made a patch in http://github.com/vilcans/jekyll/tree/automatic-index
I'd also like it to work on files without specifying the permalink.
If I have a file called atom.xml, I need to put "permalink: /atom.xml" in it, or it will be generated as "_site/atom/index.html". I haven't fixed this, but the main problem is fixed as described above.
As I understand it, the 'pretty' permalink creates a directory with index.html. Previously, stating at static relative url like '/atom.xml' would just use the permalink specified verbatim. So it seems like something is just broken. I think the page processor seems to want an 'html' suffix or it creates a directory using mkdir_p.