Background
- 18 months ago, I used
latest
Docker image in GitLab container resgitry for Hugo extended at commit 168fe3d. - Six years ago, I integrated static comments to this blog.
- Last week end, when my friend tested static comments here, she reported that @StaticmanLab’s GitLab token had been expired. As a result, I updated it and re-deployed my Staticman instance.
Problem
I wrote a sample comment containing math equations to test if it’s still working. The back-end processes were fine, but the site rebuilding wasn’t successful, as commit c531a0b reveals.
Cause
Remembering that I was using the latest
Docker image on GitLab’s container
registry, I ran hugo serve
after updating my Hugo (extended verison)
to the latest version on M$ Win* 11.
$ hugo serve
Watching for changes in
C:\Users\sere\Documents\vincenttam.gitlab.io\{archetypes,content,data,layouts,static,themes}
Watching for config changes in
C:\Users\sere\Documents\vincenttam.gitlab.io\hugo.toml
Start building sites …
hugo v0.135.0-f30603c47f5205e30ef83c70419f57d7eb7175ab+extended windows/amd64
BuildDate=2024-09-27T13:17:08Z VendorInfo=gohugoio
ERROR invalid front matter: published: %!!(MISSING)s(bool=false): see
C:\Users\sere\Documents\vincenttam.gitlab.io\content\post\2022-09-05-functions-for-arts\fct-slides.md
ERROR invalid front matter: date: 18 avril 2023: see
C:\Users\sere\Documents\vincenttam.gitlab.io\content\post\2023-04-18-notes-pour-l-algo-des-tableaux\diapo.md
ERROR invalid front matter: published: %!!(MISSING)s(bool=false): see
C:\Users\sere\Documents\vincenttam.gitlab.io\content\post\2023-04-18-notes-pour-l-algo-des-tableaux\diapo.md
WARN deprecated: .Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will
be removed in a future release. Use hugo.IsMultilingual instead.
WARN calling IsSet with unsupported type "ptr" (*page.siteWrapper) will always
return false.
WARN calling IsSet with unsupported type "invalid" (<nil>) will always return
false.
Built in 5008 ms
Error: error building site: logged 3 error(s)
^C
[1]+ Exit 1 hugo serve
When I made those HTML slides, I thought that they were part of my posts'
contents, which were placed under contents/post/…
. They include the Markdown
source file and the generated HTML slides. To avoid hugo
’s interpretation of
those Markdown source files, whose file extension name is MD, I put the
front matter parameter publised: false
at the start of those MD
files.
However, in recent Hugo releases, HTML files are no longer included in Hugo’s
output. After some searching, I moved them to static/
because that’s the only
solution I knew. At that time, the published
paramter still accepted boolean
values. The site regeneration for commit fa2a2b4 was smooth.
$ git checkout fa2a2b4; git grep --name-only '^published: '; git checkout master
content/post/2022-09-05-functions-for-arts/fct-slides.md
content/post/2022-09-05-functions-for-arts/index.md
content/post/2023-04-18-notes-pour-l-algo-des-tableaux/diapo.md
Before c531a0b, I didn’t expect the above ERROR
to occur. Due to this
failure, I checked Hugo’s docs for that front matter parameter,
and I found that it had been changed to “alias to publishDate
”.
Solution
The above ERROR
output was self-explanatory.
- Removal of that obsolete front matter parameter in
content/
. - Moved those Markdown source files’ path from
content/
tostatic/
at commit a199491. - Replaced
lastest
in.gitlab-ci.yml
by0.135.0
at commit 53669ec, so that any Docker image update on GitLab container registry won’t break a future site regeneration.
Skills reviewed
Use :r [cmd]
to put the result of a Vim [cmd]
under the cursor.