Files
FixIt/layouts/_partials/single/post-author.html
T
0x5c0f 75ee1624bd feat(link): add external link guard feature support (#729)
* feat(external-link-guard): add native redirect mode and improve external-link guard UX

* fix(external-link-guard): remove redirect_url and clarify scope/new_tab_policy docs

* i18n(external-link-guard): localize guard texts across non-English locales

* feat(config)!: migrate `site.Params.externalIcon` to `site.Params.link.external_icon`

* refactor: implement regular and card link rendering

* feat(link-guard): implement link redirection page with copy and confirm functionality

* revert

* feat: implement link guard dialog for external links

---------

Co-authored-by: Cell <1024@lruihao.cn>
2026-04-11 14:37:31 +08:00

31 lines
1.3 KiB
HTML

{{- $params := .Params | merge .Site.Params.page -}}
{{- $author := partial "function/get-author-map.html" .Params.author -}}
{{- .Store.Set "author" $author -}}
{{- $optim := slice
(dict "Process" "resize 16x16 Center webp" "descriptor" "16w")
(dict "Process" "resize 24x24 Center webp" "descriptor" "24w")
(dict "Process" "resize 32x32 Center webp" "descriptor" "32w")
-}}
<span class="post-author">
{{- $content := $author.name | default "Anonymous" -}}
{{- $icon := dict "Class" "fa-solid fa-user-circle" -}}
{{- /* Deprecate $params.authorAvatar in favor of $params.showAvatar and add front matter gravatar {bool} */ -}}
{{- if $author.avatar | and $params.authorAvatar -}}
{{- $content = printf "%v&nbsp;%v" (dict "Src" $author.avatar "Class" "avatar" "Alt" $content "Width" 16 "Height" 16 "OptimConfig" $optim | partial "plugin/image.html") $content -}}
{{- $icon = "" -}}
{{- end -}}
{{- if $author.link -}}
{{- $options := dict "Class" "author" "Destination" $author.link "Title" (T "single.author") "Rel" "author" "Icon" $icon "Content" $content "ExternalIcon" false -}}
{{- partial "plugin/link.html" $options -}}
{{- else -}}
<span class="author">
{{- with $icon -}}
{{- . | partial "plugin/icon.html" }}
{{ end -}}
{{- $content | safeHTML -}}
</span>
{{- end -}}
</span>
{{- /* EOF */ -}}