mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-02 19:52:40 +00:00
🐛 Fix: fix regular page in post navigation
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
{{- define "content" -}}
|
||||
{{- /* All Posts */ -}}
|
||||
{{- $pages := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- $pages := .Scratch.Get "mainSectionPages" -}}
|
||||
|
||||
<div class="page archive">
|
||||
<div class="header">
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
{{- /* Posts */ -}}
|
||||
{{- if ne $posts.enable false | and .Site.RegularPages -}}
|
||||
{{- /* Paginate */ -}}
|
||||
{{- $pages := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- $pages := .Scratch.Get "mainSectionPages" -}}
|
||||
{{- if .Site.Params.page.hiddenFromHomePage -}}
|
||||
{{- $pages = where $pages "Params.hiddenfromhomepage" false -}}
|
||||
{{- else -}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# {{ .Site.Title }}
|
||||
|
||||
{{ $pages := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{ $pages := .Scratch.Get "mainSectionPages" -}}
|
||||
{{- $pages = where $pages "Draft" "eq" false -}}
|
||||
{{- T "section.archiveCounter" (len $pages) }}
|
||||
{{ range $pages.GroupByPublishDate "2006" }}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{ end }}
|
||||
{{- range where .Site.RegularPages "Type" "posts" | first (.Site.Params.home.rss | default 10) -}}
|
||||
{{- range .Scratch.Get "mainSectionPages" | first (.Site.Params.home.rss | default 10) -}}
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- if $params.password | or $params.hiddenFromRss }}{{ continue }}{{ end -}}
|
||||
{{- dict "Page" . "Site" .Site | partial "rss/item.html" -}}
|
||||
|
||||
@@ -10,3 +10,7 @@
|
||||
{{- $homeRelPermalink = strings.TrimSuffix "archives/" $homeRelPermalink -}}
|
||||
{{- $homeRelPermalink = strings.TrimSuffix "offline/" $homeRelPermalink -}}
|
||||
{{- .Scratch.Set "homeRelPermalink" $homeRelPermalink -}}
|
||||
|
||||
{{- /* Set pages of main section */ -}}
|
||||
{{- $pages := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- .Scratch.Set "mainSectionPages" $pages -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- .Scratch.Set "version" "v0.3.1" -}}
|
||||
{{- .Scratch.Set "version" "v0.3.2-RC" -}}
|
||||
{{- .Scratch.Set "params" (.Params | merge .Site.Params.page) -}}
|
||||
{{- .Scratch.Set "this" dict -}}
|
||||
|
||||
|
||||
@@ -98,8 +98,13 @@
|
||||
</div>
|
||||
|
||||
<div class="post-nav">
|
||||
{{- $prev := cond .Site.Params.navigationReverse .Next .Prev -}}
|
||||
{{- $next := cond .Site.Params.navigationReverse .Prev .Next -}}
|
||||
{{- $pages := .Scratch.Get "mainSectionPages" -}}
|
||||
{{- $prev := $pages.Prev . -}}
|
||||
{{- $next := $pages.Next . -}}
|
||||
{{- if .Site.Params.navigationReverse -}}
|
||||
{{- $prev = $pages.Next . -}}
|
||||
{{- $next = $pages.Prev . -}}
|
||||
{{- end -}}
|
||||
{{- with $prev -}}
|
||||
<a href="{{ .RelPermalink }}" class="post-nav-item" rel="prev" title="{{ .LinkTitle }}">
|
||||
{{- dict "Class" "fa-solid fa-angle-left fa-fw" | partial "plugin/icon.html" -}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
|
||||
{{- if $params.related.enable | and (not $params.password) -}}
|
||||
{{- $posts := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- $posts := .Scratch.Get "mainSectionPages" -}}
|
||||
{{- if .Site.Params.page.hiddenFromRelated -}}
|
||||
{{- $posts = where $posts "Params.hiddenfromrelated" false -}}
|
||||
{{- else -}}
|
||||
|
||||
Reference in New Issue
Block a user