mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
✨ Feat: add Gravatar mirror site support
This commit is contained in:
@@ -156,6 +156,8 @@ enableEmoji = true
|
||||
# Home page profile
|
||||
[languages.en.params.home.profile]
|
||||
enable = true
|
||||
# Gravatar mirror site domain, default: "www.gravatar.com" since v0.2.13
|
||||
gravatarSite = ""
|
||||
# Gravatar Email for preferred avatar in home page
|
||||
gravatarEmail = ""
|
||||
# URL of avatar shown in home page
|
||||
@@ -375,6 +377,8 @@ enableEmoji = true
|
||||
# 主页个人信息
|
||||
[languages.zh-cn.params.home.profile]
|
||||
enable = true
|
||||
# 选择使用 Gravatar 源站或其他镜像站,若留空则为默认的 "www.gravatar.com" since v0.2.13
|
||||
gravatarSite = ""
|
||||
# Gravatar 邮箱,用于优先在主页显示的头像
|
||||
gravatarEmail = ""
|
||||
# 主页显示头像的 URL
|
||||
|
||||
@@ -315,6 +315,8 @@ Please open the code block below to view the complete sample configuration :(far
|
||||
# Home page profile
|
||||
[params.home.profile]
|
||||
enable = true
|
||||
# {{< version 0.2.13 >}} Gravatar mirror site domain, default: "www.gravatar.com"
|
||||
gravatarSite = ""
|
||||
# Gravatar Email for preferred avatar in home page
|
||||
gravatarEmail = ""
|
||||
# URL of avatar shown in home page
|
||||
|
||||
@@ -326,6 +326,8 @@ hugo
|
||||
# 主页个人信息
|
||||
[params.home.profile]
|
||||
enable = true
|
||||
# {{< version 0.2.13 >}} 选择使用 Gravatar 源站或其他镜像站,若留空则为默认的 "www.gravatar.com"
|
||||
gravatarSite = ""
|
||||
# Gravatar 邮箱,用于优先在主页显示的头像
|
||||
gravatarEmail = ""
|
||||
# 主页显示头像的 URL
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{{- $profile := .Site.Params.home.profile -}}
|
||||
<div class="home-profile">
|
||||
{{- $avatar := $profile.avatarURL -}}
|
||||
{{- with $profile.gravatarEmail -}}
|
||||
{{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%v?s=240&d=mp" -}}
|
||||
{{- if $profile.gravatarEmail -}}
|
||||
{{- with $profile -}}
|
||||
{{- $site := .gravatarSite | default "www.gravatar.com" -}}
|
||||
{{- $avatar = md5 .gravatarEmail | printf "https://%v/avatar/%v?s=240&d=mp" $site -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $avatar -}}
|
||||
<div class="home-avatar">
|
||||
|
||||
Reference in New Issue
Block a user