Skip to content
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

Closed
jeffrydegrande opened this issue Jun 29, 2009 · 6 comments
Closed

permalinks are incorrect for files other than html #64

jeffrydegrande opened this issue Jun 29, 2009 · 6 comments

Comments

@jeffrydegrande
Copy link
Contributor

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

@tomafro
Copy link
Contributor

tomafro commented Jul 9, 2009

I've started noticing this too. It didn't happen with earlier versions of jekyll.

@vilcans
Copy link
Contributor

vilcans commented Jul 10, 2009

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.

@felix
Copy link

felix commented Jul 12, 2009

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.

@felix
Copy link

felix commented Jul 12, 2009

Yeah, just read and applied the OP's patch and all is good.

@nirvdrum
Copy link

I can also confirm that patch applies cleanly and fixes my atom problem.

@mojombo
Copy link
Contributor

mojombo commented Jan 14, 2010

Merged patch from @jeffrydegrande

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants