diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-08-17 15:16:09 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-08-17 16:47:50 +0200 |
commit | 01008ba51259e68191b14f8a4725d6116c0c2466 (patch) | |
tree | 4471fb47f602d49b26c51b9c5a1d97dd4f9758cc /config/commonConfig.go | |
parent | 53c0ddfcb4ec2f4d021f6f51c04f0ba9db741b20 (diff) | |
download | hugo-01008ba51259e68191b14f8a4725d6116c0c2466.tar.gz hugo-01008ba51259e68191b14f8a4725d6116c0c2466.zip |
Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder
See #12776
Diffstat (limited to 'config/commonConfig.go')
-rw-r--r-- | config/commonConfig.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/config/commonConfig.go b/config/commonConfig.go index a615c51a7..9dea4a2fc 100644 --- a/config/commonConfig.go +++ b/config/commonConfig.go @@ -422,3 +422,18 @@ type Pagination struct { // Whether to disable generation of alias for the first pagination page. DisableAliases bool } + +// PageConfig configures the behavior of pages. +type PageConfig struct { + // Sort order for Page.Next and Page.Prev. Default "desc" (the default page sort order in Hugo). + NextPrevSortOrder string + + // Sort order for Page.NextInSection and Page.PrevInSection. Default "desc". + NextPrevInSectionSortOrder string +} + +func (c *PageConfig) CompileConfig(loggers.Logger) error { + c.NextPrevInSectionSortOrder = strings.ToLower(c.NextPrevInSectionSortOrder) + c.NextPrevSortOrder = strings.ToLower(c.NextPrevSortOrder) + return nil +} |