From 2432a6dfd3cb2e5dc4933aaf25f98a0b65772c9e Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Wed, 21 Feb 2024 14:17:21 +0800 Subject: [PATCH] fix: do not paginate on page (#36) fix: section titles parsing --- .../partials/base/functions/sections-titles.html | 14 ++++++++------ layouts/partials/base/title.html | 8 +++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/layouts/partials/base/functions/sections-titles.html b/layouts/partials/base/functions/sections-titles.html index 26587a4..0979762 100644 --- a/layouts/partials/base/functions/sections-titles.html +++ b/layouts/partials/base/functions/sections-titles.html @@ -2,12 +2,14 @@ {{- $titles := slice }} {{/* Get parent section of the page. */}} {{- $section := cond .IsSection .Parent .CurrentSection }} -{{- with $section }} - {{/* Break the loop if home page reached. */}} - {{- if not .IsHome }} - {{- $titles = $titles | append .Title }} - {{/* Dive deeper. */}} - {{- $titles = $titles | append (partial "base/functions/sections-titles" .) }} +{{- if ne $section . }} + {{- with $section }} + {{/* Break the loop if home page reached. */}} + {{- if not .IsHome }} + {{- $titles = $titles | append .Title }} + {{/* Dive deeper. */}} + {{- $titles = $titles | append (partial "base/functions/sections-titles" .) }} + {{- end }} {{- end }} {{- end }} {{- return $titles }} diff --git a/layouts/partials/base/title.html b/layouts/partials/base/title.html index 3b6a0c7..49ab55a 100644 --- a/layouts/partials/base/title.html +++ b/layouts/partials/base/title.html @@ -3,9 +3,11 @@ {{- $titles = slice .Site.Title }} {{- end }} {{/* Append paginator title. The partial must be included after paginating. */}} -{{- with .Paginator }} - {{- if gt .PageNumber 1 }} - {{- $titles = $titles | append (i18n "paginator_title" .) }} +{{- if not .IsPage }} + {{- with .Paginator }} + {{- if gt .PageNumber 1 }} + {{- $titles = $titles | append (i18n "paginator_title" .) }} + {{- end }} {{- end }} {{- end }} {{/* Append the sections titles. */}}