惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
I
InfoQ
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园_首页
罗磊的独立博客
V
V2EX
李成银的技术随笔
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
True Tiger Recordings
Vercel News
Vercel News
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
F
Fox-IT International blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
M
Microsoft Research Blog - Microsoft Research
Know Your Adversary
Know Your Adversary
爱范儿
爱范儿
The Register - Security
The Register - Security
G
Google Developers Blog
The Hacker News
The Hacker News
Malwarebytes
Malwarebytes
S
Securelist
博客园 - 三生石上(FineUI控件)
Jina AI
Jina AI
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
S
SegmentFault 最新的问题
博客园 - 叶小钗
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
博客园 - 聂微东
T
Threatpost
博客园 - 【当耐特】
D
Docker
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
V
Visual Studio Blog
C
Cisco Blogs
IT之家
IT之家
S
Security Archives - TechRepublic
Latest news
Latest news
阮一峰的网络日志
阮一峰的网络日志

HCLonely Blog

HCLonely Blog - IP签名图片生成服务 HCLonely Blog - 树莓派搭建私有在线PS网站 将 Node.js 项目打包为一个可执行文件 哔哩哔哩硬核会员搜题脚本 在静态网站上实现浏览记录功能 统一推送服务Nodejs API 在线答题搜答案脚本 青年大学习安卓跳过方法 公主连结 Re:Dive 中文输入法词库 HCLonely Blog - 基于 NodeJs 的 live2d 后端 Api 服务器 HCLonely Blog - 百度分析和谷歌分析适配 pjax HCLonely Blog - hexo-calendar 活动日历插件 Git 免密、免 SSH 进行 push & pull 一款基于 webstack 的 hexo 主题 使用 cron-job 解决 LeanCloud 因流控原因自动唤醒失败的问题 HCLonely Blog - 使用 Cloud Studio 在线搭建、编辑、部署 Hexo 给你的网页添加一个 moc3 格式的 Live2d 模型 Hexo-tag-steamgame 插件 Hexo-online-server 在线编辑发布文章插件 Hexo 博客美化
HCLonely Blog - Valine 添加验证码、博主标签及评论微信、QQ 通知
2020-04-23 · via HCLonely Blog

本文最后更新于天前,内容可能已不再适用!

本教程介绍了如何给 Valine 评论系统添加博主小伙伴访客标签,添加浏览器操作系统图标,以及评论微信QQ通知。

建议有一定 JS 基础的用户根据本教程进行自定义修改,至少能够自己找到为什么会报错,否则不建议修改!

添加标签及图标

链接

https://cdn.jsdelivr.net/gh/HCLonely/Valine@latest/dist/Valine.min.js

与原版相比

  • 添加博主小伙伴访客标签
  • 添加浏览器操作系统图标,需fontawesomeV5支持
  • 邮箱检测更严格
  • meta placeholder可自定义

使用方法

基本方法同原版相同,请先查看原版使用文档并配置好。

Butterfly 主题可以根据这篇文章修改,其他主题请自行修改!

本版比原版多了以下参数:

参数类型说明默认示例
tagMetaArray标签要显示的文字[“博主”,“小伙伴”,“访客”][“博主”,“小伙伴”,“访客”]
masterArray/Stringmd5 加密后的博主邮箱[][“fe01ce2a7fbac8fafaed7c982a04e229”]
friendsArraymd5 加密后的小伙伴邮箱[][“fe01ce2a7fbac8fafaed7c982a04e229”]
metaPlaceholderObjectmeta placeholder 内容{}{“nick”:“昵称/QQ 号”,“mail”:“邮箱(必填)”}

示例

博主
小伙伴
访客

评论微信通知及 QQ 通知

仓库地址

https://github.com/HCLonely/Valine-Admin.git

与原版相比

  • 添加微信提醒功能
  • 添加 QQ 提醒功能
  • 添加禁止邮件提醒功能

使用方法

基本方法同原版相同,请先查看原版使用文档并配置好。

本版比原版多了以下参数:

变量示例说明
SERVER_KEYSCUxxxxxxxx[可选]Server酱SCKEY 用于微信通知
SERVER_TURBO_KEYSCTxxxxxxxx[可选]Server酱·Turbo版SendKey 用于微信通知
SERVER_TURBO_MDtrue[可选]使用Server酱·Turbo版通知时是否使用 MD 模板,默认为false
QMSG_KEYxxxxxxxx[可选]Qmsgkey 用于 QQ 通知
QQ_SHAKE(已失效)true[可选]QQ 通知时发送戳一戳
DISABLE_EMAILtrue[可选]禁止邮件通知博主,@仍然会提醒
TEMPLATE_NAMErainbow[可选]rainbowdefault邮件通知模板

邮件通知模板(模板变量与原版不同)

邮件通知模板在云引擎环境变量中设定,可自定义通知邮件标题及内容模板。

