single.html (2576B)
1 {{ define "main" }} 2 <article class="post"> 3 {{ with .Params.series -}} 4 <h3 class="post-series"> 5 <a href= "{{ (urlize (printf "series/%s/" . )) | absLangURL }}"> 6 {{- . -}} 7 </a> 8 </h3> 9 {{- end -}} 10 11 {{ if .Params.tags }} 12 <span class="post-tags"> 13 {{- range .Params.tags }} 14 #<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}"> 15 {{- . -}} 16 </a> 17 {{- end }} 18 </span> 19 {{ end }} 20 21 <h1 class="post-title"> 22 <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> 23 </h1> 24 25 <div class="post-meta"> 26 {{ if .Date -}} 27 <time class="post-date"> 28 {{- .Date.Format "2006-01-02" -}} 29 </time> 30 {{- end }} 31 {{- with .Params.Author -}} 32 <span class="post-author">{{ . }}</span> 33 {{- end }} 34 {{- if $.Site.Params.showLastUpdated }} 35 <time class="post-date"> 36 {{- or $.Site.Params.updatedDatePrefix "Updated " -}} 37 {{- .Lastmod.Format "2006-01-02" -}} 38 </time> 39 {{- end }} 40 {{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}} 41 <span class="post-reading-time"> 42 {{- .ReadingTime -}} 43 {{- $.Site.Params.minuteReadingTime | default "min read" -}} 44 ({{- .WordCount }} {{ $.Site.Params.words | default "words" -}}) 45 </span> 46 {{- end }} 47 </div> 48 49 {{ partial "cover.html" . }} 50 51 {{ if (.Params.LiveDoc) -}} 52 <div class="index-content framed", style="margin: 3em"> 53 54 This is a living document and subject to change. <br> 55 56 <time class="post-date post-meta" > 57 {{ "Last Updated: " }} {{- .Lastmod.Format "2006-01-02" -}} 58 </time> 59 60 </div> 61 {{- end }} 62 63 {{ if (.Params.Toc | default .Site.Params.Toc) -}} 64 <div class="table-of-contents"> 65 <h2> 66 {{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }} 67 </h2> 68 {{ .TableOfContents }} 69 </div> 70 {{- end -}} 71 72 <div class="post-content"> 73 {{ with .Content -}} 74 <div> 75 {{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">⌗</a> ${3}` | safeHTML -}} 76 </div> 77 {{- end }} 78 </div> 79 80 {{- if eq .Type $.Site.Params.contentTypeName -}} 81 {{ partial "posts_pagination.html" . }} 82 {{- end -}} 83 84 {{- if not (.Params.hideComments | default false) -}} 85 {{ partial "comments.html" . }} 86 {{- end -}} 87 </article> 88 {{ end }} 89