diff options
author | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2023-07-31 08:43:42 +0700 |
---|---|---|
committer | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2023-07-31 08:43:42 +0700 |
commit | 000d2655efb7839a6b626fae82bf310bd4b4ab74 (patch) | |
tree | 26b6720ff507b4a29816c13cc50942a084812e99 /layouts/_default/list.html | |
parent | e75b69fd48bc953f6dfe2c65c1f70798da3b8adc (diff) | |
download | victor-000d2655efb7839a6b626fae82bf310bd4b4ab74.tar.gz |
Add book section recursion
Diffstat (limited to 'layouts/_default/list.html')
-rw-r--r-- | layouts/_default/list.html | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index bdcd630..46310ad 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -9,44 +9,12 @@ SPDX-License-Identifier: MIT {{ .Content }} </section> {{ if in .Params.categories "book" }} - {{ $chapters := .Page.Pages }} - {{ range .Page.Translations }} - {{ $chapters = $chapters | lang.Merge .Pages }} - {{ end}} <section class="toc"> - <ol> - {{ range sort $chapters "Weight" }} - <li> - <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> - {{ partial "post-info.html" . }} - </li> - {{ end }} - <ol> + {{ partial "toc.html" . }} </section> {{ else if in .Params.categories "blog" }} - <section class="feed"> - <ol reversed> - {{ range sort .Pages "Date" "desc" }} - <li> - <time datetime="{{ .Date }}">{{ .Date.Format "2006-01-02" }}</time>: - <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> - {{ partial "post-language-switcher.html" . }} - {{ partial "post-info.html" . }} - </li> - {{ end }} - <ol> - </section> + {{ partial "feed.html" . }} {{ else }} - <section class="list"> - <ul> - {{ range sort .Pages "Date" }} - <li> - <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> - {{ partial "post-language-switcher.html" . }} - {{ partial "post-info.html" . }} - </li> - {{ end }} - <ul> - </section> + {{ partial "generic-list.html" . }} {{ end }} {{ end }} |