LoveIt/layouts/_default/single.html

38 lines
1.4 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 -}}
2020-01-31 15:53:04 +01:00
2020-01-31 11:46:28 +01:00
{{- $REin := `:\(([\w- ]+?)\):` -}}
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
{{- $content = replaceRE $REin $REout $content -}}
2020-01-31 15:53:04 +01:00
2020-01-31 11:46:28 +01:00
{{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
{{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
{{- $content = replaceRE $REin $REout $content -}}
2020-01-31 15:53:04 +01:00
2020-01-31 11:46:28 +01:00
{{- $REin = `<sup>\[return\]</sup>` -}}
{{- $REout = `↩︎` -}}
2020-01-31 11:46:28 +01:00
{{- $content = replaceRE $REin $REout $content -}}
2020-01-31 15:53:04 +01:00
2020-01-31 11:46:28 +01:00
{{- $REin = `<(h[23456]) (id=".+?")>` -}}
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
{{- $content = replaceRE $REin $REout $content -}}
2020-01-31 15:53:04 +01:00
2020-01-31 11:46:28 +01:00
{{- $REin = `<(.+) (id="fnref:.+?")>` -}}
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
{{- $content = replaceRE $REin $REout $content -}}
2020-01-31 15:53:04 +01:00
{{- $REin = `<li (id="fn:.+?")(.*?)>\s?<p>` -}}
{{- $REout = `<li $2><p><a class="post-dummy-target" $1></a>` -}}
{{- $content = replaceRE $REin $REout $content -}}
2020-01-31 11:46:28 +01:00
{{- $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 -}}