Running Hugo gives different results

Hi!

I work with Hugo for a small year now. I’ve read many docs and learned alot!
At this moment I’m in production of a multilingual website where there seems to be missing/off with the way I configured it or how Hugo parses the static pages.

If I run hugo —ignoreCache —verbose —debug it sometimes creates content in a page and sometimes it doesn’t.

My folder structure

content
 - dutch
  - about
    about.md
 - english
  - about
    about.md

Both .md files include a url = "" in the Front-matter

/dutch/about/about.md

url = "/nl/over-ons/"

/english/about/about.md

url = "/en/about/"

Building this as a static page with hugo sometimes generates a /en/about/ page with my content in the <main> element, including header and footer on the page.
But sometimes it generates only a <header> and <footer> with an empty <main>.

This is not the case with the /nl/about/ page.

With all the different pages in this website (also multilingual) nothing seems to be incorrect.

config.toml

title = "My theme name"
theme = "themename"
baseURL = "/"
defaultContentLanguageInSubdir = true
defaultContentLanguage = "nl"
languageCode = "nl-NL"
MetaDataFormat = "toml"
enableRobotsTXT = true

[params]
  nl_description = "A dutch description."
  en_description = "A english description."

[sitemap]
  changefreq = "monthly"
  filename = "sitemap.xml"
  priority = 0.5

[languages]
	[languages.nl]
		contentDir = "content/dutch"
		staticDir = "static"
		languageName = "Nederlands"
		weight = 20
	[languages.en]
		contentDir = "content/english"
		staticDir = "static"
		languageName = "English"
		weight = 10

[blackfriday]
  extensionsmask = ["autoHeaderIds"]

I’m hoping something is off in my configuration and someone could point this out.

Also I hope I’ve given enough information, if not please let me know.
Below my current Hugo environment.

Hugo Static Site Generator v0.55.6-A5D4C82D2/extended darwin/amd64 BuildDate: 2019-05-18T08:06:24Z
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.12.2"

Thanks in advance!

Off my head here:

  • did you define a main language in your config?
  • what does the template do that shows your content. if it stays empty, then there might be something askew there.

I would think that your translation is not setup properly yet. What is the output of the debugging when you run hugo?

Oh I accidentally scrolled your config and ignored your language setup. That looks good. Ignore my first point.

Hi @RoelZ. You’ll need to share your git repo, so that members can attempt to reproduce this.

1 Like

Thank you @davidsneighbour for your quick look upon my question!

@zwbetz, so I was putting it all towards a git repo, but therefor I needed to address some business logic and content. While doing so I noticed something….

When I rerun Hugo I noticed the page mentioned was seen as a list Kind, and not as a single Kind. So the way I’d set up my files/templates/etc would (most likely) be wrong somewhere.
I tried looking into the Docs to clear this out, but I haven’t found out how Hugo sees this.

Since i’m only using single Kind pages, I chose to add the disableKinds = [“section”] to my config.toml. Which is a workaround for now.

Sadly, I think I cannot share a repo, because of the logic. But I’ll will try, so it may can help other people.

Your about section is both a page and section. If you run with hugo --path-warnings you should see a WARNING.

2 Likes