修改的主题为gridea-theme-bitcron-pro-plus
post.ejs 修改
找到——
<% if(typeof site.customConfig['valine']!=='undefined' && site.customConfig['valine']) { %>
在上一行添加<% } else { %>
。
<div class="doc_comments">
<% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %>
<% if (commentSetting.commentPlatform === 'gitalk') { %>
<div id="gitalk-container"></div>
<%- include('./_blocks/gitalk') %>
<% } %>
<% if (commentSetting.commentPlatform === 'disqus') { %>
<%- include('./_blocks/disqus') %>
<% } %>
<% } else { %>
<% if(typeof site.customConfig['valine']!=='undefined' && site.customConfig['valine']) { %>
<%- include('./_blocks/valine') %>
<% } %>
<% } %>
Valine.ejs 修改
1、替换Valine核心代码库
<!--Valine 的核心代码库-->
<script src="//cdn.jsdelivr.net/npm/valine@1.4.4/dist/Valine.min.js"></script>
核心代码库默认网址打不开,换一个,你也可以保留原代码,注释掉即可。
<!--Valine 的核心代码库-->
<script src="//cdnjs.cloudflare.com/ajax/libs/valine/1.5.1/Valine.min.js"></script>
2、添加回复评论设置
<script>
// 点击回复直接评论,官方版本点击回复时都是跳回到页面上方的评论框进行回复,评论框是固定不动的
// 参考https://immmmm.com/valine-diy,用到jQuery
$(document).ready(function(){
//$('.vemoji-btn').text('😀');
$("#vcomments").on('click', 'span.vat',function(){
$(this).parent('div.vmeta').next("div.vcontent").after($("div.vwrap"));
$('textarea#veditor').focus();
})
})
</script>
3、自动获取QQ昵称和QQ头像
new Valine
下添加
enableQQ: 'true',
4、评论列表分页
pageSize: '10',
5、记录评论者IP
recordIP: 'true',
6、必填字段
默认提示“昵称不能少于3个字符”、“请填写正确的邮件地址”
requiredFields: ['nick','mail'],
7、自定义表情
添加CDN和Maps,来源BiliEmoji。
记得在avatar:''
后加逗号“,
”。
emojiCDN: '//i0.hdslb.com/bfs/emote/',
emojiMaps: {
"tv-doge": "6ea59c827c414b4a2955fe79e0f6fd3dcd515e24.png",
"tv-坏笑": "1f0b87f731a671079842116e0991c91c2c88645a.png",
"tv-难过": "87f46748d3f142ebc6586ff58860d0e2fc8263ba.png",
"tv-生气": "26702dcafdab5e8225b43ffd23c94ac1ff932654.png",
"tv-委屈": "d04dba7b5465779e9755d2ab6f0a897b9b33bb77.png",
"tv-斜眼笑": "911f987aa8bc1bee12d52aafe62bc41ef4474e6c.png",
"tv-呆": "fe1179ebaa191569b0d31cecafe7a2cd1c951c9d.png",
"tv-发怒": "34ba3cd204d5b05fec70ce08fa9fa0dd612409ff.png",
"tv-惊吓": "0d15c7e2ee58e935adc6a7193ee042388adc22af.png",
"tv-呕吐": "9f996894a39e282ccf5e66856af49483f81870f3.png",
"tv-思考": "90cf159733e558137ed20aa04d09964436f618a1.png",
"tv-微笑": "70dc5c7b56f93eb61bddba11e28fb1d18fddcd4c.png",
"tv-疑问": "0793d949b18d7be716078349c202c15ff166f314.png",
"tv-大哭": "23269aeb35f99daee28dda129676f6e9ea87934f.png",
"tv-鼓掌": "1d21793f96ef4e6f48b23e53e3b9e42da833a0f6.png",
"tv-抠鼻": "c666f55e88d471e51bbd9fab9bb308110824a6eb.png",
"tv-亲亲": "a8111ad55953ef5e3be3327ef94eb4a39d535d06.png",
"tv-调皮": "b9c41de8e82dd7a8515ae5e3cb63e898bf245186.png",
"tv-笑哭": "1abc628f6d4f4caf9d0e7800878f4697abbc8273.png",
"tv-晕": "5443c22b4d07fb1907ccc610c8e6db254f2461b7.png",
"tv-点赞": "f85c354995bd99e28fc76c869bfe42ba6438eff4.png",
"tv-害羞": "a37683fb5642fa3ddfc7f4e5525fd13e42a2bdb1.png",
"tv-睡着": "8b196675b53af58264f383c50ad0945048290b33.png",
"tv-色": "61822c7e9aae5da76475e7892534545336b23a6f.png",
"tv-吐血": "09dd16a7aa59b77baa1155d47484409624470c77.png",
"tv-无奈": "ea8ed89ee9878f2fece2dda0ea8a5dbfe21b5751.png",
"tv-再见": "180129b8ea851044ce71caf55cc8ce44bd4a4fc8.png",
"tv-流汗": "cead1c351ab8d79e9f369605beb90148db0fbed3.png",
"tv-偷笑": "bb690d4107620f1c15cff29509db529a73aee261.png",
"tv-抓狂": "fe31c08edad661d63762b04e17b8d5ae3c71a757.png",
"tv-黑人问号": "45821a01f51bc867da9edbaa2e070410819a95b2.png",
"tv-困": "241ee304e44c0af029adceb294399391e4737ef2.png",
"tv-打脸": "56ab10b624063e966bfcb76ea5dc4794d87dfd47.png",
"tv-闭嘴": "c9e990da7f6e93975e25fd8b70e2e290aa4086ef.png",
"tv-鄙视": "6e72339f346a692a495b123174b49e4e8e781303.png",
"tv-腼腆": "89712c0d4af73e67f89e35cbc518420380a7f6f4.png",
"tv-馋": "fc7e829b845c43c623c8b490ee3602b7f0e76a31.png",
"tv-可爱": "9e55fd9b500ac4b96613539f1ce2f9499e314ed9.png",
"tv-发财": "34db290afd2963723c6eb3c4560667db7253a21a.png",
"tv-生病": "8b0ec90e6b86771092a498c54f09fc94621c1900.png",
"tv-流鼻血": "c32d39db2737f89b904ca32700d140a9241b0767.png",
"tv-尴尬": "7cfa62dafc59798a3d3fb262d421eeeff166cfa4.png",
"tv-大佬": "093c1e2c490161aca397afc45573c877cdead616.png",
"tv-流泪": "7e71cde7858f0cd50d74b0264aa26db612a8a167.png",
"tv-冷漠": "b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png",
"tv-皱眉": "72ccad6679fea0d14cce648b4d818e09b8ffea2d.png",
"tv-鬼脸": "0ffbbddf8a94d124ca2f54b360bbc04feb6bbfea.png",
"tv-调侃": "4bc022533ef31544ca0d72c12c808cf4a1cce3e3.png",
"tv-目瞪口呆": "0b8cb81a68de5d5365212c99375e7ace3e7891b7.png",
// ... 更多表情
}
可选贴吧表情包,复制以下替换。
emojiCDN: '//tb2.bdstatic.com/tb/editor/images/face/',
emojiMaps: {
"呵呵": "i_f01.png",
"哈哈": "i_f02.png",
"吐舌": "i_f03.png",
"啊": "i_f04.png",
"酷": "i_f05.png",
"怒": "i_f06.png",
"开心": "i_f07.png",
"汗": "i_f08.png",
"泪": "i_f09.png",
"黑线": "i_f10.png",
"鄙视": "i_f11.png",
"不高兴": "i_f12.png",
"真棒": "i_f13.png",
"钱": "i_f14.png",
"疑问": "i_f15.png",
"阴险": "i_f16.png",
"吐": "i_f17.png",
"咦": "i_f18.png",
"委屈": "i_f19.png",
"花心": "i_f20.png",
"呼~": "i_f21.png",
"笑眼": "i_f22.png",
"冷": "i_f23.png",
"太开心": "i_f24.png",
"滑稽": "i_f25.png",
"勉强": "i_f26.png",
"狂汗": "i_f27.png",
"乖": "i_f28.png",
"睡觉": "i_f29.png",
"惊哭": "i_f30.png",
"升起": "i_f31.png",
"惊讶": "i_f32.png",
"喷": "i_f33.png",
"爱心": "i_f34.png",
"心碎": "i_f35.png",
"玫瑰": "i_f36.png",
"礼物": "i_f37.png",
"彩虹": "i_f38.png",
"星星月亮": "i_f39.png",
"太阳": "i_f40.png",
"钱币": "i_f41.png",
"灯泡": "i_f42.png",
"茶杯": "i_f43.png",
"蛋糕": "i_f44.png",
"音乐": "i_f45.png",
"haha": "i_f46.png",
"胜利": "i_f47.png",
"大拇指": "i_f48.png",
"弱": "i_f49.png",
"OK": "i_f50.png",
"伤心": "i_f51.gif",
"加油": "i_f52.gif",
"必胜": "i_f53.gif",
"期待": "i_f54.gif",
"牛逼": "i_f55.gif",
"胜利": "i_f56.gif",
"跟丫死磕": "i_f57.gif",
"踢球": "i_f58.gif",
"面壁": "i_f59.gif",
"顶": "i_f60.gif",
"巴西怒": "i_f61.gif",
"伴舞": "i_f62.gif",
"奔跑": "i_f63.gif",
"点赞手": "i_f64.gif",
"加油": "i_f65.gif",
"哭泣": "i_f66.gif",
"亮红牌": "i_f67.gif",
"球迷": "i_f68.gif",
"耶": "i_f69.gif",
"转屁股": "i_f70.gif",
// ... 更多表情
}
bilibili的emojiCDNemote/
可以塞到emojiMaps的文件名前,这样可以容纳//i0.hdslb.com/bfs/emote/
链接下更多表情包,像【贴吧 | 哔哩哔哩动画 | Acfun | …】评论系统的多套表情切换功能需要魔改Valine代码,就不介绍了。
8、Valine添加一言
修改config.json
,"type": "input",
改为"type": false,
。
或者将"value": "Just Go Go",
中的 Just Go Go 删去,再删掉Gridea软件主题设置中填写的 Just Go Go,这样看上去加载占位提示符会有点延迟。
{
"name": "placeholder",
"label": "占位提示符",
"group": "Valine评论系统",
"type": "input",
"value": "Just Go Go",
"note": "评论区占位提示符"
},
valine.ejs中添加,
<script type="text/javascript">
//添加一言
fetch('https://v1.hitokoto.cn/?c=a')
.then(response => response.json())
.then(data => {
document.getElementById("veditor").setAttribute("placeholder",data.hitokoto+"__"+data.from);
})
.catch(console.error)
</script>
9、Valine添加每日诗句(可选)
添加方法同上,加进去就行了。
<script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
<script type="text/javascript">
jinrishici.load(function(result) {
var jrsc_plac = result.data.content + "\n「" + result.data.origin.title + "」" + result.data.origin.dynasty + " · " + result.data.origin.author;
document.getElementById("veditor").setAttribute("placeholder",jrsc_plac);
})
</script>
我的valine.ejs
代码
<!--评论显示区,请插入合适的位置-->
<div id="comment"></div>
<!--Leancloud 操作库:-->
<script src="//cdn1.lncld.net/static/js/3.6.1/av-min.js"></script>
<!--Valine 的核心代码库-->
<script src="//cdnjs.cloudflare.com/ajax/libs/valine/1.5.1/Valine.min.js"></script>
<!--<script src="//cdn.jsdelivr.net/npm/valine@1.4.4/dist/Valine.min.js"></script>-->
<script>
new Valine({
el:'#comment',
appId: '<%=site.customConfig['appId']%>',
appKey: '<%=site.customConfig['appKey']%>',
placeholder: '<%=site.customConfig['placeholder']%>',
avatar:'',
pageSize: '10',
recordIP: 'true',
requiredFields: ['nick','mail'],
enableQQ: 'true',
emojiCDN: '//i0.hdslb.com/bfs/',
emojiMaps: {
"tv-doge": "emote/6ea59c827c414b4a2955fe79e0f6fd3dcd515e24.png",
"tv-坏笑": "emote/1f0b87f731a671079842116e0991c91c2c88645a.png",
"tv-难过": "emote/87f46748d3f142ebc6586ff58860d0e2fc8263ba.png",
"tv-生气": "emote/26702dcafdab5e8225b43ffd23c94ac1ff932654.png",
"tv-委屈": "emote/d04dba7b5465779e9755d2ab6f0a897b9b33bb77.png",
"tv-斜眼笑": "emote/911f987aa8bc1bee12d52aafe62bc41ef4474e6c.png",
"tv-呆": "emote/fe1179ebaa191569b0d31cecafe7a2cd1c951c9d.png",
"tv-发怒": "emote/34ba3cd204d5b05fec70ce08fa9fa0dd612409ff.png",
"tv-惊吓": "emote/0d15c7e2ee58e935adc6a7193ee042388adc22af.png",
"tv-呕吐": "emote/9f996894a39e282ccf5e66856af49483f81870f3.png",
"tv-思考": "emote/90cf159733e558137ed20aa04d09964436f618a1.png",
"tv-微笑": "emote/70dc5c7b56f93eb61bddba11e28fb1d18fddcd4c.png",
"tv-疑问": "emote/0793d949b18d7be716078349c202c15ff166f314.png",
"tv-大哭": "emote/23269aeb35f99daee28dda129676f6e9ea87934f.png",
"tv-鼓掌": "emote/1d21793f96ef4e6f48b23e53e3b9e42da833a0f6.png",
"tv-抠鼻": "emote/c666f55e88d471e51bbd9fab9bb308110824a6eb.png",
"tv-亲亲": "emote/a8111ad55953ef5e3be3327ef94eb4a39d535d06.png",
"tv-调皮": "emote/b9c41de8e82dd7a8515ae5e3cb63e898bf245186.png",
"tv-笑哭": "emote/1abc628f6d4f4caf9d0e7800878f4697abbc8273.png",
"tv-晕": "emote/5443c22b4d07fb1907ccc610c8e6db254f2461b7.png",
"tv-点赞": "emote/f85c354995bd99e28fc76c869bfe42ba6438eff4.png",
"tv-害羞": "emote/a37683fb5642fa3ddfc7f4e5525fd13e42a2bdb1.png",
"tv-睡着": "emote/8b196675b53af58264f383c50ad0945048290b33.png",
"tv-色": "emote/61822c7e9aae5da76475e7892534545336b23a6f.png",
"tv-吐血": "emote/09dd16a7aa59b77baa1155d47484409624470c77.png",
"tv-无奈": "emote/ea8ed89ee9878f2fece2dda0ea8a5dbfe21b5751.png",
"tv-再见": "emote/180129b8ea851044ce71caf55cc8ce44bd4a4fc8.png",
"tv-流汗": "emote/cead1c351ab8d79e9f369605beb90148db0fbed3.png",
"tv-偷笑": "emote/bb690d4107620f1c15cff29509db529a73aee261.png",
"tv-抓狂": "emote/fe31c08edad661d63762b04e17b8d5ae3c71a757.png",
"tv-黑人问号": "emote/45821a01f51bc867da9edbaa2e070410819a95b2.png",
"tv-困": "emote/241ee304e44c0af029adceb294399391e4737ef2.png",
"tv-打脸": "emote/56ab10b624063e966bfcb76ea5dc4794d87dfd47.png",
"tv-闭嘴": "emote/c9e990da7f6e93975e25fd8b70e2e290aa4086ef.png",
"tv-鄙视": "emote/6e72339f346a692a495b123174b49e4e8e781303.png",
"tv-腼腆": "emote/89712c0d4af73e67f89e35cbc518420380a7f6f4.png",
"tv-馋": "emote/fc7e829b845c43c623c8b490ee3602b7f0e76a31.png",
"tv-可爱": "emote/9e55fd9b500ac4b96613539f1ce2f9499e314ed9.png",
"tv-发财": "emote/34db290afd2963723c6eb3c4560667db7253a21a.png",
"tv-生病": "emote/8b0ec90e6b86771092a498c54f09fc94621c1900.png",
"tv-流鼻血": "emote/c32d39db2737f89b904ca32700d140a9241b0767.png",
"tv-尴尬": "emote/7cfa62dafc59798a3d3fb262d421eeeff166cfa4.png",
"tv-大佬": "emote/093c1e2c490161aca397afc45573c877cdead616.png",
"tv-流泪": "emote/7e71cde7858f0cd50d74b0264aa26db612a8a167.png",
"tv-冷漠": "emote/b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png",
"tv-皱眉": "emote/72ccad6679fea0d14cce648b4d818e09b8ffea2d.png",
"tv-鬼脸": "emote/0ffbbddf8a94d124ca2f54b360bbc04feb6bbfea.png",
"tv-调侃": "emote/4bc022533ef31544ca0d72c12c808cf4a1cce3e3.png",
"tv-目瞪口呆": "emote/0b8cb81a68de5d5365212c99375e7ace3e7891b7.png",
"珑歌Taki_问号": "garb/15856c32cb30a08f361259a59c71b0edee4427dc.png@65w.webp",
"珑歌Taki_打Call": "garb/67544581bd5f1390e6d95ac34c47867a9e9ebbbb.png@65w.webp",
"珑歌Taki_好耶": "garb/0176869034a23b2523b552687ec851f4567bb452.png@65w.webp",
"珑歌Taki_点赞": "garb/243dcd30319137f2715adbea4a4b106835e5c772.png@65w.webp",
"珑歌Taki_啊对对": "garb/b2576d904e7fa6cada13a35236611f0128fe7a3a.png@65w.webp",
"珑歌Taki_达咩": "garb/e39b5d13f7276c08caef3ea7b9585ab94de423da.png@65w.webp",
"珑歌Taki_辣眼睛": "garb/7db3c777e5f618f4458fd379db9b6cfcc5f96a59.png@65w.webp",
"珑歌Taki_晚安": "garb/cf46da11526aae66fa9b29532a32f262feaf806b.png@65w.webp",
"珑歌Taki_羞羞": "garb/05ae694d1ef5335673825357ec3bcaee81ca2fd2.png@65w.webp",
"珑歌Taki_叉你": "garb/7b6c47c462770fd91ca78982cf43a2025564fead.png@65w.webp",
"珑歌Taki_给你一拳": "garb/1e46191feebe3412e07919dd33f2daef01884c0d.png@65w.webp",
"珑歌Taki_委屈": "live/e4ce02a977edbd40a6df488f8ce317f1efb77e01.png@65w.webp",
"珑歌Taki_呃呃": "live/e5c634f3c00b440af5e0269d6cd23a54dcd78a83.png@65w.webp",
"珑歌Taki_爱你": "live/27e8e2c6679a2e268a2dc0032adec7e0f68abd89.png@65w.webp",
"珑歌Taki_惊": "live/30fedf447cef730d5acb87c945bf964d4e43b8be.png@65w.webp",
"珑歌Taki_干杯": "live/68db36d0645df15f4bb8e678d7d9f3a13840eaec.png@65w.webp",
"樱吹雪_Yuki_啵啵": "garb/a963d838a5f6197defbb6e0591377d4bfd37707a.png@65w.webp",
"樱吹雪_Yuki_打call": "garb/18f1f1c34738ebb3e2fc6a99bb2afe24192906ab.png@65w.webp",
"樱吹雪_Yuki_晚安": "garb/c2651d764536e9de174dfc3ab6c0b74ba38d637e.png@65w.webp",
"樱吹雪_Yuki_贴贴": "garb/dd5d3510ff3169348cfbd0308432cbf4d86f95da.png@65w.webp",
"樱吹雪_Yuki_好耶": "garb/8a65b68d1c318f5878f610f0e6be5ab55cfad755.png@65w.webp",
"樱吹雪_Yuki_嗷呜": "garb/fbb35575d9eeb199895056f6f2e678ea1568034f.png@65w.webp",
"樱吹雪_Yuki_问号": "garb/31b0cd34cdf7d76c9167c319c4a3aa8c084bfd56.png@65w.webp",
"樱吹雪_Yuki_哈哈": "garb/b64bccc47c050c201dd1a046c03ebff6bc73f94c.png@65w.webp",
"樱吹雪_Yuki_妈": "garb/be0e78b625d6b76300b917445c65998c052cb3ce.png@65w.webp",
"樱吹雪_Yuki_比心": "garb/c6acc382cf720529338d9426e1e7a45bd00ac6db.png@65w.webp",
"樱吹雪_Yuki_wink": "garb/c2500df5817faf7ca63af1cefe62c2526d7693aa.png@65w.webp",
"樱吹雪_Yuki_狐狸": "garb/26ae388cad7fb59d8797e7e0d77f198cdab46928.png@65w.webp",
"花丸晴琉_mua": "emote/25be806bfbbb5300afdbeeb64977c90cd1254bf1.png",
"花丸晴琉_wink": "emote/343d2d4bbf5919f25e37f971cf114d07232c5e73.png",
"花丸晴琉_啊咧": "emote/b34c5a1827762b981d689bbc51f134469ef06f23.png",
"花丸晴琉_大笑": "emote/1e28846f5cbd897dd2653142b8be9db42dfbdcb3.png",
"花丸晴琉_呆住": "emote/2b31495e0c538e095d44ff1a17834abe317a05d2.png",
"花丸晴琉_对不起": "emote/02d1e8ddfac938b20956f3d83350f442d398286a.png",
"花丸晴琉_好耶": "emote/29724d41c08ec63962e0974aa653ea8be0cf3947.png",
"花丸晴琉_挥手": "emote/2c0753c98d4e098a3c5f27ab658b1046b4032572.png",
"花丸晴琉_惊慌": "emote/e8307d3bd2ad84434e2f6de1eea727aaa138d987.png",
"花丸晴琉_泪目": "emote/02a805b640a1bd824d21c5e21cf2dbb19f03b6a1.png",
"花丸晴琉_丧": "emote/e45bd7cf880f36a439ef47c355c73065911992ac.png",
"花丸晴琉_生气": "emote/dfbfccd43db22e547f62563b73ae7a474b1163a2.png",
"花丸晴琉_晚安": "emote/40b60d5c04c8e7037089c408e68a73d51fd3dee7.png",
"花丸晴琉_无语": "emote/ac4cf2356a708eb11199f266160cb76be129ead9.png",
"花丸晴琉_喜欢": "emote/71a508d3183fb59f1ddf3a42af59fa7495f2c18c.png",
"花丸晴琉_邪恶": "emote/0a8175363b7c8270836323a627b1fe437938399c.png",
"花丸晴琉_疑惑": "emote/4aef9a2a5c9800faf2501014e1fba1fbf180b8f0.png",
"花丸晴琉_嘤嘤": "emote/b5584ef24436d42364e7234a9cd8734e00f872f6.png",
"花丸晴琉_赞": "emote/adf49b5e19731a8176b774f55b5472b9234ee555.png",
"花丸晴琉_早安": "emote/c5e20c947c10bb931413b8e4bc80b2bd3b09971e.png",
"-菫時-打Call": "live/e8073adeb52036d0d563c848c4b55b8449bc4b85.png@65w.webp",
"-菫時-分号分号": "live/f2a7a0916015a741a192ae85ee593a39c6dd04a7.png@65w.webp",
"-菫時-哎呀": "live/0a691aec40c738918014b27acfefa3b295b8a458.png@65w.webp",
"-菫時-地蕾": "live/cdb1f3adeee987c1fe5303ca90443932edb23d30.png@65w.webp",
"-菫時-困困": "live/c9450e570d7abcf5a920b65e18b9624b75c9d4fb.png@65w.webp",
"-菫時-生气": "live/021761abdfe8dc417e5267b74877bebd43dcfd58.png@65w.webp",
"-菫時-亲亲": "live/e0ae55eb80c6b7c01eeb042a26a3bd2938ed679a.png@65w.webp",
"-菫時-急了": "live/bea985bcf662dc4d85c9f78633c57398b7c3d223.png@65w.webp",
"-菫時-问号": "live/5b29c4c15e6b97da2df564899f84906fc800590b.png@65w.webp",
"-菫時-拜比": "live/a9fa62db7b7233dac30d3abd851b992710bc1649.png@65w.webp",
"纱依shayi_打call": "garb/4d97de8b2d6bb9cb19621af93550b3560e85277f.png@65w.webp",
"纱依shayi_喜欢": "garb/d345b8ff2f2dcd5a4833aa613fc7849bfb25f5e2.png@65w.webp",
"纱依shayi_晚安": "garb/f34ec93c5aa7fdb7cc919544df401474bed1a3c1.png@65w.webp",
"纱依shayi_kira": "garb/f784e4dc7d40f3d3a7ddb6977c241ff6d6a5db26.png@65w.webp",
"纱依shayi_贴贴": "garb/003679cdb44d37576b700f8ed0f4e85bc6ffc8a7.png@65w.webp",
"纱依shayi_结婚": "garb/b1a9e35f04b81476d1d93fdc3979fe194e873915.png@65w.webp",
"纱依shayi_甜蜜的": "garb/415a5fec5062816d6c316a718cf7f739dc12dcef.png@65w.webp",
"纱依shayi_摸鱼": "garb/b7f7d09fec93dd889b9e12286989dbfa41770689.png@65w.webp",
"纱依shayi_好厉害": "garb/7dceff9c32cb6a7a617c910cc840eaeaa89f1e60.png@65w.webp",
"纱依shayi_开心": "garb/360612ea05619a9517f9735e10f6a8e592eb6b35.png@65w.webp",
"纱依shayi_疑问": "garb/f591282a33cb0eb16e6ac679792ea90ce42e6d67.png@65w.webp",
"纱依shayi_哼": "garb/538c428f2d5bcaeefa60c81bb96e9a82475a59d2.png@65w.webp",
"纱依shayi_心碎": "garb/59697798dd454428c773ae989745af62042025ee.png@65w.webp",
"纱依shayi_趴": "garb/5261ebff0fce07a4bde695f56b1e90e03b2a22b9.png@65w.webp",
"纱依shayi_蹭蹭": "garb/8feb22fa3a58e7a26c31792be79fab8c015fa7f6.png@65w.webp",
"纱依shayi_喵": "garb/9a05fc8a87b3f5f05a3c01eec984aaec0f6727e1.png@65w.webp",
"冥冥meichan_太爱钱了": "garb/item/e3d018abc7dfcaba7a95b512d313591ec015e984.png",
"冥冥meichan_不可以": "garb/item/5cfc0218594fbe8b2946e67e03fc4ea5c4a19d36.png",
"冥冥meichan_优雅红茶": "garb/item/8698f417982fd8d5abadf5207407532bb1b5b44f.png",
"冥冥meichan_哭哭": "garb/item/32817fbdd4226afe71e1aa3d8f0a91c62729567d.png",
"冥冥meichan_不想输": "garb/item/04fdc12859be022fba9992c76f89b0956d19262d.png",
"冥冥meichan_开车": "garb/item/3414c37849153f2ebd0fe6c8d7298bbc711c4ed9.png",
"冥冥meichan_大钻戒": "garb/item/fa42d4a68660e6c3d6447cdf0fe7d95cc4c7cdae.png",
"冥冥meichan_带走": "garb/item/9862fdd11fb28e2456a5cd3f864f87a46f20604f.png",
"冥冥meichan_我好了": "garb/item/8855c3fcfc538ee1d96e9ec25f758a0b5602cf66.png",
"冥冥meichan_嗨呀": "garb/item/caebcb782f3a8742548786cd52cb4d80d8353e03.png",
"冥冥meichan_好喜欢哦": "garb/item/3cc66caaf1a62e1778b18a458e58b38df99cfa0f.png",
"冥冥meichan_给你一拳": "garb/item/9b9e4aa83cedd7016bf2f2a83bbe838b648f01ff.png",
"冥冥meichan_理发店": "garb/item/6026b23be561844d08c5bc4b2d66316c3eeebb15.png",
"冥冥meichan_典": "garb/item/172ea06085c8d242f3105d0d04826217bbe4fbeb.png",
"冥冥meichan_信积拉奶": "garb/item/57902ef1f2392e1b8ca4a92ee9c844c18b633009.png",
"冥冥meichan_饭饭": "garb/item/79a5c3bda7449e06f032c095144d8218b9acb335.png",
"冥冥meichan_盯": "garb/item/9c9419db0b80a40ab36eed395251e7efe6421b69.png",
"冥冥meichan_流汗": "garb/item/014bd9e4519567f7f711c0ef8138ffcd022750cd.png",
"冥冥meichan_晚安": "garb/item/4ed6aba3c606484511e550e9d8070a74c004ba8e.png",
"冥冥meichan_mua": "garb/item/21b927b32c186a8c4dd12ff48fcb19461d8dcd0e.png",
"冥冥meichan_关注冥冥": "garb/item/55cfde3719b757aa211e5f1d136cd8c8a1e0dc2f.png",
"冥冥meichan_你是懂的": "garb/item/724e8fe83e63a0814995dc8fd7a5d874c0568028.png",
"冥冥meichan_你懂个P": "garb/item/ffa551eaec65b9b3e33eb388fb91f9c02e4ff67a.png",
"冥冥meichan_钱不够啊": "garb/item/d153516692abb248a2429319ff7eb8cff4b2d463.png",
"冥冥meichan_寄": "garb/item/4de329afec2e0ebe3c4d0db0da710721bed35ff3.png",
// ... 更多表情
}
});
</script>
<script>
// 点击回复直接评论,官方版本点击回复时都是跳回到页面上方的评论框进行回复,评论框是固定不动的
// 参考https://immmmm.com/valine-diy,用到jQuery
$(document).ready(function(){
//$('.vemoji-btn').text('😀');
$("#vcomments").on('click', 'span.vat',function(){
$(this).parent('div.vmeta').next("div.vcontent").after($("div.vwrap"));
$('textarea#veditor').focus();
})
})
</script>
<script type="text/javascript">
//添加一言
fetch('https://v1.hitokoto.cn/?c=a')
.then(response => response.json())
.then(data => {
document.getElementById("veditor").setAttribute("placeholder",data.hitokoto+"__"+data.from);
})
.catch(console.error)
</script>
main.less 修改
1、在 veditor 输入界面增加背景图
将 CSS 加到你的博客样式文件中,图片改成你喜欢的。
#veditor {
background-image: url(https://cdn.jsdelivr.net/gh/drew233/cdn/20200409110727.webp);
background-size: contain;
background-repeat: no-repeat;
background-position: right;
background-color: rgba(255, 255, 255, 0);
resize: vertical
}
如果使用主题文件夹中的文件,url改为本地路径即可,如../media/images/veditor-bg.gif
。
2、隐藏评论系统 Valine Powered By信息
main.less 中添加
.vpower.txt-right {
display: none;
}
3、评论头像旋转
main.less 中添加
img.vimg:hover {
transform: rotateZ(360deg);/*图像旋转360度*/
transition: all 1.5s ease-in-out;/*给所有规定以慢速开始和结束的过渡效果1.5s*/
}
friends.ejs 修改
Gridea软件菜单添加“友情链接 Internal /friends”,启用主题内置的友情链接,自定义配置编辑友链。
友链LOGO
LOGO采用api.iowen.cn,根据URL地址获取网站 Favicon。
需要获取图标的URL地址,如:www.iowen.cn
,确保URL能够正常打开。
不需要 http(s)://
,且结尾必须填 .png
。
请求示例:
https://api.iowen.cn/favicon/www.iowen.cn.png
1、移除友链以外内容(可选)
用<!--
-->
注释掉以下区域。
<div class="main"><div class="main-inner"><div class="content">
…
</div></section>
</div></div></div>
2、打开评论系统
同上,添加<% } else { %>
。
3、屏蔽friends-desc
注释掉friends-desc。
<!-- <div class="friends-desc"> -->
<!-- </div> -->
friends.less 修改
友链部分居中
找到friend-container
区域,添加post-content
代码如下,
.friend-container {
display: flex;
flex-direction: column;
align-items: center;
min-height: 100%;
flex: auto;
.friend-detail {
flex: auto;
padding: 24px 32px;
width: 1000px;
border-radius: 4px;
}
.post-content {
display: flex;flex-wrap: wrap; justify-content: center;
}
}
post-content部分可改为(不建议):
.post-content {
display: grid;grid-template-columns: repeat(2, 1fr);justify-items: center;
}
darkmode.less 修改
添加暗黑模式背景图片,代码如下:
//设置背景图片
.darkmode {
background: url(../media/images/682df424b899a901fff1b8541c950a7b0308f5ae.jpg) fixed;
background-repeat: no-repeat;
background-size: 100%;
opacity: 70%;
}
本来想改成这样的,需要改header.ejs
。
footer.ejs 修改
<span style="display: inline;margin-right:15px;">👁<strong><span id="busuanzi_value_site_pv"></span></strong></span>
前面添加——
<div><div class="github-badge"><a href="https://open.gridea.dev" target="_blank" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">Gridea</span></a></div>
<div style="display: inline-block"> </div>
<div class="github-badge"><a href="https://github.com/Wu-jiyan/gridea-theme-bitcron-pro-plus" target="_blank" rel="nofollow"><span class="badge-subject">Theme</span><span class="badge-value bg-green">Bitcron Pro Plus</span></a></div></div>
Gridea-个性化-自定义CSS添加如下CSS代码——
.github-badge {
display: inline-block;
border-radius: 4px;
text-shadow: none;
font-size: 12px;
color: #fff;
line-height: 1.25;
margin-bottom: 5px
}
.github-badge a {
color: #fff
}
.github-badge .badge-subject {
display: inline-block;
background-color: #555;
padding: 4px 4px 4px 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px
}
.github-badge .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px
}
.github-badge .bg-blue {
background-color: #007ec6 !important
}
.github-badge .bg-green {
background-color: #97ca00 !important
}
#footer span {
font-size: .9em
}
根据xiaxi626/gridea-theme-bitcron-pro-plus微调
想加载本地评论框背景图片,原../media/images/veditor-bg.gif
前要加/
。
持续更新中
参考
Hexo NexT 评论系统 Valine 的使用_valine.min.js_WuGenQiang的博客
Valine自定义表情与QQ邮箱头像支持 | Wittoy's Blog @ 篱落闲栈
为你的Gridea博客加上Valine评论系统 | kveln's blog
博客Valine评论样式美化 - 简书
【个人网站搭建】GitHub pages+hexo 框架下隐藏next主题的评论系统 Valine Powered By信息_隐藏power by valine_wangqingchuan92的博客
HTML 如何将 float:left 的 div 居中对齐|极客教程
Hexo博客 | 如何让你的valine更好看_JUST LOVE SMILE的博客
【博客美化】评论带头像,且支持旋转_weixin_34040079的博客
css 动画中 ease,seae-in,ease-in-out,ease-out,效果区别_css ease_小赞赞No1的博客
效果过度transition:all_transition: all_靓仔微笑的博客