summaryrefslogtreecommitdiff
path: root/layouts/_default/single.gmi
blob: 5508559ee0302683d7d500ea3ef440e0781e6c5443c3a611df9f05c80ffb2504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{{ define "main" }}
{{ $emoji := cond (.Page.Params.nolinkemoji | default false) "" "🔗 " -}}
=> / 🔗 Return to homepage


# {{ .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 | safeHTML }}{{ end }}