mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: add post navigation config and remove params.Site.Params.navigationReverse
Closes #480
This commit is contained in:
@@ -331,8 +331,6 @@ enableEmoji = true
|
||||
enablePWA = false
|
||||
# FixIt 0.2.14 | NEW whether to add external Icon for external links automatically
|
||||
externalIcon = false
|
||||
# FixIt 0.3.0 | NEW whether to reverse the order of the navigation menu
|
||||
navigationReverse = false
|
||||
# FixIt 0.3.0 | NEW whether to add site title to the title of every page
|
||||
# remember to set up your site title in `hugo.toml` (e.g. title = "title")
|
||||
withSiteTitle = true
|
||||
@@ -444,6 +442,13 @@ enableEmoji = true
|
||||
sticky = false
|
||||
showHome = false
|
||||
|
||||
# FixIt 0.3.10 | NEW Post navigation config
|
||||
[params.navigation]
|
||||
# whether to show the post navigation in section pages scope
|
||||
inSection = false
|
||||
# whether to reverse the next/previous post navigation order
|
||||
reverse = false
|
||||
|
||||
# Footer config
|
||||
[params.footer]
|
||||
enable = true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- .Scratch.Set "version" "v0.3.10-24873c5e" -}}
|
||||
{{- .Scratch.Set "version" "v0.3.10-c936e541" -}}
|
||||
{{- .Scratch.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
@@ -98,11 +98,18 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{{- $navigation := .Site.Params.navigation -}}
|
||||
<div class="post-nav">
|
||||
{{- $pages := .Scratch.Get "mainSectionPages" -}}
|
||||
{{- $prev := $pages.Prev . -}}
|
||||
{{- $next := $pages.Next . -}}
|
||||
{{- if .Site.Params.navigationReverse -}}
|
||||
{{- /* Show the post navigation in section pages */ -}}
|
||||
{{- if $navigation.inSection -}}
|
||||
{{- $prev = .PrevInSection -}}
|
||||
{{- $next = .NextInSection -}}
|
||||
{{- end -}}
|
||||
{{- /* Reverse the next/previous post navigation order */ -}}
|
||||
{{- if $navigation.reverse -}}
|
||||
{{- $prev = $pages.Next . -}}
|
||||
{{- $next = $pages.Prev . -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user