As cool as HUGO is, its templating language, based on go, is not as easy as go itself.
From time to time I run into problems that I can only solve in a cumbersome way.
Here are some solutions that I have collected over time.
created on | August 17, 2025 |
dateFormat works only for secific date the following works and renders on August 17th, 2025, the string 2025-08-17:
...
created on | August 17, 2025 |
...
created on | August 17, 2025 |
getting a section {{- $rootSection := .Site.GetPage (print "/" .Section "/_index.md") -}} ...
created on | August 17, 2025 |
concatenating strings Strings can be concatenated with print:
{{ $fruits := (print $someOtherFruits " kiwi" " banana" ) }} ...