Hugo日子列表和文章头部显示标签

Hugo个人博客搭建过程参考Hugo个人博客搭建 在layouts/partials目录下创建 post_meta.html cp themes/hugo-PaperMod-master/layouts/partials/post_meta.html layouts/partials/post_meta.html vim layouts/partials/post_meta.html 将一下部分的内容 {{- if not (.Param "hideAuthor") -}} {{- with (partial "author.html" .) }} {{- $scratch.Add "meta" (slice .) }} {{- end }} {{- end }} 修改为 {{- $author := (partial "author.html" .) }} {{- $tags := (partial "tags.html" .) }} {{- if not (.Param "hideAuthor") -}} {{- if $tags }} {{- $scratch.Add "meta" (slice $author $tags) -}} {{- else}} {{- $scratch.Add "meta" (slice $author) -}} {{- end}} {{- else}} {{- if $tags }} {{- $scratch.Add "meta" (slice $tags) -}} {{- end}} {{- end }} 在layouts/partials目录下创建tags.html ...

四月 14, 2024 · 1 分钟 · 144 字 · Byter ·  Hugo ·  Post ·  Meta