添加主题自定义配置参数

This commit is contained in:
dmxiaoshen
2023-04-21 10:35:32 +08:00
parent 50b1123c4a
commit cb692ea862
7 changed files with 105 additions and 108 deletions
+24 -6
View File
@@ -14,12 +14,30 @@
<h2><%= post.title %></h2>
<%- post.content %>
<h3>&nbsp;</h3>
<% post.tags.forEach((tag) => { %>
<a href="<%= tag.link %>">#<%= tag.name %></a>&nbsp;
<% }); %>
<div style="text-align: right;">
↶ <a href="/">返回首页</a>
</div>
<% if (site.customConfig.showtag) { %>
<% post.tags.forEach((tag) => { %>
<a href="<%= tag.link %>">#<%= tag.name %></a>&nbsp;
<% }); %>
<% } %>
<% if (site.customConfig.homeback) { %>
<div style="text-align: right;">
↶ <a href="/">返回首页</a>
</div>
<% } %>
<% if (site.customConfig.twikoo) { %>
<h3>&nbsp;</h3>
<div id="tcomment"></div>
<script src="https://cdn.staticfile.org/twikoo/<%= site.customConfig.tversion %>/twikoo.all.min.js"></script>
<script>
twikoo.init({
envId: '<%= site.customConfig.twikoo %>', // 腾讯云环境填 envIdVercel 环境填地址(https://xxx.vercel.app
el: '#tcomment', // 容器元素
// region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhouVercel 环境不填
// path: location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数
lang: 'zh-CN', // 用于手动设定评论区语言,支持的语言列表 https://github.com/imaegoo/twikoo/blob/main/src/client/utils/i18n/index.js
})
</script>
<% } %>
</div>
</div>
<%- include('./_blocks/scripts') %>