Skip to content

Commit

Permalink
fix: title does not show pagination data (#945)
Browse files Browse the repository at this point in the history
* fix: title does not show pagination data

This is caused by partialCached. It turns out that the `.RelPermalink` is the same for all pages generated by the paginator, so they will show the same title as the first page.

closes #941

* doc(exampleSite): set paginate to 3 to force pagination
  • Loading branch information
CaiJimmy authored Feb 19, 2024
1 parent 21da06e commit 03ee336
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exampleSite/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
baseurl: https://example.com
languageCode: en-us
theme: hugo-theme-stack
paginate: 5
paginate: 3
title: Example Site
copyright: Example Person

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name='description' content='{{ $description }}'>
{{ with .Params.Keywords }}<meta name="keywords" content="{{ delimit . ", " }}">{{ end }}

{{- $title := partialCached "data/title" . .RelPermalink -}}
{{- $title := partial "data/title" . -}}
<title>{{ $title }}</title>

<link rel='canonical' href='{{ .Permalink }}'>
Expand Down

0 comments on commit 03ee336

Please sign in to comment.