Hugo - Exclude several sections from list
以下の黒いスクリーンでは、このサイトのランディングページ(このサイトで「いの一番」に表示されれるページ)の記述から引用し、それを改変しています。
複数のセクションを除外して表示するためには、表現をネスト(入れ子)にするようです。 やり方をようやく見つけたばかりで、それ以上の知識はありません。
Exclude section from list? - support - Hugo Discussion
You can nest clauses in order to exclude several sections.
<h2>すべての記事の更新順|MonologueとMakotoを除く</h2>
<small><ul>
{{ range first 33 (where .Data.Pages.ByLastmod.Reverse "Section" "ne" "monologue") }}
{{ if ne .Section "makoto" }}
{{ .Render "lili" }}
{{ end }}
{{ end }}
</ul></small>
<h2>Monologue</h2>
<small><ul>
{{ range first 22 (where .Data.Pages.ByLastmod.Reverse "Section" "monologue") }}
{{ .Render "lili" }}
{{ end }}
</ul></small>
comments powered by Disqus