msfjarvis.dev/layouts/_default/single.html

25 lines
900 B
HTML

{{ define "main" -}}
<div class="post">
<h1>{{ .Title }}</h1>
<p class="post-date">
<span><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "January 2, 2006" }}</time> | ~{{ .ReadingTime }} min read </span>
{{- with .Params.devLink -}}
| Also available on <a href="{{ . }}">dev.to</a>
{{- end -}}
</p>
<p>
{{ range .Params.tags }}
<button class="tag-button"><a class="tag-button" href="{{ "tags/" | absLangURL }}{{ . | urlize }}">#{{.}}</a> </button>
{{ end }}
</p>
{{- with .Content -}}
{{ . | replaceRE "(<h[1-2] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor"> 🔗&#xFE0E;</a> ${3}` | safeHTML }}
{{- end -}}
</div>
{{ if and .Site.Params.CommentoURL (and (not .Site.BuildDrafts) (not .Site.IsServer)) -}}
<h2>Comments</h2>
{{ partial "commento.html" . }}
{{- end }}
{{- end }}