-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
hugo server
not serving subdirectories
#793
Comments
hugo server
with complex baseurl not serving subdirectorieshugo server
not serving subdirectories
What version do you use? (the output of hugo server). |
I'm using v13, installed via Homebrew:
|
Hello @trombonehero, It might have to do with the theme. I just did a quick test with the Red Lounge theme which seems to work. That said, some themes might have partials with hard-coded paths without regard for baseurl. So please play around with other themes and see if some of them work for you. Which theme are you using, by the way? |
Hi, and thanks for your responses so far... this seems to be a pretty I'm actually not using any theme at all for either my site or the Am I doing something wrong in the configuration that's different from
|
Hi @trombonehero, You wrote earlier that:
Sorry, I wasn't reading carefully and didn't notice the lack of a trailing slash (
When I remove the trailing slash, I could reproduce your error, and see that even the stylesheet isn't properly loaded. Note, however, as you may have already discovered, that this only affects Thank you, @trombonehero, I think you may have found a bug in the Suggested TODO list for Hugo developers:
|
Hi @anthonyfok, Thanks for your help. It looks like a pretty clear case of PEBKAC on my end, but I agree that some documentation and a warning message wouldn't go astray. Even better, as you say, would be if Hugo normalized Anyway, my site is now working consistently between Jon |
We will fix it. And, if I read your nick (trombonehero) correctly, we might create a new slogan: "Hugo - for horn players!". Yes, it's me with the saxophone in my avatar. |
The fix turns out to be easier than I thought, as there was already a fixUrl() in hugo/commands/server.go function purely for massaging that baseUrl into a form suitable for serving webpages locally, e.g. adding a missing The fix is committed in 1cbdd3e. @trombonehero and @bguiz, please test and see it works for you now. Sidenote: The fact that several users have run into this problem is probably because they are used to Jekyll's norm of leaving out the trailing slash for baseurl, as evident in this paragraph in Jekyll documentation on http://jekyllrb.com/docs/github-pages/:
Here is a reminder to myself to add a note about the trailing Cheers, |
Hi @anthonyfok thanks for looking into this. I assumed that your commits have been merged into master, so I did this:
Now with the latest hugo, I run the server again, and I still have the same issue. Trailing slash or otherwise - so it does not appear to have fixed the issue. |
@bguiz was it You can otherwise just cd to the hugo directory and do a |
Maybe related to gohugoio/hugo#793
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. |
Hi,
Thanks for hugo: it's a fantastic change from tools like DocPad, which takes minutes (minutes!) to build a not-terribly-complex academic website.
I'm having trouble, however, using
hugo server
with a baseurl that includes subdirectories. Basically, everything but the front page gets a 404, even though I can see all of the content in the generatedpublic
directory.I can reproduce this with a pretty simple configuration, a lightly modified version of what
hugo create site
gives me. Here is my (reduced)config.toml
file:I have one piece of content, in
content/blog/post.md
:My
layouts/index.html
file looks like this:When I just run
hugo server
, it generates all of the expected files in thepublic
directory:and the sitemap is correct:
but the only URL that Hugo actually serves is
http://localhost:1313/~username/foo/bar
. All of the following URLs result in 404 errors:Any idea what might be wrong or how it can be fixed?
The text was updated successfully, but these errors were encountered: