hugo-theme-terminal/layouts/_default/single.html

45 lines
1.1 KiB
HTML
Raw Normal View History

2019-01-28 00:11:02 +00:00
{{ define "main" }}
2019-03-31 17:28:38 +00:00
<div class="post">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
{{ if .Params.Date }}
2019-03-31 17:28:38 +00:00
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
</span>
{{ end }}
2019-03-31 17:28:38 +00:00
{{ with .Params.Author }}
<span class="post-author">::
{{ . }}
</span>
2019-01-28 00:11:02 +00:00
{{ end }}
2019-03-31 17:28:38 +00:00
</div>
2019-01-28 00:11:02 +00:00
2019-03-31 17:28:38 +00:00
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
2019-04-05 06:18:21 +00:00
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
2019-01-28 00:11:02 +00:00
{{ end }}
2019-03-31 17:28:38 +00:00
</span>
{{ end }}
2019-01-28 00:11:02 +00:00
2019-03-31 17:28:38 +00:00
{{ with .Params.Cover }}
<img src="{{ . | absURL }}" class="post-cover" />
{{ end }}
2019-03-31 17:18:08 +00:00
2019-03-31 17:28:38 +00:00
<div class="post-content">
{{- with .Content -}}
2020-01-17 12:11:41 +00:00
<div>
2020-01-24 07:21:30 +00:00
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">&#8983;</a> ${3}` | safeHTML }}
2020-01-17 12:11:41 +00:00
</div>
2020-01-24 07:21:30 +00:00
{{- end -}}
2019-01-28 00:11:02 +00:00
</div>
2020-04-27 13:14:14 +00:00
{{ if eq .Type $.Site.Params.contentTypeName }}
{{ partial "posts_pagination.html" . }}
2019-03-31 17:28:38 +00:00
{{ end }}
{{ partial "comments.html" . }}
</div>
2019-01-28 00:11:02 +00:00
{{ end }}