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

'index' page generated rather than 'index.html' #99

Closed
0xdevalias opened this issue Feb 19, 2016 · 11 comments
Closed

'index' page generated rather than 'index.html' #99

0xdevalias opened this issue Feb 19, 2016 · 11 comments

Comments

@0xdevalias
Copy link

With a url such as redirect_from: post/10235539154/etcinitdblog-start/ i'm seeing the following generated (which at least in jekyll serve leads to an unviewable page) and cant figure out why.

/post/10235539154/etcinitdblog-start/index
@parkr
Copy link
Member

parkr commented Feb 19, 2016

@alias1 Which Jekyll version are you using?

@0xdevalias
Copy link
Author

3.1.1

@yous
Copy link

yous commented Feb 20, 2016

As I think, this issue has caused by jekyll/jekyll#4160.

We're initializing redirect_page as following:

redirect_page = RedirectPage.new(site, site.source, "", "")

Then JekyllRedirectFrom::Redirector sets its page's data['permalink'] to alt_url. redirect_page.output_ext actually calls Jekyll::Renderer.new(site, self).output_ext. So when alt_url ends with '/', output_ext will return document.extname, which is an empty string.

@brandonb927
Copy link

I just realized my redirects are being generated in the same way, and index file instead of an index.html file is created in the redirect folder with any redirect using a trailing slash.

Jekyll 3.1.2, jekyll-redirect-from 0.9.1

@parkr
Copy link
Member

parkr commented Mar 11, 2016

@brandonb927 Could you give #96 a try for me? It should fix that.

gem "jekyll-redirect-from", github: "jekyll/jekyll-redirect-from", branch: "jekyll-3-drops"

@brandonb927
Copy link

Thanks @parkr, I'll give it a go this week. In the meantime I reverted our site back to jekyll 2.5.3, jekyll-redirect-from 0.8.0 which is the last known working state.

@marcgg
Copy link

marcgg commented Mar 13, 2016

Hello,

I'm having the same issue with jekyll 3.1.2 (index instead of index.html). I tried changing my Gemfile to:

gem "jekyll-redirect-from", github: "jekyll/jekyll-redirect-from", branch: "jekyll-3-drops"

... but it seems that the branch doesn't exist anymore. I noticed that #96 merged the branch, so I just pointed to master and it worked:

gem 'jekyll-redirect-from', branch: "master", github: "jekyll/jekyll-redirect-from"

I'm not sure how stable master is though, so I might hold of before releasing the change and wait for the actual gem version release :)

Cheers

@jesmithiv
Copy link

I'm having the same issue -- i.e. getting an extension-less index for all redirects. Right now my workaround is to add index.html explicitly on the end of all redirect_from URLs. So rather than doing:

redirect_from: /2015/12/08/foo/

I'm doing:

redirect_from: /2015/12/08/foo/index.html

This achieves the intended result of the plugin, and I wonder if it's a more robust approach in general going forward since the goal of the jekyll-redirect-from is precisely this -- to create a folder structure with a single index.html in each.

@bturrubiates
Copy link

I think I'm having a similar problem with redirect_to.

If I want to redirect x.html -> y.html, then I could not have a y.html and specify in x.html redirect_from: /url/for/y.html and that seems to work correctly. If I look at the generated site, I have a file named y.html that serves a redirect to x.html.

I'd expect that a file called y.html that contains redirect_to: /url/for/x.html would behave the same. Instead, I get two generated files: y.html that has the contents of the file without the redirect and y that serves a redirect to x.html. I'd expect only one file named y.html that redirects to x.html. Is this a bug, or am I misunderstanding how this should work?

@drewda
Copy link

drewda commented Apr 8, 2016

@0xdevalias
Copy link
Author

Can confirm, also working for me in v0.10.0 :3 Thanks!

@jekyll jekyll locked and limited conversation to collaborators Apr 24, 2019
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

9 participants