Home → The Classics → The Classic Bikeshed Posts
note.html
Published:
[!NOTE] I don’t use this anymore given that
- Hugo now supports markdown alerts, and
- I’ve changed the way I support update notes.
The code is only here for historic purposes.
This just wraps some content in an <aside>
element. I’ll figure out the styling some other time.
TODO
- Add these notes to the page’s scratch variable.
Source Code
{{ $type := .Get "type" | default "Note" }}
<aside class="stack-small">
<b>{{ cond (ne $type "") (print (title $type) ":") "" }}
{{ with .Get "date" -}}
<time datetime="{{ dateFormat `2006-01-02T15:04:05-07:00` . }}">{{ dateFormat `02 Jan 2006 at 15:04 SAST` . }}</time>
{{- end }}</b>
{{ cond (or (ne $type "") (.Get "date")) "<br>" "" | safeHTML }}
{{ .Inner }}
</aside>