mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
fix: author sharing image due to Hugo breaking change
When sharing the page of an author profile (/author/author-name), the avatar image was no longer shown as the sharing image. Hugo team made a breaking change in recent Hugo versions to rename the page `.Kind` to `term` instead of `taxonomy` in this case so the statement was no longer triggered. Fix #1987
This commit is contained in:
1 parent
69856326c6
commit
42e60e0287
1 file changed
+3
-2
@@ -181,8 +181,9 @@
|
||||
{{ $has_logo := fileExists "assets/images/logo.png" | or (fileExists "assets/images/logo.svg") }}
|
||||
{{ $og_image := "" }}
|
||||
{{ $twitter_card := "summary_large_image" }}
|
||||
{{ if (and (eq .Kind "taxonomy") $avatar_image) }}
|
||||
{{ $og_image = ($avatar_image.Fill "270x270 Center").Permalink }}{{/* Match image proc in About widget. */}}
|
||||
{{ if (and (eq .Kind "term") $avatar_image) }}
|
||||
{{/* Match image processing in About widget to prevent generating more images than necessary. */}}
|
||||
{{ $og_image = ($avatar_image.Fill "270x270 Center").Permalink }}
|
||||
{{ $twitter_card = "summary" }}
|
||||
{{ else if $featured_image }}
|
||||
{{ $og_image = $featured_image.Permalink }}
|
||||
|
||||
Reference in new issue
Block a user