You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.6 KiB

4 years ago
  1. {{ define "main" }}
  2. <div class="post">
  3. <h1 class="post-title">
  4. <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
  5. <div class="post-meta">
  6. {{ if .Params.Date }}
  7. <span class="post-date">
  8. {{ .Date.Format "2006-01-02" }} {{ if $.Site.Params.showLastUpdated }}[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]{{ end }}
  9. </span>
  10. {{ end }}
  11. {{ with .Params.Author }}
  12. <span class="post-author">:: {{ . }}</span>
  13. {{ end }}
  14. </div>
  15. {{ if .Params.tags }}
  16. <span class="post-tags">
  17. {{ range .Params.tags }}
  18. #<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
  19. {{ end }}
  20. </span>
  21. {{ end }}
  22. {{ if .Params.Cover }}
  23. <img src="{{ .Params.Cover | absURL }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
  24. {{ end }}
  25. {{ if .Params.Toc }}
  26. <div class="table-of-contents">
  27. <h2>
  28. {{ if .Params.TocTitle }}
  29. {{ .Params.TocTitle }}
  30. {{ else if $.Site.Params.TocTitle }}
  31. {{ $.Site.Params.TocTitle }}
  32. {{ else }}
  33. Table of Contents
  34. {{ end }}
  35. </h2>
  36. {{ .TableOfContents }}
  37. </div>
  38. {{ end }}
  39. <div class="post-content">
  40. {{- with .Content -}}
  41. <div>
  42. {{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">&#8983;</a> ${3}` | safeHTML }}
  43. </div>
  44. {{- end -}}
  45. </div>
  46. {{ if eq .Type $.Site.Params.contentTypeName }}
  47. {{ partial "posts_pagination.html" . }}
  48. {{ end }}
  49. {{ partial "comments.html" . }}
  50. </div>
  51. {{ end }}