81 lines
3.5 KiB
HTML
81 lines
3.5 KiB
HTML
{{ define "head" }}
|
|
{{ if .Params.featuredImg -}}
|
|
<style>.bg-img {background-image: url('{{.Params.featuredImg}}');}</style>
|
|
{{- else if .Params.images -}}
|
|
{{- range first 1 .Params.images -}}
|
|
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{ end }}
|
|
|
|
{{ define "header" }}
|
|
{{ partial "header.html" . }}
|
|
{{ end }}
|
|
|
|
{{ define "main" }}
|
|
{{- if (or .Params.images .Params.featuredImg) }}
|
|
<div class="bg-img"></div>
|
|
{{- end }}
|
|
<main class="site-main section-inner animated fadeIn faster">
|
|
<article class="thin">
|
|
<header class="post-header">
|
|
<div class="post-meta"><span>{{ .Date.Format .Site.Params.dateform }}</span></div>
|
|
<h1>{{ .Title }}</h1>
|
|
</header>
|
|
<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="#fff" 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 }}
|
|
</div>
|
|
{{- if .Site.Params.relatedPosts }}
|
|
{{- partial "related-posts.html" . -}}
|
|
{{- end }}
|
|
<hr class="post-end">
|
|
<footer class="post-info">
|
|
{{- with $.Param "author" }}
|
|
<p><object type="image/svg+xml" data="{{"author.svg" | relURL}}">{{.}}</object></p>
|
|
{{- end }}
|
|
{{- with .Params.tags }}
|
|
<p>
|
|
<object type="image/svg+xml" data="{{"tag.svg" | relURL}}"></object>
|
|
{{- range . -}}
|
|
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>
|
|
{{- end }}
|
|
</p>
|
|
{{- end }}
|
|
<p><object type="image/svg+xml" data="{{"page.svg" | relURL}}"></object>{{ i18n "wordCount" . }}</p>
|
|
<p><object type="image/svg+xml" data="{{"calendar.svg" | relURL}}"></object>{{ dateFormat .Site.Params.dateform .Date.Local }}</p>
|
|
{{- if and .GitInfo .Site.Params.gitUrl }}
|
|
<p><object type="image/svg+xml" data="{{"gitinfo.svg" | relURL}}"></object><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ dateFormat .Site.Params.dateform .GitInfo.AuthorDate.Local }}</p>
|
|
{{- end }}
|
|
</footer>
|
|
</article>
|
|
{{- if .Params.toc }}
|
|
<aside id="toc">
|
|
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
|
|
{{ .TableOfContents }}
|
|
</aside>
|
|
{{- end }}
|
|
<div class="post-nav thin">
|
|
{{- with .NextInSection }}
|
|
<a class="next-post" href="{{ .Permalink }}">
|
|
<span class="post-nav-label">
|
|
<object type="image/svg+xml" data="{{"nextarrow.svg" | relURL}}"></object> {{ i18n "newer " }}
|
|
</span>
|
|
<br>
|
|
<span>{{ .Title }}</span>
|
|
</a>
|
|
{{- end }}
|
|
{{- with .PrevInSection }}
|
|
<a class="prev-post " href="{{ .Permalink }} ">
|
|
<span class="post-nav-label ">
|
|
{{ i18n "older " }} <object type="image/svg+xml" width="24" height="24" data="{{"prevarrow.svg" | relURL}}"></object>
|
|
</span>
|
|
<br>
|
|
<span>{{ .Title }}</span>
|
|
</a>
|
|
{{- end }}
|
|
</div>
|
|
</main>
|
|
{{ end }}
|
|
{{ define "footer " }}
|
|
{{ partialCached "footer.html " . }}
|
|
{{ end }} |