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

Allow permalinks configuration syntax to url Front Matter. #9714

Closed
regisphilibert opened this issue Mar 24, 2022 · 4 comments · Fixed by #12695
Closed

Allow permalinks configuration syntax to url Front Matter. #9714

regisphilibert opened this issue Mar 24, 2022 · 4 comments · Fixed by #12695

Comments

@regisphilibert
Copy link
Member

Currently

Currently, batch permalink settings can only happen through the site's config's permalinks object. For every setting, it takes a content directory as key and a string that can include "template strings" syntax as value.

To set the permalink of the /recipe directory using the slug:

permalinks:
  recipe: /delicious-recipe/:slug

That is limiting to batch editing content files of a root directory. The recent :sections templates brought more power to the desired permalink but did not fully resolve the limited "targeting" of the batch. For example, if your content files are in a subdirectory content/cooking/recipe, you would have no way (at least I did not find one) to target the files in the directory to batch assign a permalink structure.

The proposal

Allow the url Front Matter key to use the same syntax as permalink's configuration.

---
# content/cooking/recipe/_index.md
title: Delicious Recipes
url: /delicious-recipe
cascade:
  url: /delicious-recipe/:slug
---
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Mar 26, 2023
@bep bep added this to the v0.112.0 milestone Mar 29, 2023
@bep
Copy link
Member

bep commented Mar 29, 2023

Sorry for the ... very late response. I like this.

@bep bep added the Keep label Mar 29, 2023
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@bep bep modified the milestones: v0.113.0, v0.115.0 Jun 13, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 5, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@ytrepidorosonomous
Copy link

This would be excellent.

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants