Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Extensionless permalinks #244

Closed
WalkerCodeRanger opened this issue May 6, 2015 · 8 comments
Closed

Extensionless permalinks #244

WalkerCodeRanger opened this issue May 6, 2015 · 8 comments

Comments

@WalkerCodeRanger
Copy link

I tried to use pretzel 0.2.1.169 (build 175) which I downloaded from Appveyor (non script cs zip) on my github pages site that I had been using with Jekyll from a year ago (Feb-April 2014) and discovered the following. I have reproduced it using the sample project.

Extensionless permalinks as described in the Jekyll docs don't work right (note: the docs say this is a pre-release feature, but I don't think that is correct, because I was using this feature a year ago from jekyll on windows and in windows you must install an old version of jekyll because all the other versions don't work on windows). Permalinks with a trailing slash '/' are fine. However, permalinks without one generate files without extensions, they should behave the same as ones with a trailing slash.

Steps to reproduce

  1. pretzel create
  2. edit _config.yaml add permalink: /blog/:year/:month/:title to the end
  3. pretzel bake

You will then find that the blog post is in the file _site\blog\2015\05\myfirstpost with no extension. It should be in _site\blog\2015\05\myfirstpost\index.html.

@laedit
Copy link
Member

laedit commented May 6, 2015

Thanks for all your feedback 😃
If i understand the jekyll docs correctly, the generated output should be _site\blog\2015\05\myfirstpost.html.
It is the server that handle the request to blog/2015/05/myfirstpost and display the content of blog/205/05/myfirstpost.html instead.

So in this case for Pretzel, if a permalinks does not end with a permalink or a file extension .html will be added.

Is that ok for you?

@JakeGinnivan
Copy link
Member

@laedit the permalink for blog/2015/05/myfirstpost should create blog/2015/05/myfirstpost/index.html so the web server loads the default page for that folder

@WalkerCodeRanger
Copy link
Author

I can see how you read the jekyll docs that way. Unfortunately, I don't have a copy of jekyll running anymore because it is so difficult to setup on windows. That is the whole reason I started looking at other static site generators. I would encourage you to test the jekyll behavior yourself.

For what it is worth, that doesn't seem to be how GitHub handles it. My blog is currently hosted on GitHub. You can see that in my _config.yaml file I have permalink: /blog/:year/:month/:title (no trailing slash). GitHub is treating this as exactly equivalent to permalink: /blog/:year/:month/:title/ (with the trailing slash). To verify this, note that http://www.walkercoderanger.com/blog/2014/04/what-coffeescript-should-have-been/ is simply an alias for http://www.walkercoderanger.com/blog/2014/04/what-coffeescript-should-have-been/index.html That behavior makes more sense to me since many more webservers support the index.html convention than the other way.

@laedit
Copy link
Member

laedit commented May 7, 2015

I confirm that using Portable Jekyll it is blog/2015/05/myfirstpost/index.html which is generated.

But the docs state that you have to activate a special configuration on your server to handle the extensionless permalink. The server will work for blog/foo.html if blog/foo doesn't exists.

I think that before all extensionless permalinks was transformed to /index.html but the dev version of Jekyll has another way to deal with it.

So actually we already support an unreleased feature of Jekyll 😃

@WalkerCodeRanger
Copy link
Author

Well, you don't quite support the unreleased feature because as you said before the path should be _site\blog\2015\05\myfirstpost.html but currently it is _site\blog\2015\05\myfirstpost.

Personally, I prefer the current behavior of Jekyll (i.e. _site\blog\2015\05\myfirstpost\index.html) because that is what S3, which I will be using, supports, but I understand if you change it to match the unreleased feature (I note that when that Jekyll feature is released, it will be a breaking change for those users who are relying on the current behavior).

@laedit
Copy link
Member

laedit commented May 11, 2015

Since the feature is still in dev for Jekyll I'm on your side, I think we must implement the current production Jekyll feature and wait for the release of this feature to adapt.

@JakeGinnivan what is your thought on this?

@JakeGinnivan
Copy link
Member

I think extensionless goes to a folder/index.htm

I know I use that feature for my blog, so not supporting it would block me from migrating

Sent from my Windows Phone


From: Jérémie Bertrandmailto:notifications@github.com
Sent: ‎11/‎05/‎2015 10:12
To: Code52/pretzelmailto:pretzel@noreply.github.com
Cc: Jake Ginnivanmailto:jake@ginnivan.net
Subject: Re: [pretzel] Extensionless permalinks (#244)

Since the feature is still in dev for Jekyll I'm on your side, I think we must implement the current production Jekyll feature and wait for the release of this feature to adapt.

@JakeGinnivanhttps://github.com/JakeGinnivan what is your thought on this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/244#issuecomment-100827549.

@laedit
Copy link
Member

laedit commented May 11, 2015

Ok, I'll do that this week.

@laedit laedit closed this as completed in 31d262f May 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants