-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Feature Request: Add default permalink format configuration setting #4641
Comments
Otherwise the URL format does not work. See gohugoio/hugo#4641 for a feature request to fix.
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. |
I think this issue is relevant and valuable because, without the requested feature, one must create a separate |
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. |
Thanks for keeping this alive, @moorereason. |
... I also heartily support this issue. |
Come on.... this needs to be done... |
I was just about to create a new issue with this very same feature enhancement request, but managed to find an existing one first. I have the same situation, we'll be using the same URL format for all posts on the site, regardless of section. It doesn't make sense to redundantly specify the same configuration directive for every section, and take the risk of publishing incorrectly formatted URLs in case you'd forget to reconfigure things when you add a new section for your posts, as these may end up used by others. |
I also heartily support this issue. |
For all the sites currently built with Hugo...
Setting a default if you only have one section that needs a permalink setting doesn't buy you anything. |
Even if the case is that one has just a single section, this doesn't mean that a default setting wouldn't be useful, since when adding additional sections this default setting would then be used, which means less redundancy and less risk of generating wrong permalinks. Also, having permalink settings is used/can be needed when you migrate a site from an older system and you want to keep the same URL format (that does not match the default in Hugo). With this in mind, I'd say the suggestion is still relevant. |
I am with Joe here. The default option works well for most sites (I think). I would hate, as a beginner, to find my URLs changed when porting a site to Hugo, maybe without knowing they are set in config, and having to dig up through multiple files and hours to figure this out. At least with the default setting, I am aware it is using directory path. |
I think we need to clarify something here - No one here is asking to change the current default behavior. Even with what we suggest in this feature request, Hugo would behave the same by default. All we are asking for is simply a way to centrally (in the main config) change the default permalink format using a new setting. The setting would naturally have a default value that is the same as the current default permalink format. Hence, it's only when someone actively adds this new setting to the config (and with a non-default value), that the behavior would change.
This will not happen out of the blue unless you actively reconfigure Hugo, so there's no problem here.
No need for that.
Even if this feature request is implemented, it will default to the directory path you want, so no problem here either. To clarify further:
|
Following up on this Discourse topic, I'd like to request a method, perhaps a global config setting, to set the default permalink format. That is, if there is no entry for a section in the
[permalinks]
config, it would fall back on this new setting. Currently, it appears to be hard-coded to/:slug/
.The text was updated successfully, but these errors were encountered: