summaryrefslogtreecommitdiff
path: root/layouts/_default/single.gmi
blob: 3bfe6d0d07e961d694c40d6e18ff03eb0643036c4b8ec3df1fe7bc73b704e0fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{{ define "main" }}
{{ $emoji := cond (.Page.Params.nolinkemoji | default false) "" "🔗 " -}}
=> ./{{ replaceRE ".+?/" "../" .RelPermalink | safeURL }} 🔗 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 }}