initial test partial template: author and reader

This commit is contained in:
Jason TIAN 2023-01-08 12:55:12 +08:00
parent 9f1d2d6372
commit a6444dd2a0
3 changed files with 15 additions and 4 deletions

View file

@ -13,14 +13,13 @@ length = 9363456
external_mp3 = "yes" external_mp3 = "yes"
mp3 = "ting.shufang.org/kyoto-craft/kyoto-craft_01_v1.mp3" mp3 = "ting.shufang.org/kyoto-craft/kyoto-craft_01_v1.mp3"
books = "jdsyr" books = "jdsyr"
readers = "daxia" author = "[日] 樱花编辑事务所 编著"
reader = "daxia"
reader_name = "大夏"
episodes_amount = 4 episodes_amount = 4
episodes_base_url = "kyoto-craft" episodes_base_url = "kyoto-craft"
+++ +++
> 作者:[日] 樱花编辑事务所 编著
> 朗读者:[大夏](/summer.html)
京都,世界首屈一指的手工艺之城。 京都,世界首屈一指的手工艺之城。
纷繁多彩的手艺,既象征人类文明的缩影,也是传统文化未来的指针。 纷繁多彩的手艺,既象征人类文明的缩影,也是传统文化未来的指针。

View file

@ -0,0 +1,11 @@
{{/* this is used to display the author and reader information on single page */}}
{{ if .Params.reader_name }}
{{ $url := print .Site.Params.baseURL "/" .Params.reader ".html" }}
<blockquote>
<p>作者:{{- .Params.author -}}
<br>
朗读者:<a href="{{- $url -}}">{{- .Params.reader_name -}}</a>
</p>
</blockquote>

View file

@ -39,6 +39,7 @@
{{ end }} {{ end }}
</header> </header>
<div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes" | default "serif"}} f5 nested-links nested-img mid-gray pr4-l w-two-thirds-l"> <div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes" | default "serif"}} f5 nested-links nested-img mid-gray pr4-l w-two-thirds-l">
{{- partial "author-reader.html" . -}}
{{- .Content -}} {{- .Content -}}
{{- partial "audio-player.html" . -}} {{- partial "audio-player.html" . -}}
{{- partial "episodes-list.html" . -}} {{- partial "episodes-list.html" . -}}