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

If bar.html exists, then jekyll s will show bar.html for bar/.* unless something else explicitly (but not implicitly) overrides it #6475

Closed
7 tasks done
janpio opened this issue Oct 23, 2017 · 8 comments · Fixed by #6569
Assignees
Labels
frozen-due-to-age has-pull-request Somebody suggested a solution to fix this issue serve

Comments

@janpio
Copy link
Contributor

janpio commented Oct 23, 2017

If a file and a folder have the same "permalink" name, jekyll s shows wrong content at files in the folder.

  • I believe this to be a bug, not a question about using Jekyll.
  • I updated to the latest Jekyll (or) if on GitHub Pages to the latest github-pages
  • I ran jekyll doctor to check my configuration
  • I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
  • I am on (or have tested on) Debian/Ubuntu GNU/Linux
  • I am on (or have tested on) Windows 10+

Windows Linux Subsystem, bash via Windows 10 Powershell

  • It was another bug.

My Reproduction Steps

jekyll s does strange things when a file has the same name as a folder:

  • Site is configured as permalink: /:path
  • bar.md, should render at /bar
  • bar/baz.md, should render at /bar/baz

Unfortunately:

On accessing /bar/baz:

  • In 3.5.2 everything was okay.
  • Since 3.6.0 it shows the content of bar.md

I think this is a serious bug. It probably is a regression of #6231, which tried to fix some related problems.

In _site everything is generated as it should:

  • /bar.html with content from bar.md
  • /bar/baz.html with content from bar/baz.md

So the problem is in the way jekyll s decides which file to serve.

Example repo

Here is a repo that shows this exact scenario:
https://github.com/janpio/jekyll-path-test
Use the site navigation for the three example pages.

If you use jekyll s, note how you see the wrong content for "Baz" (only 3.6.x).

(The project also includes 3 collections that test further iterations of this problem:, _test1 and _test2 with .html ending are fine, but _test3 has the exact same problem.)

The Output I Wanted

You can see how everything should work at Github Pages:
https://janpio.github.io/jekyll-path-test/

@janpio
Copy link
Contributor Author

janpio commented Nov 17, 2017

Did I do everything correct with this issue or is anything missing to this getting looked at or confirmed?

@ashmaroli
Copy link
Member

@janpio I can no longer see what you described above, in the test repo above..

@janpio
Copy link
Contributor Author

janpio commented Nov 17, 2017

Thanks, I will confirm the repro asap and get back to you.

@pathawks
Copy link
Member

I can confirm that /bar/baz.html and /bar/baz do not show the same content: /bar/baz shows /bar.html

In fact, /bar/literally/anything shows /bar.html

This is bad.

@pathawks
Copy link
Member

If bar.html exists, then jekyll s will show bar.html for bar/.*

@pathawks pathawks added the serve label Nov 17, 2017
@pathawks pathawks changed the title jekyll s shows wrong content (with file and folder of same name) If bar.html exists, then jekyll s will show bar.html for bar/.* unless something else explicitly (but not implicitly) overrides it Nov 17, 2017
@pathawks
Copy link
Member

This behavior exists in master as well as 3.0.0, so it is not something that has recently broken.

@Crunch09
Copy link
Member

Looking into this now.

@Crunch09 Crunch09 self-assigned this Nov 19, 2017
Crunch09 added a commit to Crunch09/jekyll that referenced this issue Nov 19, 2017
- bar.html
- bar
  |- baz.html

_GET /bar/_
_Before:_ Returns bar.html
_After:_  Returns bar.html

_GET /bar/baz_
_Before:_ Returns bar.html
_After:_  Returns bar/baz.html

_GET /bar/whatever_
_Before:_ Returns bar.html
_After:_  Returns 404

This fixes jekyll#6475
@jekyllbot jekyllbot added the has-pull-request Somebody suggested a solution to fix this issue label Nov 19, 2017
@janpio
Copy link
Contributor Author

janpio commented Nov 19, 2017

Awesome!

#6459 is probably related and (at least) partially fixed by your PR already.

Mr0grog added a commit to edgi-govdata-archiving/100days that referenced this issue Feb 6, 2019
We upgraded Jekyll to 2.6.3 (a minor version upgrade from 2.4.3) to fix a security vulnerability, but the entire 2.6.x line has a bug with how URLs are handled in the built-in web server. (Fixed here: jekyll/jekyll#6459 and jekyll/jekyll#6475, originally introduced in the fix to jekyll/jekyll#6222 (comment)).

Anyway, 2.8.5 includes a fix and generates an identical `_site` directory on disk, so should be all good.
@jekyll jekyll locked and limited conversation to collaborators Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age has-pull-request Somebody suggested a solution to fix this issue serve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants