hermit-V2/layouts/_default/single.html

35 lines
1.2 KiB
HTML
Raw Normal View History

{{ define "head" }}
2019-01-03 05:25:14 -05:00
{{ if .Params.featuredImg -}}
<style>.bg-img {background-image: url('{{.Params.featuredImg}}');}</style>
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
2019-01-03 05:25:14 -05:00
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
{{ end }}
2018-10-23 01:15:50 -04:00
{{ define "header" }}
{{ partial "header.html" . }}
2018-10-23 01:15:50 -04:00
{{ end }}
{{ define "main" }}
{{- if (or .Params.images .Params.featuredImg) }}
<div class="bg-img"></div>
{{- end }}
2018-10-23 01:15:50 -04:00
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ .Title }}</h1>
<div class="content">
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }}
2018-10-23 01:15:50 -04:00
</div>
{{- if .Params.comments }}
<div id="comments" class="thin">
{{ partial "comments.html" . }}
</div>
2018-10-23 01:15:50 -04:00
{{- end }}
</main>
{{ end }}
{{ define "footer" }}
{{ partialCached "footer.html" . }}
{{ end }}