环境变量示例说明
MAIL_SUBJECT${PARENT_NICK},您在${SITE_NAME}上的评论收到了回复[可选]@通知邮件主题(标题)模板
MAIL_TEMPLATE见下文[可选]@通知邮件内容模板
MAIL_SUBJECT_ADMIN${SITE_NAME}上有新评论了[可选]博主邮件通知主题模板
MAIL_TEMPLATE_ADMIN见下文[可选]博主邮件通知内容模板

邮件通知包含两种,分别是被@通知和博主通知,这两种模板都可以完全自定义。默认使用经典的蓝色风格模板(样式来源未知)。

默认被@通知邮件内容模板如下:

<html> <head></head> <body> <table style="width: 99.8%;height:99.8% "> <tbody> <tr> <td> <div style="border-radius: 10px 10px 10px 10px;font-size:13px;    color: #555555;width: 666px;font-family:'Century Gothic','Trebuchet MS','Hiragino Sans GB',微软雅黑,'Microsoft Yahei',Tahoma,Helvetica,Arial,'SimSun',sans-serif;margin:50px auto;border:1px solid #eee;max-width:100%;background: #ffffff repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);"> <div style="width:100%;background:#49BDAD;color:#ffffff;border-radius: 10px 10px 0 0;background-image: -moz-linear-gradient(0deg, rgb(67, 198, 184), rgb(255, 209, 244));background-image: -webkit-linear-gradient(0deg, rgb(67, 198, 184), rgb(255, 209, 244));height: 66px;"> <p style="font-size:15px;word-break:break-all;padding: 23px 32px;margin:0;background-color: hsla(0,0%,100%,.4);border-radius: 10px 10px 0 0;">您在<a style="text-decoration:none;color: #ffffff;" href="<%=siteUrl%>"> <%=siteName%> </a>上的留言有新回复啦! </p> </div> <div style="margin:40px auto;width:90%"> <p><%=pname%> 同学,您曾在文章上发表评论:</p> <div style="background: #fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);margin:20px 0px;padding:15px;border-radius:5px;font-size:14px;color:#555555;"><%-ptext%></div> <p><%=name%> 给您的回复如下:</p> <div style="background: #fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);margin:20px 0px;padding:15px;border-radius:5px;font-size:14px;color:#555555;"><%-text%></div> <p>您可以点击 <a style="text-decoration:none; color:#12addb" href="<%=url%>">查看回复的完整內容 </a>,欢迎再次光临 <a style="text-decoration:none; color:#12addb" href="<%=siteUrl%>"> <%=siteName%> </a></p> <style type="text/css">a:link{text-decoration:none}a:visited{text-decoration:none}a:hover{text-decoration:none}a:active{text-decoration:none}</style> </div> </div> </td> </tr> </tbody> </table> </body> </html>

@通知模板中的可用变量如下(注,这是邮件模板变量,请勿与云引擎环境变量混淆):

模板变量说明
<%=siteName%>博客名称
<%=siteUrl%>博客首页地址
<%=url%>文章地址(完整路径)
<%=pname%>收件人昵称(被@者,父级评论人)
<%-ptext%>父级评论内容
<%=name%>新评论者昵称
<%-text%>新评论内容

默认博主通知邮件内容模板如下:

<html> <head> <style> .wrap span { display: inline-block; } .w260{ width: 260px;} .w20{ width: 20px;} .wauto{ width: auto;} </style> </head> <body> <table style="width: 99.8%;height:99.8% "> <tbody> <tr> <td> <div style="border-radius: 10px 10px 10px 10px;font-size:13px;    color: #555555;width: 666px;font-family:'Century Gothic','Trebuchet MS','Hiragino Sans GB',微软雅黑,'Microsoft Yahei',Tahoma,Helvetica,Arial,'SimSun',sans-serif;margin:50px auto;border:1px solid #eee;max-width:100%;background: #ffffff repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);"> <div style="width:100%;background:#49BDAD;color:#ffffff;border-radius: 10px 10px 0 0;background-image: -moz-linear-gradient(0deg, rgb(67, 198, 184), rgb(255, 209, 244));background-image: -webkit-linear-gradient(0deg, rgb(67, 198, 184), rgb(255, 209, 244));height: 66px;"> <p style="font-size:15px;word-break:break-all;padding: 23px 32px;margin:0;background-color: hsla(0,0%,100%,.4);border-radius: 10px 10px 0 0;">您的<a style="text-decoration:none;color: #ffffff;" href="<%=siteUrl%>"> <%=siteName%> </a>上有新的评论啦! </p> </div> <div style="margin:40px auto;width:90%"> <p><%=name%> 发表评论:</p> <div style="background: #fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);margin:20px 0px;padding:15px;border-radius:5px;font-size:14px;color:#555555;"><%-text%></div> <p><a style="text-decoration:none; color:#12addb" href="<%=url%>" target="_blank">[查看评论]</a></p> <style type="text/css">a:link{text-decoration:none}a:visited{text-decoration:none}a:hover{text-decoration:none}a:active{text-decoration:none}</style> </div> </div> </td> </tr> </tbody> </table> </body> </html>

博主通知邮件模板中的可用变量与@通知中的基本一致,<%=pname%><%-ptext%>变量不再可用。

示例

微信
QQ