Hugo Extended 0.110.0 for / CentOS 7

To create I use Hugo. And for webspace I use For example, when I write a new article, I create a commit for it, which I upload to a Mercurial repository on the webspace. Each new commit then triggers the execution of a script that rebuilds the page.

The script uses the compiled version of Hugo provided by the developers which is stored on the webspace. Due to recent changes to the website I now need the so called extended version of Hugo. But unfortunately it doesn’t work at, because they currently use CentOS 7, so some needed packages are too stable. Or in other words too outdated. Hugo therefore aborts with the following error message.

/home/laythos/bin/hugo: /lib64/ version `GLIBCXX_3.4.20' not found (required by /home/laythos/bin/hugo)
/home/laythos/bin/hugo: /lib64/ version `CXXABI_1.3.8' not found (required by /home/laythos/bin/hugo)
/home/laythos/bin/hugo: /lib64/ version `GLIBCXX_3.4.21' not found (required by /home/laythos/bin/hugo)

The problem is known to the developers (, but for understandable reasons no ready compiled versions are offered for old distributions.

So in this case there are two possibilities. One creates the web page locally each time and loads it for example with rsync on the web space. Or you compile a version of Hugo that supports CentOS 7. I decided for the latter.

Compiling directly on an Uberspace should not be tried though. Because there you can use a maximum of 1.5 GB RAM. Anything that needs more will be terminated automatically. Which is the case with Hugo.

So I downloaded a virtual environment of CentOS 7 from and started it with VirtualBox. Then I installed golang as well as gcc-c++. The former via detours, since Go is apparently not available in the official package sources.

After that I proceeded as follows.

cd hugo-0.97.3
CGO_ENABLED=1 go install --tags extended

The first command downloads the source code of the current version. The second command unpacks it. The third command changes to the directory where the files were unpacked. And the last command compiles the extended version of Hugo.

When the last command has been successfully executed, which can take a few minutes depending on your hardware, you should find the file hugo in the directory ~/go/bin/. You simply copy this file to your Uberspace. With this the creation of the website should work without error messages.

At I uploaded the current version of Hugo that works at If you want (and trust me), you can use it.

Last updated on January 17, 2023.
Version 0.110.0 created and uploaded by Hugo for Uberspcae / CentOS 7.

Insert notices in articles under Hugo

Recently I published an article, which referred to an older article, which is therefore basically no longer relevant. Because I don’t want to delete this article, I thought about adding a note to this article. In case someone accesses the article from 2019 directly.

I have solved this by creating a shortcode, which can be used independently of the articles. In the directory of the theme I used, I created the file notice.html in the subdirectory shortcodes and entered the following content.

<div class="shortcode-notice {{ .Get 0 }}">
    <div class="shortcode-notice-title {{ .Get 0 }}">
        {{- if len .Params | eq 2 -}}
        {{ .Get 1 }}
        {{ else }}
        {{ .Get 0 }}
        {{- end -}}
    <div class="notice-content">{{ .Inner | markdownify }}</div>

Additionally I created the file notice.css in the subdirectory static/css in the theme directory and entered the following content.

.shortcode-notice .notice-content {
    padding: .6em 1em;
	display: block;
	font-size: 1em;
	margin-top: 0;
	margin-bottom: 0;
	color: #666;
    border-radius: 4px;

.shortcode-notice-title {
	color: #fff;
	padding-left: 1em;
	font-weight: 700;
	text-transform: capitalize;
    border-radius: 4px 4px 0 0;

.shortcode-notice-title.hinweis {
	background-color: rgba(92, 184, 92, .8)

 .shortcode-notice.hinweis .notice-content {
	background: #e6f9e6

 .shortcode-notice-title.tip {
	background-color: #6ab0de

.shortcode-notice.tip .notice-content {
	background: #e7f2fa
} {
	background-color: #f0b37e
} .notice-content {
	background: #fff2db

.shortcode-notice-title.warnung {
	background-color: rgba(217, 83, 79, .8)

.shortcode-notice.warnung .notice-content {
	background: #fae2e2

If you now want to add a corresponding note to an article, you can use the following shortcode.

{{% notice info %}}
This is an information
{{% /notice %}}

Instead of info, you can use hint, tip and warning in the first line, which results in the background of the display having a different color accordingly. In the case of warning, for example, red. If this is not enough or too much, you can of course extend or remove the entries in the CSS file.

In the case of the already addressed outdated 2019 article, this generates the following note.

OSBN | General

Hugo - Remove content from sitemap

Google Search Console has complained that two links on my site are blocked by robots.txt even though they appear in the sitemap. How do I get them from the sitemap that Hugo creates automatically?

The solution is actually quite simple. First edit the related articles and add sitemap_exclude: true to the metadata.

title: Secret Article
date: 2019-06-11T19:12:45+0200
sitemap_exclude: true
slug: secret-article

Now it is necessary to adapt the template with which the sitemap is created. Therefore create the file sitemap.xml in the theme directory under layouts/_default and fill it with the following content.

{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns=""
  {{ range .Data.Pages }}
    <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
    <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
    <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
    <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
                hreflang="{{ .Lang }}"
                href="{{ .Permalink }}"
                />{{ end }}
                hreflang="{{ .Lang }}"
                href="{{ .Permalink }}"
                />{{ end }}
  {{ end }}

This corresponds initially to the standard template for the sitemap. Now change line 4 as follows.

{{ range .Data.Pages }}{{ if ne .Params.sitemap_exclude true }}

Finally add another {{ end }} to line 21.

{{ end }}{{ end }}

If the page is rebuilt now, all contents where sitemap_exclude: true is specified should no longer appear in the sitemap.

General | OSBN

Some articles are now offered in multiple languages

In the last few years I have been thinking about publishing at least some articles in English from time to time. So far, however, the technical implementation was too cumbersome for me. But with Hugo it’s done pretty easy, as I noticed today.

The first thing to do is to add the following entries to the configuration file config.toml.

DefaultContentLanguage = "de"

        languageName = "Deutsche Version"
        weight = 1
        languageName = "English version"
        weight = 2

The first line specifies that de is the default language. The rest defines the existing languages, gives them a name and a weighting (the lower the more important).

Now we create a new article. Let’s just call the file Let’s assume that the article is important enough to be published in English as well. So we create another article and name the file As you can see the title has been extended by a .en. Hugo now automatically understands that the article with .en is the English version and the other one is the German version.

But what if someone opens the German version but doesn’t understand German? There should be a kind of switch available. For this one can use for example the following code.

{{ if .IsTranslated }}
	{{ range .Translations }} | {{ .Language.LanguageName }} {{ end}}
{{ end }}

This checks whether the article is also available in another language. If so, a link to the corresponding versions will be shown. If not, nothing is displayed. I put this code on under the main heading of all articles. If the link “English version” appears at an article, I wrote the article in English as well. Currently one will find this link only at this article for the moment. Gradually there will be more articles in German and English (also older ones) available.

OSBN | General

Update Hugo

Hugo is not installed on my webspace by default. Therefore I have to install new versions manually. To make this easier I built a small script.

CUR_VERSION="$("$BIN_DIR"/hugo version 2>/dev/null | cut -d'v' -f2 | cut -c 1-6)"
NEW_VERSION=$(curl --silent "" | jq -r '.[0].name' | tr -d v)

echo "Hugo:  Current Version: $CUR_VERSION => New Version: $NEW_VERSION"

if ! [ "$NEW_VERSION" = "$CUR_VERSION" ]; then

  curl -L --output hugo.tar.gz "${NEW_VERSION}/hugo_${NEW_VERSION}_Linux-64bit.tar.gz"
  tar -C "${BIN_DIR}" -xvzf hugo.tar.gz hugo
  rm hugo.tar.gz
    echo "Die current Version of Hugo ist allready installed"

This checks whether the current version offered on Github is more current than the one available on the web space. If so, the current version of Github will be downloaded and installed on the webspace.

OSBN | General