From 9aaa1bf352f7583ed349ce45a35f92872e9f7807 Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Sat, 22 May 2021 00:16:10 +0200 Subject: [PATCH] Add case menu --- themes/chosto/layouts/partials/header.html | 11 +++++++++++ themes/chosto/layouts/partials/listitem.html | 3 +-- themes/chosto/layouts/partials/navbar.html | 16 +++++++++++++++- themes/chosto/layouts/posts/list.html | 3 +-- themes/chosto/layouts/posts/single.html | 15 ++------------- themes/chosto/layouts/taxonomy/list.html | 9 --------- 6 files changed, 30 insertions(+), 27 deletions(-) delete mode 100644 themes/chosto/layouts/taxonomy/list.html diff --git a/themes/chosto/layouts/partials/header.html b/themes/chosto/layouts/partials/header.html index 7e008fb..c14f416 100644 --- a/themes/chosto/layouts/partials/header.html +++ b/themes/chosto/layouts/partials/header.html @@ -12,6 +12,17 @@ {{ end }} {{ end }} + diff --git a/themes/chosto/layouts/partials/listitem.html b/themes/chosto/layouts/partials/listitem.html index 1f0853e..3f5176a 100644 --- a/themes/chosto/layouts/partials/listitem.html +++ b/themes/chosto/layouts/partials/listitem.html @@ -17,14 +17,13 @@ {{ $currentPostIndex := 1 }} {{ $posts := (where $.Site.RegularPages "CurrentSection.Params.Code" "==" $.CurrentSection.Params.Code )}} {{ $postsSorted := (sort $posts "Date" )}} - {{ $postCounts := len $postsSorted }} {{ range $index, $element := $postsSorted }} {{ if eq $element.Title $currentPost.Title }} {{ $currentPostIndex = (add $index 1) }} {{ end }} {{ end }} {{ with .CurrentSection.Params.Code }} - [{{ . }} {{ print $currentPostIndex }}/{{ print $postCounts }}] + [{{ . }}{{ print $currentPostIndex }}] {{ end }} {{ .Title }} diff --git a/themes/chosto/layouts/partials/navbar.html b/themes/chosto/layouts/partials/navbar.html index 2001a77..f3fce88 100644 --- a/themes/chosto/layouts/partials/navbar.html +++ b/themes/chosto/layouts/partials/navbar.html @@ -18,13 +18,27 @@ + {{ $currentPage := . }} {{ range .Site.Menus.main }} {{ if .HasChildren }} diff --git a/themes/chosto/layouts/posts/list.html b/themes/chosto/layouts/posts/list.html index a29c129..e460b3b 100644 --- a/themes/chosto/layouts/posts/list.html +++ b/themes/chosto/layouts/posts/list.html @@ -5,8 +5,7 @@ {{ .Content }} diff --git a/themes/chosto/layouts/posts/single.html b/themes/chosto/layouts/posts/single.html index 8274782..25f97b6 100644 --- a/themes/chosto/layouts/posts/single.html +++ b/themes/chosto/layouts/posts/single.html @@ -4,10 +4,10 @@ If the current blog post belongs to a case, we will add a side menu with all other blog posts belonging to that case, emphasis to the current. --> - {{ with .CurrentSection.Params.Title }} + {{ with .CurrentSection }} {{ end }}
-
{{ .Content }} diff --git a/themes/chosto/layouts/taxonomy/list.html b/themes/chosto/layouts/taxonomy/list.html deleted file mode 100644 index 7b1722b..0000000 --- a/themes/chosto/layouts/taxonomy/list.html +++ /dev/null @@ -1,9 +0,0 @@ -{{ define "main" }} -
-
    - {{ range .Data.Terms.Alphabetical }} -
  • {{ .Page.Title }} {{ .Count }}
  • - {{ end }} -
-
-{{ end }}