From 8165163089fab0a42f57152147ec5c0401d47765 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Fri, 10 Jun 2022 20:17:56 -0700 Subject: [PATCH] Add furigana support --- layouts/_default/single.html | 2 +- layouts/index.html | 4 ++-- layouts/partials/content.html | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 layouts/partials/content.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aebd38c..7d02963 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -12,6 +12,6 @@ {{ partial "metadata.html" . }}
- {{ .Content }} + {{ partial "content.html" .Content }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 05090d9..3e3236b 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,7 +2,7 @@ {{ partial "pagination.html" . }} {{ if eq .Paginator.PageNumber 1 }}

{{ .Title }}

- {{ .Content }} + {{ partial "content.html" .Content }}
{{ end }} {{ range .Paginator.Pages }} @@ -11,7 +11,7 @@

{{ .Title }}

{{ partial "metadata.html" . }} - {{ .Content | truncate 500 }} Read more » + {{ partial "content.html" .Content | truncate 500 }} Read more »
{{ end }} diff --git a/layouts/partials/content.html b/layouts/partials/content.html new file mode 100644 index 0000000..133428f --- /dev/null +++ b/layouts/partials/content.html @@ -0,0 +1 @@ +{{ replaceRE `\[([^\]]*)\]{([^\}]*)}` `$1($2)` . | safeHTML }}