Skip to content

Commit

Permalink
fix: do not paginate on page (#36)
Browse files Browse the repository at this point in the history
fix: section titles parsing
  • Loading branch information
razonyang committed Feb 21, 2024
1 parent 48f1040 commit 2432a6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 8 additions & 6 deletions layouts/partials/base/functions/sections-titles.html
Expand Up @@ -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 }}
8 changes: 5 additions & 3 deletions layouts/partials/base/title.html
Expand Up @@ -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. */}}
Expand Down

0 comments on commit 2432a6d

Please sign in to comment.