%

Hugo: Use the tool build by the project on OpenBSD

Article published the ; modified the
3 minutes to read

This article has 442 words.
RAW source of the article:
Commit version: e21600e

Description

It’s really easy to use, without troubles, Hugo on OpenBSD.

To install the package: # pkg_add hugo

  • Hugo version: 0.53 : Hugo Static Site Generator v0.53 openbsd/amd64 BuildDate: unknown
  • OpenBSD: 6.6
  • Architecture: amd64

But, this version is more year old, and has a lot of bugs.

Utilisation

The Hugo project build releases to download and uncompress; there are 3 files, the binary hugo, and files LICENSE, README.md.

The archives are intended for 32-bits (i386), 64-bits (amd64), and ARM architectures.

Tip

The purpose of this article is to “show up” the various pitfalls related to these official binaries, which sometimes generate changes in Hugo’s configuration, or even malfunctions.

The ultimage version really functionnal is: 0.59.1.

Importants Changes

v0.54.0

  • version: Hugo Static Site Generator v0.54.0-B1A82C61 openbsd/amd64 BuildDate: 2019-02-01T09:41:10Z

In fact, hugo server not run, and exit with error: Error: Error building site: EOF

Bye-bye!

v0.55.0

  • version: Hugo Static Site Generator v0.55.0-4333CC77 openbsd/amd64 BuildDate: 2019-04-08T16:41:18Z
Warning

v0.6x

  • versions 0.60.(x), 0.61.0, 0.62.(x)

Since version 0.60.0, there is a new engine: the goldmark.

It’s necessary to change your file configuration, as (for the toml format):

[markup.goldmark.renderer] unsafe = true

But, it exists this bug, in the rendering of HTML code within the shortcodes.

For the moment, prefer to use v0.59.1!

Deprecated

Page.Hugo is deprecated

This message Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function. says .Hugo variable is deprecated.

You need to replace by the global hugo function.

See: Hugo Documentation: Variables > Hugo

This message Page's .RSSLink is deprecated and will be removed in a future release. Use the Output Format's link informs .RSSLink variable is deprecated.

Prefer to use: {{`` with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}

See: Hugo Documentation: Templates > Output formats

Page’s .URL is deprecated

The message Page's .URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. notifies to stop using the .URL variable.

You need to replace by .Permalink.

Info

Recommandations

Shortcodes

It is therefore recommended that you no longer use the {{``% shortcode %}} syntax, but prefer {{``< shortcode >}} syntax and use the markdownify function.

See: Hugo Documentation: Functions > Markdownify .

Taxonomy

Taxonomy nodes have a new accessor named .Page. It simplifies the use of differents variables, as .Titre.

Instead of using {{ range .Data.Terms.Alphabetical }}, use {{ range .Site.Taxonomies.tags }}.