{what you love} ∩ {what the world needs} ∩ {what you can be paid for} ∩ {what you are good at}
This article assumes you know about…
the Go Template language, which is also known as Go HTML,
the slice data structure,
and the set-theoretic concept of intersection (∩). For example, the Japanese concept Ikigai is the following intersection.
{what you love} ∩ {what the world needs} ∩ {what you can be paid for} ∩ {what you are good at}
This intersection can be represented by the following Venn diagram.
In a nutshell, the syntax of
Hugo’s intersect
function
is this:
intersect SLICE1 SLICE2
Or, in a pipeline, this:
SLICE2 | intersect SLICE1
💡 | The order of
the
slice that
results
from this
intersection
is the order of
|
To learn more about this function, see…
and the example below.
On the Infinite Ink website, I tag an article by including something like this in the front matter of the article:
tags: - content - gohugo - tech - yaml - secret
Note that
the
value of
this
tags
[2]
key
is
a
slice.
To hide Infinite Ink’s secret[3] tags from the public, I do these two steps.
In config.yaml
,
I
create
the following
user-defined
listablePortals
site-wide parameter.
params: listablePortals: - activism-hacktivism - asciidoc - backup-sync - business-economics-money - cheatsheet - cli - covid - emoji - forked - git - git-bash - gohugo - golang - intellij - iusethis - joplin - longform - markdown - mathematics - mathjax - messaging - meta - n2s - nix-nux - privacy-security - qutebrowser - tech - tumblelog - twitter-list - unicode - utf-8 - vim - vscode - webdev - windows - words - zeitgeist
Note that
the value of
this
listablePortals
key
is a
slice.
In the relevant Hugo layout file, I include this Go Template code:
{{ $tags := .Params.tags }}
{{ $portals := intersect site.Params.listablePortals $tags }}
{{ range $portals }}
<a href="/portal/{{- . -}}/">#{{- . -}}</a> 
{{ end }}
For this article, this intersection code produces this:
More examples of results of this intersection code is in each tumblelogged item in the Elsewhere Links News section of What’s New at Infinite Ink.
For more about Hugo, see Infinite Ink’s…
Hugo’s Markup Languages: AsciiDoc, HTML, Markdown,
A Way to Compare Hugo’s Markup Languages (featuring inline footnotes)
Hugo Tutorial: Themeless & Gitless Introduction to the Hugo SSG
Configuring Security in Hugo (featuring settings needed to use Asciidoctor and Pandoc)
🔗 Linkified Section Headings in Hugo-Generated Web Pages (featuring Markdown and AsciiDoc examples)
Variable and Parameter Names in Hugo (featuring camelCase🐫 and snake_case🐍)
Hugo’s .RenderString
Method (featuring AsciiDoc admonitions in Markdown)
tags
front-matter key is one of Hugo’s default taxonomies. To learn about this, see gohugo.io/content-management/taxonomies/ and www.ii.com/hugo-tutorial/#_taxonomies.yaml
, is one that has not been turned into a portal. Most secret tags will eventually be portalized.🤞Your public comment or question might immediately improve this page or help me to (eventually) improve this page.