diff options
author | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2023-07-29 17:33:12 +0700 |
---|---|---|
committer | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2023-07-29 17:33:12 +0700 |
commit | 8261eed6f8c2aeb2488a481f1d89ab9c8ff3a119 (patch) | |
tree | 4dd87c1ca0f2ebc2a459395ee10a3547db3be106 /layouts/_default/list.html | |
parent | 5f84f18c24b3bf64768befad82823a59c26e65d5 (diff) | |
download | victor-8261eed6f8c2aeb2488a481f1d89ab9c8ff3a119.tar.gz |
Support multilingual
Diffstat (limited to 'layouts/_default/list.html')
-rw-r--r-- | layouts/_default/list.html | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ecac06c..7c774d5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -11,26 +11,40 @@ SPDX-License-Identifier: MIT {{ if in .Params.categories "book" }} <section class="toc"> <ol> + {{ range .Page.Translations | append .Page }} {{ range sort .Pages "Weight" }} - <li> - <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> - {{ partial "post-language-switcher.html" . }} - {{ partial "post-info.html" . }} - </li> + <li> + <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> + {{ partial "post-info.html" . }} + </li> {{ end }} - <ol> + {{ end }} + <ol> </section> - {{ else }} + {{ 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> + {{ 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> + <li> + <a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> + {{ partial "post-language-switcher.html" . }} + {{ partial "post-info.html" . }} + </li> {{ end }} - <ol> + <ul> </section> {{ end }} {{ end }} |