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

Either /folder/index.html or /folder/other-file.html works but not both #4724

Closed
manake opened this issue May 14, 2018 · 3 comments
Closed
Labels

Comments

@manake
Copy link

manake commented May 14, 2018

I have this:

  • /content/folder/index.html
  • /content/folder/other-file.html

Behavior:

  • When I enter http://localhost:1313/folder/ it displays index.html.
  • When I enter http://localhost:1313/folder/other-file/ it displays 404 page not found.

But when I make any change to other-file.html then this now happens:

  • When I enter http://localhost:1313/folder/ it displays /layouts/_default/list.html (should be index.html)
  • When I enter http://localhost:1313/folder/other-file/ it displays other-file.html

It's random and interchangeable. I don't see any logic or fix.

Hugo Static Site Generator v0.40.3 windows/amd64 BuildDate: 2018-05-09T07:47:04Z

@bep
Copy link
Member

bep commented May 14, 2018

Thanks for getting in touch, but it feels like this is a question that would be better suited to the Hugo Discussion Forum. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug. You may also find the answers you search for in Hugo Documentation.

@bep bep closed this as completed May 14, 2018
@manake
Copy link
Author

manake commented May 15, 2018

How is this a question? Do you see any question marks there?

This is a bug report: there are 2 separate behaviors (listed above). There should be 1 behavior.

Yes, this is a "genuine bug report".

I see that you (counter-intuitively) decided to make /content/folder/index.html not overwrite /layouts/_default/list.html. I don't like it because I was expecting that index.html will be present at http://localhost:1313/folder/ but that's OK.

I feel like I already explained what's the problem sufficiently above. This is happening RANDOMLY so I can't provide any exact steps to reproduce this issue.

  1. I do hugo -serve and (according to your documentation this should not ever happen but it happens):
  • http://localhost:1313/folder/ displays index.html
  • http://localhost:1313/folder/other-file/ displays 404 page not found
  1. I do a modification to /content/other-file.html and suddenly something else happens (or not) (according to your documentation this is the correct behavior):
  • http://localhost:1313/folder/ displays /layouts/_default/list.html
  • http://localhost:1313/folder/other-file/ displays other-file.html

How often this happens?
All the time, this is a persistent issue that I managed to reproduce 100+ times with various files.

How to switch from BEHAVIOR 1 to BEHAVIOR 2 and from BEHAVIOR 2 to BEHAVIOR 1?
I don't know. It just happens at RANDOM.

  • Just pressing Ctrl + C and restarting hugo -serve is sometimes enough (but usually not).
  • Creating a new file somewhere or modifying an existing file is a more certain way to switch the behavior. E.g. I have /content/folder/abc.html and it's doing BEHAVIOR 1, I will modify 1 letter in abc.html and it's doing BEHAVIOR 2 already. Then I restart hugo and it's doing BEHAVIOR 1 or 2. It's random.

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants