aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default/single.gmi
blob: 9e2ca9cc1251aa568179250a560e024767df483ad8211aaa67e8325eae4e3c13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{ define "main" }}
{{ $emoji := cond (.Page.Params.showlinkemoji | default true) "🔗 " "" -}}
=> / 🔗 Return to homepage


{{ if (.Page.Params.pageinfo | default true) }}{{ partial "pageinfo" . }}

{{ end -}}
# {{ .Name | safeHTML }}
{{ $content := .RawContent }}
{{- $content = $content | replaceRE `\n####{0,3}` "\n###" }}
{{- $content = $content | replaceRE `\n\[(.+?)\]\((.+?)\)` (print "\n=> $2 " $emoji "$1") }}
{{- $content = $content | replaceRE `\*{3}(.+?)\*{3}|\*{2}(.+?)\*{2}|\*{1}(.+?)\*{1}` "$1$2$3$4$5$6" }}
{{- $content = $content | replaceRE `\n- ` "\n* " }}
{{- $content = $content | emojify }}
{{- $content | safeHTML }}{{ end }}