LoveIt/layouts/_default/single.html

28 lines
1.3 KiB
HTML
Raw Normal View History

2020-01-31 11:46:28 +01:00
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
2019-08-04 15:53:35 +02:00
2020-01-31 11:46:28 +01:00
{{- define "content" -}}
<div class="warpper single">
<h1 class="post-title animated pulse faster">
{{- .Title -}}
</h1>
2019-08-04 15:53:35 +02:00
<div class="post-content">
2020-01-31 11:46:28 +01:00
{{- $content := .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 = `<(.+) (id="fnref:.+?")>` -}}
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
{{- $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>
2020-01-31 11:46:28 +01:00
{{- end -}}