-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Add Permalink option for section pages #8523
Comments
It is. |
I see. Maybe this should be a feature request, then? It would be quite helpful for me at least to be able to change the URL of the list pages using some option similar to the |
It behaves like it is for a reason -- I don't see how you could translate the permalink config to work for list pages, but I would be happy to be proven wrong. |
I don't really know how it works behind the scenes. But we already have the ability to change the URL of list pages. We just have to use the |
So, on the technical side this isn't a problem. But it's a permalink config, so they should be ... permanent. And the only permanent part of a section is the ... section path. Given 2 common examples (assuming no date is set in section front matter):
How stable would the above be? And would it be a good URL? |
Right. I suppose it would be necessary to have different options for single pages vs. list pages. Something like the following for list pages:
It could support the |
@writeonlycode yes, something like that could work, but we need to somehow rework the existing [permalinks]
[permalinks.section]
posts = "/some/new/path/"
[permalinks.page]
posts = "/:06/:1/:2/:title/" |
That looks good! And it is valid TOML as far as I can see. I suppose the assumption should be that if no kind is specified, it defaults to single pages, so the following two should be equivalent:
In this way, it will be backwards compatible. And in addition to those, we could have the
This looks like a good way to go! |
Since this was a major deal-breaker I worked on a patch for this; here's the branch in my fork for anyone interested: https://github.com/Mai-Lapyst/hugo/tree/allow-permalinks-conf-for-branchbundles Works currently with permalinks configs like [permalinks]
docs = "/docs/1.0/:sections[1:]/:filename" And even when using |
@Mai-Lapyst I think that a PR would be highly welcome. |
…iguration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes gohugoio#8523
@istr Have created one; you can test it out if you want. |
…iguration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes gohugoio#8523
…iguration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes gohugoio#8523
…iguration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes gohugoio#8523
…iguration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes gohugoio#8523
…iguration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes gohugoio#8523
…configuration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes #8523
Fixes gohugoio#9448 Fixes gohugoio#11184 See gohugoio#8523
Fixes gohugoio#9448 Fixes gohugoio#11184 See gohugoio#8523
Fixes gohugoio#9448 Fixes gohugoio#11184 See gohugoio#8523
Fixes gohugoio#9448 Fixes gohugoio#11184 See gohugoio#8523
* Move config loading to the page package * Fix a lower bound panic for the `:sections` slice syntax. * Always return the `:title` * Add some permalinks integration tests * Also see issues below Fixes gohugoio#9448 Fixes gohugoio#11184 See gohugoio#8523
* Move config loading to the page package * Fix a lower bound panic for the `:sections` slice syntax. * Always return the `:title` * Add some permalinks integration tests * Also see issues below Fixes gohugoio#9448 Fixes gohugoio#11184 See gohugoio#8523
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. |
I have something like the following option in the config.toml:
If I visit
http://localhost:1313/new-posts/post-name/
I get the intended page. But if I visithttp://localhost:1313/new-posts/
I don't get the list page, as I would expect. Instead, I get nothing at all. I still have to go tohttp://localhost:1313/posts/
to get the list page.The version I'm using:
I'm not sure if this behavior is intended. But it would be a good idea to have the ability to change the URL of the list pages using the permalinks option as well. Right now, I have to add the
url
parameter in the front matter of the_index.md
to make the list page have the different url.The text was updated successfully, but these errors were encountered: