gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75k stars 7.47k forks source link

Option to not generate aliases for first page of pagination pages #12572

Closed razonyang closed 3 months ago

razonyang commented 3 months ago

https://discourse.gohugo.io/t/pagination-seems-to-create-aliases/22422/6?u=razon

bep commented 3 months ago

We currently have a paginate option (meaning: default pagination page size), so we need to consolidate a little. I suggest:

// Loaded from the 'pagination' key in hugo.toml.
type struct PaginationConfig {
  DefaultPageSize int // old paginate
  DisableAliases bool
  Path string // old paginatePath
}

And make sure that the old config setup also works.

jmooring commented 3 months ago

We also have paginatePath.

jmooring commented 3 months ago

I just saw something like this in a site config:

[languages.en]
weight = 1
paginatePath = "page-en"

[languages.de]
weight = 2
paginatePath = "page-de"

The pagination path is different for each language. Not sure how that's going to work if we include it in the struct above.

bep commented 3 months ago

The pagination path is different for each language. Not sure how that's going to work if we include it in the struct above.

I don't see how that will be a problem, the above will still work. We will want to eventually deprecate paginatePath etc., but then the above would look like:

[languages.de]
weight = 2
[languages.de.pagination]
path = "page-de"
github-actions[bot] commented 3 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.