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

[BUG] - Add trailing / whenever referring to a directory #360

Closed
ctindel opened this issue Apr 8, 2021 · 5 comments
Closed

[BUG] - Add trailing / whenever referring to a directory #360

ctindel opened this issue Apr 8, 2021 · 5 comments
Labels

Comments

@ctindel
Copy link
Contributor

ctindel commented Apr 8, 2021

Describe the bug
This is one of those bugs that may be very easy to fix, or it might be a lot of ridiculous work, I don't know.

This theme, when referring to subdirectories, does not append the trailing /. For example, the contact page is just "hostname/contact" instead of "hostname/contact/". This may not seem like a big deal because it usually works on most hosting providers, but this makes it not work when your website is hosted on s3 using cloudfront as a CDN, because cloudfront requires you to have the trailing / in order to attempt to load index.html.

I'm hoping this is an easy fix, because other hugo themes do this already. For example, see:

https://themes.gohugo.io/theme/hugo-universal-theme/

The faq link is (note the trailing slash):

https://themes.gohugo.io//theme/hugo-universal-theme/faq/

Making this change would be backwards compatible as when you go to

https://sample-castanet.netlify.app/contact

it will redirect you to

https://sample-castanet.netlify.app/contact/

anyway.

@ctindel ctindel added the bug label Apr 8, 2021
@ctindel
Copy link
Contributor Author

ctindel commented Apr 8, 2021

FWIW I did try setting uglyurls = true in my config.toml but it didn't seem to change anything.

@mattstratton
Copy link
Owner

I am pretty sure that you just set that in your config.toml - the examples listed in exampleSite/config.toml are just that, examples.

The theme isn't doing that, it's just reading what is in config.toml. So you can change those URLs to whatever you need :)

@ctindel
Copy link
Contributor Author

ctindel commented Apr 8, 2021

OK, I guess then this request should be to update the config.toml and sample website to put the trailing slash there, per the official correct behavior documented by spf back in 2014. This way future people using this theme with something like AWS to host won't be caught in this quandary.

gohugoio/hugo#492 (comment)

@mattstratton
Copy link
Owner

that's not a bad idea! go ahead and submit a PR for that one!

@ctindel
Copy link
Contributor Author

ctindel commented Apr 9, 2021

OK I'll open a more explicit issue in case anybody else runs into it.

@ctindel ctindel closed this as completed Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants