Change default names for contributor's portrait #16

Merged
mih merged 1 commit from msz/www.trr379.de:portraitpat into main 2026-02-12 04:29:16 +00:00
Contributor

Previous behavior was that the value of .Params.portrait (defined in markdown front matter) was treated as a glob pattern. If .Params.portrait was nil, "*thumbnail*" would be used by default.

This commit changes the behavior to use the following resolution order: .Params.portrait (verbatim), "*portrait*", "*thumbnail*".

In current practice, only two names are used for images: "portrait.(jpg|webp)" and "thumbnail.(jpg|webp)". Usually, portrait is larger and thumbnail is cropped. Most contributor pages declare "portrait.(jpg|webp)" explicitly in the front matter.

If current naming patterns remain in use, this change should make declaring .Params.portrait basically obsolete, unless a really custom file name is used (in such case, the manual override remains available). As far as defaults go, a larger image is likely preferred on a "profile" page.

This should also help auto-generated pages, allowing us to do so also without storing information about the portrait in the metadata pool.

Note: default is alias of https://gohugo.io/functions/compare/default/

Previous behavior was that the value of `.Params.portrait` (defined in markdown front matter) was treated as a glob pattern. If `.Params.portrait` was nil, `"*thumbnail*"` would be used by default. This commit changes the behavior to use the following resolution order: `.Params.portrait` (verbatim), `"*portrait*"`, `"*thumbnail*"`. In current practice, only two names are used for images: `"portrait.(jpg|webp)"` and `"thumbnail.(jpg|webp)"`. Usually, portrait is larger and thumbnail is cropped. Most contributor pages declare `"portrait.(jpg|webp)"` explicitly in the front matter. If current naming patterns remain in use, this change should make declaring `.Params.portrait` basically obsolete, unless a really custom file name is used (in such case, the manual override remains available). As far as defaults go, a larger image is likely preferred on a "profile" page. This should also help auto-generated pages, allowing us to do so also without storing information about the portrait in the metadata pool. Note: `default` is alias of https://gohugo.io/functions/compare/default/
Previous behavior was that the value of .Params.portrait (defined in
markdown front matter) was treated as a glob pattern. If
Params.portrait was nil, "*thumbnail*" would be used by default.

This commit changes the behavior to use the following resolution
order: .Params.portrait (verbatim), "*portrait*", "*thumbnail*".

In current practice, only two names are used for images:
"portrait.(jpg|webp)" and "thumbnail.(jpg|webp)". Usually, portrait is
larger and thumbnail is cropped. Most contributor pages declare
"portrait.(jpg|webp)" explicitly in the front matter.

If current naming patterns remain in use, this change should make
declaring .Params.portrait basically obsolete, unless a really custom
file name is used (in such case, the manual override remains
available). As far as defaults go, a larger image is likely preferred
on a "profile" page.

This should also help auto-generated pages, allowing us to do so also
without storing information about the portrait in the metadata pool.

Note: default is alias of https://gohugo.io/functions/compare/default/
mih merged commit de00e8a136 into main 2026-02-12 04:29:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
q04/www.trr379.de!16
No description provided.