-
-
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 suffix selector to Output Formats #8897
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. |
I'm trying to output both html and htm files to maintain historic URLs. html for new files, htm for old. |
The problem
While this is possible and recommended to define any mediaType's extensions as an array of suffixes, it is not currently possible to choose which suffix to use when generating a file from an output format.
To clarify, if I...
rss
suffix to the built-inapplication/rss+xml
mediaThe
rss_feed
output format will generate afeed.xml
file, using the first suffix.Even though several suffixes are declared on the media type, it is impossible to choose one when assigning it to an output format.
proposed solution 1 (as suggested here)
Adding a
suffix
key to theoutputFormat
.If set, Hugo would use the given
suffix
when generating the file.If not set, current behaviour prevails, it would use the first suffix.
Would generate
/feed.rss
proposed solution 2
Use the extension of the template file if matching any of the mediaType suffixes.
if
index.rss_feed.rss
is found, this means the file should be generated atfeed.rss
if
index.rss_feed.xml
is found, this means the file should be generated atfeed.xml
If both files are found, first suffix of the set output format should be used or both files could be created...
The text was updated successfully, but these errors were encountered: