From f68baa153983dbedc871a6db3bcceea8fcc8026c Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 25 Jun 2022 23:36:38 -0700 Subject: [PATCH] Add support for furigana in titles --- layouts/_default/single.html | 2 +- layouts/partials/head.html | 2 +- layouts/partials/kanji.html | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/kanji.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e0da0f9..0d0dc1a 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -17,7 +17,7 @@ {{ end }}
-

{{ .Title }}

+

{{ partial "content.html" .Title }}

{{ partial "metadata.html" . }}

diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 20b0151..a47514b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,7 +1,7 @@ - {{ $title := cond .IsHome .Site.Title (printf "%s" .Title | printf "%s%s" (cond (and (eq .Kind "term") (eq .Data.Singular "tag")) "#" "") | printf "%s") }} + {{ $title := cond .IsHome .Site.Title (printf "%s" (partial "kanji.html" .Title) | printf "%s%s" (cond (and (eq .Kind "term") (eq .Data.Singular "tag")) "#" "") | printf "%s") }} diff --git a/layouts/partials/kanji.html b/layouts/partials/kanji.html new file mode 100644 index 0000000..c581295 --- /dev/null +++ b/layouts/partials/kanji.html @@ -0,0 +1 @@ +{{ replaceRE `\[([^\]]*)\]{([^\}]*)}` "" . | safeHTML }}