New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
permalinks are incorrect for files other than html #64
Comments
I've started noticing this too. It didn't happen with earlier versions of jekyll. |
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. I.e.: 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. |
Yeah, just read and applied the OP's patch and all is good. |
I can also confirm that patch applies cleanly and fixes my atom problem. |
Merged patch from @jeffrydegrande |
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
The text was updated successfully, but these errors were encountered: