Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from hugo-fixit:master #26

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/init/index.html
Original file line number Diff line number Diff line change
@@ -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" . -}}
Expand Down
9 changes: 8 additions & 1 deletion layouts/partials/single/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
Loading