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

Homepage displays only header and footer due to a misconfiguration #73

Closed
nachsommer opened this issue May 26, 2019 · 5 comments
Closed

Comments

@nachsommer
Copy link

If I configure instead of
baseURL = "http://example.com"
the base url with a relative path like
baseURL = "http://example.com/somewhere/deeper/"
the hugo server works properly in the localhost environment, however, if I put the site online at the address http://example.com/somewhere/deeper/
it displays only the footer on the main page.

@Track3
Copy link
Owner

Track3 commented Jun 1, 2019

This is a known issue, it probably has nothing to do with relative path. Sometimes I run into this when running hugo server locally, but with the latest version of Hugo, this never appears. If you experience this, just rebuild your site, it should work.

I can't find any ways to reproduce this, so it's hard to sort this out, especially I don't understand a single line of Hugo source codes. I'm not sure if it's the theme is doing something wrong or Hugo itself has a bug…

@truemped
Copy link

I'm facing the exact same issue somehow. Everything works fine locally, but whenever I'm publishing to github pages the index.html looks differently. It seems like some step is overwriting the original index.html with the layout for a blog post page.

My config, and the generated index.html.

When running locally and serving from the in-memory Hugo version I see the div#spotlight which seems to be the main page but it's not generated into the public directory.

Any ideas @Track3? I'm quite new to hugo and have no clue where to start looking.

@Track3
Copy link
Owner

Track3 commented Jun 11, 2019

Hi @truemped , I think I found out what causes this problem.

You just need to delete category = "" in your config.toml, in this case is line 14:
https://github.com/truemped/truemped.github.io/blob/51b840be9b8bc262c2c496c4b2b3a5657d82a1ff/config.toml#L14

This is a misconfiguration, it's used to be in the example config.toml file, commit 39cbfb3 has fixed it, but the problem is, when people update the theme, they probably don't change their configs according to the example one.

The below explains why it was there and why it's wrong

I want to disable the category taxonomy and I did this in my config.toml:

[taxonomies]
  tag = "tags"
  category = ""

Turns out it's wrong, according to the docs. The below is enough to override the default taxonomy:

[taxonomies]
  tag = "tags"

This misconfiguration is causing a lot of problems, it's not a really obvious mistake, and problems it causes are really uncertain, like this one, when running hugo server it's fine, but running hugo it's not.

I'm going to try my best to remind more people to update their configs.

cc @nachsommer

@Track3 Track3 changed the title Relative path for baseURL not working Homepage displays only header and footer due to a misconfiguration Jun 11, 2019
@Track3 Track3 pinned this issue Jun 11, 2019
@nachsommer
Copy link
Author

The problem is solved. Thank you so much!

truemped added a commit to truemped/truemped.github.io that referenced this issue Jun 12, 2019
@truemped
Copy link

Perfect! Thanks a lot @Track3

@Track3 Track3 closed this as completed Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants