Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 优化侧边栏最近评论显示邮箱头像 #133

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

mjsoftking
Copy link
Contributor

@mjsoftking mjsoftking commented May 7, 2024

前置要求:Halo ≥ 2.15 ,版本不满足时显示方式与原先相同

  • 侧边栏配置中新增配置侧边栏最近评论-邮箱头像服务地址因为halo字段中未返回镜像地址,所以需要主题添加这个设置
    • 默认值为:https://cravatar.cn/avatar/{hash},支持配置其他参数,如:https://cravatar.cn/avatar/{hash}?d=monsterid默认头像显示为怪物

image

  • 侧边栏邮箱头像显示机制:
    • 评论用户存在头像则显示头像;
    • 不存在头像时显示邮箱头像;
    • 邮箱头像不存在时显示用户名首字符头像。

参考资料

halo-dev/halo#5642
halo-dev/plugin-comment-widget#111

#118

@mjsoftking mjsoftking changed the title pefr: 优化侧边栏显示邮箱头像 perf: 优化侧边栏显示邮箱头像 May 7, 2024
@mjsoftking mjsoftking closed this May 7, 2024
@mjsoftking mjsoftking reopened this May 7, 2024
@mjsoftking
Copy link
Contributor Author

已增加空指针校验,测试版本:2.15、2.12

@mjsoftking mjsoftking changed the title perf: 优化侧边栏显示邮箱头像 perf: 优化侧边栏最近评论显示邮箱头像 May 7, 2024
@mjsoftking
Copy link
Contributor Author

halo-dev/plugin-comment-widget#121

halo不返回此变量,需要主题设置

@nineya
Copy link
Owner

nineya commented Jul 2, 2024

是评论区支持了不同头像源,但是侧边栏获取到的头像还是不能指定头像源嘛

@mjsoftking
Copy link
Contributor Author

评论插件提供了设置默认头像,但是只返回了邮箱MD5值,不返回邮箱头像源、邮箱头像访问路径,需要主题自己配置,然后在侧边栏显示时需要主题拼接到邮箱头像路径上

@nineya nineya merged commit e2e5c85 into nineya:master Jul 2, 2024
@mjsoftking mjsoftking deleted the perf-recent-comments branch July 15, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants