Back to tags

Hugo

Hugo Sort Tags by Count

I wanted to sort the tags in the “Tags” page by the count of child pages. This can be achieved by creating a terms.html template page. From there the data can be fetched nicely:

{{ range .Data.Terms.ByCount }}
    {{ partial "widgets/tag.html" (dict "tag" .Page.Title "count" .Count)}}
{{ end }}
Continue reading

Hugo Partial Parameters

When implementing the Hugo Zettel theme I wanted to extract the tag element as a reusable widget inside the theme. The input requirements are:

  • tag name
  • amount of posts with the tag

However, the Hugo partials only take one input parameter where we typically pass the context. However, this didn’t feel like the right approach because the partial would need to know do different things based on the context it is in.

The solution turned out to be quite simple as you can pass a dictionary as …

Continue reading

Hugo Taxonomies

Taxonomies are user defined groupings of content. 1

Taxonomies are configured in the config.toml file like this

[taxonomies]
	category = "categories"
	tag = "tags"

The first part defines the singular form and the scond part the plural form.

Taxonomies can be accessed on special taxonomy pages or sitewide with the .Site.Taxonomies variable. For example the .Site.Taxonomies.tags can be used to fetch a map of tags which will return a mapping of taxonomy keys with lists of pages …

Continue reading

Hugo content sections

Sections are defined by the content structure based on the first directory under the content directory, so called root sections. Nested sections require an _index.md file inside the directory. 1

Continue reading

Hugo Zettelkasten

Hugo theme for taking notes with the Zettelkasten method.

Zettelkasten can be considered as an extension to your brain where you process and store data and make connections between ideas.

Setup

Prerequisites for Hugo Pipe’s PostCSS 1

npm install -g postcss-cli
npm install -g autoprefixer

Content organization

Tags

Add tags to the front matter of each note. This gives some categorization of topics for the note and makes it possible to find related items later if there are no direct links …

Continue reading

Tailwind CSS

Tailwind is a low-level CSS framework for building web pages with building blocks.

  • unopinionated
  • low-level utility classes
  • work from HTML
  • responsive
  • component friendly
  • customizable
Continue reading