LoveIt/layouts/_default/single.html

35 lines
2 KiB
HTML
Raw Normal View History

{{ define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end }}
2019-08-04 15:53:35 +02:00
2019-02-03 12:30:44 +01:00
{{ define "content" }}
2019-08-24 13:32:41 +02:00
<div class="post-warp single">
<h1 class="post-title animated pulse faster">{{ .Title }}</h1>
2019-08-04 15:53:35 +02:00
<div class="post-content">
{{ $content := .Content }}
{{ $REin := `<img src="([^"]+)" alt="([^"]+)?" />` }}
{{ $REout := "<figure><img src=/images/loading.svg data-sizes=auto data-src=$1 alt=$2 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<img src="([^"]+)" alt="([^"]+)?" title="([^"]+)?" />` }}
{{ $REout = "<figure><img src=/images/loading.svg data-src=$1 data-sizes=auto alt=$2 title=$3 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `:\(([\w- ]+?)\):` }}
{{ $REout = `<i class="$1 fa-fw"></i>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<sup>\[return\]</sup>` }}
{{ $REout = printf "<sup>[%s]</sup>" (T "return") }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<(h[23456]) (id=".+?")>` }}
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<(sup class="footnote-ref") (id="fnref:.+?")>` }}
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<(li) (id="fn:.+?")>` }}
{{ $REout = `<$1><a class="post-dummy-target" $2></a>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $content | safeHTML }}
2019-08-04 15:53:35 +02:00
</div>
2019-02-03 12:30:44 +01:00
</div>
{{end }}