From 000d2655efb7839a6b626fae82bf310bd4b4ab74 Mon Sep 17 00:00:00 2001 From: Ngô Ngọc Đức Huy Date: Mon, 31 Jul 2023 08:43:42 +0700 Subject: Add book section recursion --- layouts/partials/feed.html | 13 +++++++++++++ layouts/partials/generic-list.html | 12 ++++++++++++ layouts/partials/toc.html | 15 +++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 layouts/partials/feed.html create mode 100644 layouts/partials/generic-list.html create mode 100644 layouts/partials/toc.html (limited to 'layouts/partials') diff --git a/layouts/partials/feed.html b/layouts/partials/feed.html new file mode 100644 index 0000000..42c7564 --- /dev/null +++ b/layouts/partials/feed.html @@ -0,0 +1,13 @@ +
+
    + {{ range sort .Pages "Date" "desc" }} +
  1. + : + {{ trim .Title " " }} + {{ partial "post-language-switcher.html" . }} + {{ partial "post-info.html" . }} +
  2. + {{ end }} +
      +
+ diff --git a/layouts/partials/generic-list.html b/layouts/partials/generic-list.html new file mode 100644 index 0000000..e8397c4 --- /dev/null +++ b/layouts/partials/generic-list.html @@ -0,0 +1,12 @@ +
+
+ diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html new file mode 100644 index 0000000..f6af753 --- /dev/null +++ b/layouts/partials/toc.html @@ -0,0 +1,15 @@ +{{ $chapters := .Page.Pages }} +{{ range .Page.Translations }} +{{ $chapters = $chapters | lang.Merge .Pages }} +{{ end}} +
    + {{ range sort $chapters "Weight" }} +
  1. + {{ trim .Title " " }} + {{ partial "post-info.html" . }} + {{ if .IsSection}} + {{ partial "toc.html" . }} + {{ end }} +
  2. + {{ end }} +
-- cgit 1.4.1