-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate.html
9 lines (9 loc) · 1.95 KB
/
update.html
1
2
3
4
5
6
7
8
9
{{/*
NOTE SPACING MATTERS
*/}}{{- $date := .Get "date" }}{{- $date_for_attr := dateFormat "2006-01-02" $date }}{{- $date_for_display := dateFormat "Jan 2, 2006" $date }}{{ $mode := default "marginnote" (.Get "mode") }}{{- $headingLevel := default "h2" (.Get "headingLevel") }}{{- $domId := default (printf "section-update-%s" $date_for_attr) (.Get "domId") }}
{{- if eq $mode "inline" }}<ins class="update" datetime="{{ $date_for_attr }}"><em><strong><time datetime="{{ $date_for_attr }}">{{ $date_for_display }}</time> update:</strong></em> {{ partial "unparagraphy" .Inner }}</ins>
{{- else if eq $mode "paragraph" }}<ins class="update" datetime="{{ $date_for_attr }}"><p><em><strong><time datetime="{{ $date_for_attr }}">{{ $date_for_display }}</time> update:</strong></em> {{ partial "unparagraphy" .Inner }}</p></ins>
{{- else if eq $mode "sidenote" }}<span class="sidenote-number"><ins class="update side" role="note" datetime="{{ $date_for_attr }}"><small><em><strong><time datetime="{{ $date_for_attr }}">{{ $date_for_display }}</time> update:</strong></em> {{ partial "unparagraphy" .Inner }}</small></ins></span>
{{- else if eq $mode "marginnote" }}<ins class="update margin" role="note" datetime="{{ $date_for_attr }}"><small><em><strong><time datetime="{{ $date_for_attr }}">{{ $date_for_display }}</time> update:</strong></em></small> {{ partial "smallParagraphy" .Inner }}</ins>
{{- else if eq $mode "section" }}{{ $header := printf "<%s id=\"%s\"><time datetime=\"%s\">%s</time> update</%s>" $headingLevel $domId $date_for_attr $date_for_display $headingLevel }}<ins aria-labelledby="{{ $domId }}" class="update" datetime="{{ $date_for_attr }}">{{ $header | safeHTML }} {{ partial "paragraphy" .Inner }}</ins>
{{- else }}{{ $inner := printf "<em><strong><time datetime=\"%s\">%s</time> update: </strong></em>%s" $date_for_attr $date_for_display .Inner }}<ins class="update margin" role="note" datetime="{{ $date_for_attr }}">{{ partial "smallParagraphy" $inner }}</ins>{{- end }}