Hugo does not see or build content unless I save a change to disk

MacOS High Sierra 10.13.6
hugo-0.49.2.high_sierra.bottle.tar.gz

Hello, I hope someone can let me know where I’m going wrong.

I have Hugo running me a model site for web integrations. Basically it scrapes a flat copy of my provider’s sandbox site and dumps it to /content/pages following the providers folder structure ( so like
/pages/account/create.html
/pages/account/update.html
/pages/cart/details.html

  1. I do not have index.md files in the folders as for some reason it silently refused to build with those in.
  2. As I don’t need any params, the front matter is just the lines.

I have my client’s layouts as head and foot templates in /themes. All works great and props to you for your recent work on Pipes and Theme Inheritance which allowed me to use Hugo instead of laboriously building this in express! Anyway, where I’m going wrong is, Hugo cannot build anything in /content unless, while it is serving/watching, I trigger a change in the front matter of the files in /content.
So literally 1. find in files, add or remove a key:value pair in front matter
2. Save all.

And it builds any page I save a change to. --debug and --verbose give me no errors I can act on. Here’s a standard report:

WARN 2018/10/21 07:50:28 No translation bundle found for default language “en”
INFO 2018/10/21 07:50:28 Using config file: /Users/PWD/hugosite/config.toml
Building sites … INFO 2018/10/21 07:50:28 syncing static files to /Users/PWD/hugosite/docs/
INFO 2018/10/21 07:50:28 found taxonomies: map[string]string{“category”:"", “tags”:""}

               | EN  

±-----------------±—+
Pages | 74
Paginator pages | 0
Non-page files | 0
Static files | 2
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0

Total in 20 ms

Files themselves all have -rw-r–r-- / 664 and there’s no difference between the perms on files that build and those that don’t. So all the static files build, sitemap (with one page), index.html and the sass builds.

Can anyone let me know what I am doing to cause this and how to fix it? I cannot share my repo unfortunately.

Can you build a simple repo that replicates the problem?

The files in /content in your project should be markdown usually, so, /content/pages/create.md. I’m not sure whether Hugo will choke on content that has no frontmatter, or, just its separator lines. Maybe try with and without, with a simple setting for Title, for example.

You can include HTML in a markdown file, no problem. You can also reference an HTML file you put in /static/ which Hugo will just copy to the root. So if you have /static/path/to/myhtml.html you’ll get http://mysite.com/path/to/myhtml.html as is.

Thanks for getting back to me so quickly. Some things to note:

  1. The content of the front matter doesn’t change the state, only the action of saving that change to disk. I have tried adding various key/values. I can write an interstitial process to give titles to the scraped content but it’s a lot to do if it’s not the issue?
  2. I don’t need static files. I need to insert html into a wrapper template. This is what I am using hugo to do. (Otherwise I could just serve the files.)
  3. I can build a repo, yes. I am very very pressured for time so if there’s just a piece of information I am missing (I have checked the docs as best I can) I am looking for that before I stop work and start building another hugo site (right now I am just saving a change to all files every time so I can continue my work).
  4. I didn’t realise hugo required only md files. I did, honestly, read the docs. I will now build an interstitial conversion to markdown.

Markdown, orgmode, ascidoc:

Yep. Got it. It’s very unusual for SSG’s to not support html so I guess I missed it.

Converting to md does not trigger page build:
Change detected, rebuilding site
2018-10-21 09:22:02.612 +0100
Source changed “/Users/PWDcontent/pages/error.md”: CREATE
Source changed “/Users/PWD/content/pages/error.html”: RENAME
Adding back index.md to folder does not trigger build

Change detected, rebuilding site
2018-10-21 09:26:39.613 +0100
Source changed “/Users/PWDcontent/pages/index.md”: WRITE
Total in 17 ms

Saving any change to the front matter makes the page build so the problem is not solved.

just noting this issue is still happening if anyone has any ideas. I converted all the files to md and added titles to all the front matter as suggested, which made no difference. I also added index.md to all the subsection folders, which made no difference.

No. Hugo can work with HTML files but they also need front matter.

Also as you discovered converting to markdown made no difference.

You need to post a link to a repository with the source code of your Hugo project to debug this.

hey @alexandros, I did look in the docs before making the above statement. Thanks for the docs update. :smile:

The commit in the Docs earlier is courtesy of @bep

Anyway for anyone coming into this thread HTML is a valid Content Format in Hugo read the updated Doc over here: https://gohugo.io/content-management/formats/#readout

2 Likes

So, just a random bump to this thread, I’m having exactly the problem Limithub described, namely, pages only existing if I UPDATE them and I haven’t seen any answers in this thread so far.

Anyone encountered any solution?

@alastair-JL the original poster never followed through with:

The same applies in your case. Please open a new topic describing your issue and provide a repo with a simplified version of your project so that we can reproduce the issue.

Also I am archiving this old thread.