mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Add option to not generate aliases for first page of pagination pages
Also consolidate the pagination configuration into a struct. Closes #12572
This commit is contained in:
@@ -179,6 +179,9 @@ type Config struct {
|
||||
// Server configuration.
|
||||
Server config.Server `mapstructure:"-"`
|
||||
|
||||
// Pagination configuration.
|
||||
Pagination config.Pagination `mapstructure:"-"`
|
||||
|
||||
// Privacy configuration.
|
||||
Privacy privacy.Config `mapstructure:"-"`
|
||||
|
||||
@@ -369,6 +372,17 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Legacy paginate values.
|
||||
if c.Paginate != 0 {
|
||||
hugo.Deprecate("site config key paginate", "Use paginator.defaultPageSize instead.", "v0.128.0")
|
||||
c.Pagination.DefaultPageSize = c.Paginate
|
||||
}
|
||||
|
||||
if c.PaginatePath != "" {
|
||||
hugo.Deprecate("site config key paginatePath", "Use paginator.path instead.", "v0.128.0")
|
||||
c.Pagination.Path = c.PaginatePath
|
||||
}
|
||||
|
||||
c.C = &ConfigCompiled{
|
||||
Timeout: timeout,
|
||||
BaseURL: baseURL,
|
||||
@@ -557,9 +571,11 @@ type RootConfig struct {
|
||||
HasCJKLanguage bool
|
||||
|
||||
// The default number of pages per page when paginating.
|
||||
// Deprecated: Use the Pagination struct.
|
||||
Paginate int
|
||||
|
||||
// The path to use when creating pagination URLs, e.g. "page" in /page/2/.
|
||||
// Deprecated: Use the Pagination struct.
|
||||
PaginatePath string
|
||||
|
||||
// Whether to pluralize default list titles.
|
||||
|
Reference in New Issue
Block a user