aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2023-01-21 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2023-01-22 00:00:00 +0000
commit964663009bd9d285a6adf7e351f54b341e007733fbfc335e827040df95f78723 (patch)
treeb0dd8f019492168907ddb8d4d1668bc34dc428b3d72a614b77092037f03546d2 /layouts/_default
parent953f0e6d234f64f6a6aa30acda157676c36864599b5ded8f0094357c3c168847 (diff)
downloadhugo-theme-journal-964663009bd9d285a6adf7e351f54b341e007733fbfc335e827040df95f78723.tar.gz
hugo-theme-journal-964663009bd9d285a6adf7e351f54b341e007733fbfc335e827040df95f78723.zip
Add indentation for readability
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/single.gmi22
1 files changed, 11 insertions, 11 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi
index 07911df..32704a0 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -10,13 +10,13 @@
{{ $content := .RawContent }}
{{- $refs := findRE `\[.+?\]\(.+?\)` $content }}
{{- if (.Page.Params.makerefs | default true) }}
-{{- range $ref_index, $ref_val := $refs }}
- {{- $ref_num := add $ref_index 1 }}
- {{- $ref_text := $ref_val | replaceRE `\[(.+?)\]\((.+?)\)` "$1" }}
- {{- $content = replace $content $ref_val (print $ref_text "[" $ref_num "]") 1 }}
-{{- end }}
+ {{- range $ref_index, $ref_val := $refs }}
+ {{- $ref_num := add $ref_index 1 }}
+ {{- $ref_text := $ref_val | replaceRE `\[(.+?)\]\((.+?)\)` "$1" }}
+ {{- $content = replace $content $ref_val (print $ref_text "[" $ref_num "]") 1 }}
+ {{- end }}
{{- else }}
-{{- $content = $content | replaceRE `\n\[(.+?)\]\((.+?)\)` (print "\n=> $2 " $emoji "$1") }}
+ {{- $content = $content | replaceRE `\n\[(.+?)\]\((.+?)\)` (print "\n=> $2 " $emoji "$1") }}
{{- end }}
{{- $content = $content | replaceRE `\n####{0,3}` "\n###" }}
{{- $content = $content | replaceRE `(?s)\*{3}(.*?)\*{3}|\*{2}(.*?)\*{2}|\*{1}(.*?)\*{1}` "$1$2$3" }}
@@ -26,11 +26,11 @@
{{- if and (.Page.Params.makerefs | default true) $refs }}
## Links
-{{- range $ref_index, $ref_val := $refs }}
- {{- $ref_num := add $ref_index 1 }}
- {{- $ref_text := $ref_val | replaceRE `\[(.+?)\]\((.+?)\)` "$1" }}
- {{- $ref_link := $ref_val | replaceRE `\[(.+?)\]\((.+?)\)` "$2" }}
+ {{- range $ref_index, $ref_val := $refs }}
+ {{- $ref_num := add $ref_index 1 }}
+ {{- $ref_text := $ref_val | replaceRE `\[(.+?)\]\((.+?)\)` "$1" }}
+ {{- $ref_link := $ref_val | replaceRE `\[(.+?)\]\((.+?)\)` "$2" }}
{{ print "=> " $ref_link " " $emoji $ref_num ": " $ref_text | safeHTML }}
-{{- end }}
+ {{- end }}
{{- end }}
{{- end }}