Track3 / hermit

A minimal & fast Hugo theme for bloggers
https://hugo-theme-hermit.netlify.com/
MIT License
1.12k stars 304 forks source link

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

Closed nachsommer closed 5 years ago

nachsommer commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 39cbfb324a96c6e039987df9dfacb67612d34045 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

nachsommer commented 5 years ago

The problem is solved. Thank you so much!

truemped commented 5 years ago

Perfect! Thanks a lot @Track3