Closed StrMnL closed 7 months ago
按照layouts/partials/data/title.html中所写
layouts/partials/data/title.html
{{- if .IsHome -}} .... {{ if .Paginator.HasPrev }} {{ $title = printf "%s - %s" .Paginator $siteTitle }} {{ else }} {{ $title = $siteTitle}} {{ end }} {{- else if eq .Kind "term" -}} .... {{ if .Paginator.HasPrev }} {{ $title = $title | append " - " .Paginator }} {{ end }} .... {{- end -}}
在存在分页的情况下,home页第二页起的页面标题应该形如Pager 2 - Hugo Theme Stack Starter
home
Pager 2 - Hugo Theme Stack Starter
term页第二页起的页面标题应该形如Tag: Test - Pager 2 - Hugo Theme Stack Starter
term
Tag: Test - Pager 2 - Hugo Theme Stack Starter
但实际上这并不起作用。无论如何.Paginator.HasPrev恒为false。
.Paginator.HasPrev
0.122.0
3.21.0
No response
https://github.com/StrMnL/hugo-theme-stack-test/
Should be fixed now. Thanks for reporting this!
What happened?
按照
layouts/partials/data/title.html
中所写在存在分页的情况下,
home
页第二页起的页面标题应该形如Pager 2 - Hugo Theme Stack Starter
term
页第二页起的页面标题应该形如Tag: Test - Pager 2 - Hugo Theme Stack Starter
但实际上这并不起作用。无论如何
.Paginator.HasPrev
恒为false。Hugo version
0.122.0
Theme version
3.21.0
What browsers are you seeing the problem on?
No response
More information about the browser
No response
Relevant log output
No response
Link to Minimal Reproducible Example
https://github.com/StrMnL/hugo-theme-stack-test/