-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Alternate de-uglified URLs, as "/file" (no extension), with "/dir/" (with trailing slash) only for directory-like pages #7458
Comments
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. |
Still relevant for me, given the multiple times this has been requested, etc. For this to work, it needs to be combined with something with something that sets the right mime-type on the extension-less files uploaded for the webpages, so it needs some support from the webserver and shouldn't be the default behavior. But, at least for folks using static hosting on AWS, GCP, etc., support for per-file mime-types is built-in. I feel like it would be a nice addition. Basically:
|
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. |
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. |
For me, what looks cleanest for a website's URL structure is when the leaf pages are mapped to
/some-file
(no trailing slash) but without a.html
extension, and/foo/
is used only for pages that are directory-like. For me, this is the cleanest design for URLs. This works really well together with hosting on a S3, etc. bucket, where you can push metadata to set the correct content-type when there is no extension for the file.I'm willing to do the work and create a pull request to support this, but before I start coding, it'd like to gauge the openness to such a change, so as to avoid doing all the work to then have it rejected as not a desirable feature.
For Hugo, this would mean:
/foo/
only for "directory-like" pages, but that...An alternate way for point 2 might be to restrict
/foo
only for HTML pages (likely what will happen in practice anyways) and then any extension-less file can be assumed to be one. Also, for some tools, the content-type map may not be even needed. At least for GCP,gsutil
has a mode that auto-detects content-type from the content of the file. I'm guessing it has no problem at all figuring out which files are HTML (from the<!HTML ...>
header.Thoughts? Is this something that Hugo would consider supporting, if a pull request implementing this were to magically appear? :-)
The text was updated successfully, but these errors were encountered: