typo/layouts/_default/single.html
Frank Villaro-Dixon 1ee4c77a5e
single view: markdownify summary
The summary is not markdownified, and thus we see the md content on the summary. This fixes that
2024-10-10 13:57:36 +02:00

100 lines
2.0 KiB
HTML

{{ define "main" }}
{{/* Breadcrumbs */}}
{{ if not .IsHome }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<div {{ if .Param "autonumber" }} class="autonumber" {{ end }}>
<div class="single-intro-container">
{{/* Title and Summary */}}
<h1 class="single-title">{{ .Title }}</h1>
{{ with .Param "summary" }}
<p class="single-summary">{{ . | markdownify }}</p>
{{ end }}
{{/* Reading Time */}}
<p class="single-readtime">
{{ with .Date }}
{{ $dateMachine := . | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := . | time.Format (default ":date_long" $.Site.Params.singleDateFormat) }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
{{end}}
{{ if .Param "readTime" }}
&nbsp; · &nbsp;
{{ .ReadingTime }} min read
{{end }}
</p>
</div>
{{ if .Param "showTags" }}
{{ $taxonomy := "tags" }}
{{ with .Param $taxonomy }}
<div class="single-tags">
{{ range $index, $tag := . }}
{{ with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
<span>
<a href="{{ .Permalink }}">#{{ .LinkTitle }}</a>
</span>
{{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}
{{/* Table of Content */}}
{{ if .Param "toc" }}
<aside class="toc">
<p><strong>Table of contents</strong></p>
{{ .TableOfContents }}
</aside>
{{ end }}
{{/* Page content */}}
<div class="single-content">
{{ .Content }}
{{ if .Site.Params.giscus.enable }}
{{ partial "comments.html" . }}
{{ end }}
</div>
{{ if .Store.Get "hasMermaid" }}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
{{ end }}
{{/* Next prev controls */}}
{{ if not (.Param "hidePagination") }}
{{ partial "pagination-single.html" . }}
{{ end }}
{{/* Back to top */}}
{{ if not (.Param "hideBackToTop") }}
<div class="back-to-top">
<a href="#top">
back to top
</a>
</div>
{{ end }}
</div>
{{ end }}