aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--layouts/_default/_markup/render-link.html3
-rw-r--r--layouts/_default/single.gmi3
3 files changed, 4 insertions, 3 deletions
diff --git a/TODO b/TODO
index 2ff58e2..4766810 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,4 @@
- create shortcode for relative root
-- allow link emojis to be turned off on a per-page basis
- put date written and time to read somewhere in page
- add tag support
- fix "layouts/_default/single.gmi" changing preformatted text
diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html
index 9a14f8f..fb5a1e3 100644
--- a/layouts/_default/_markup/render-link.html
+++ b/layouts/_default/_markup/render-link.html
@@ -1 +1,2 @@
-<a href="{{ .Destination | safeURL }}" rel="noreferrer">🔗 {{ .Text | safeHTML }}</a>
+{{ $emoji := cond (.Page.Params.nolinkemoji | default false) "" "🔗 " -}}
+<a href="{{ .Destination | safeURL }}" rel="noreferrer">{{ $emoji }}{{ .Text | safeHTML }}</a>
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi
index 145796f..3bfe6d0 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -1,11 +1,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\[(.+?)\]\((.+?)\)` "\n=> $2 🔗 $1" }}
+{{- $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 }}