Fix template lookup to prefer first suffix when media type has multiple suffixes#14601
Fix template lookup to prefer first suffix when media type has multiple suffixes#1460104cb wants to merge 1 commit into
Conversation
…le suffixes Fixes #13877. When a media type has multiple suffixes defined, only the first suffix should be considered for template lookup. This adds a Suffix field to TemplateDescriptor and uses it during template comparison to prefer templates matching the media type's FirstSuffix.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
|
|
Fixes gohugoio#13877 Close gohugoio#14601 Co-Authored-By: Joe Mooring <[email protected]>
Fixes gohugoio#13877 Close gohugoio#14601 Co-Authored-By: Joe Mooring <[email protected]>
Fixes #13877. When a media type has multiple suffixes defined (e.g. ['b','a','d','c']), only the first suffix should be considered for template lookup as documented.
Previously, the template selection would incorrectly use the last (alphabetically sorted) suffix instead of the first. This fix:
This ensures that templates like page.html.b are preferred over page.html.d when 'b' is the first suffix defined for the media type.