Add furigana support

main
Elnu 2 years ago
parent b6d8801727
commit 8165163089

@ -12,6 +12,6 @@
{{ partial "metadata.html" . }} {{ partial "metadata.html" . }}
</header> </header>
<br> <br>
{{ .Content }} {{ partial "content.html" .Content }}
</article> </article>
{{ end }} {{ end }}

@ -2,7 +2,7 @@
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
{{ if eq .Paginator.PageNumber 1 }} {{ if eq .Paginator.PageNumber 1 }}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ .Content }} {{ partial "content.html" .Content }}
<hr> <hr>
{{ end }} {{ end }}
{{ range .Paginator.Pages }} {{ range .Paginator.Pages }}
@ -11,7 +11,7 @@
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2> <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ partial "metadata.html" . }} {{ partial "metadata.html" . }}
</header> </header>
{{ .Content | truncate 500 }} <a href="{{ .RelPermalink }}">Read more &raquo;</a> {{ partial "content.html" .Content | truncate 500 }} <a href="{{ .RelPermalink }}">Read more &raquo;</a>
</article> </article>
<br> <br>
{{ end }} {{ end }}

@ -0,0 +1 @@
{{ replaceRE `\[([^\]]*)\]{([^\}]*)}` `<ruby lang="ja">$1<rp>(</rp><rt>$2</rt><rp>)</rp></ruby>` . | safeHTML }}