添加主题自定义配置参数
This commit is contained in:
+24
-6
@@ -14,12 +14,30 @@
|
||||
<h2><%= post.title %></h2>
|
||||
<%- post.content %>
|
||||
<h3> </h3>
|
||||
<% post.tags.forEach((tag) => { %>
|
||||
<a href="<%= tag.link %>">#<%= tag.name %></a>
|
||||
<% }); %>
|
||||
<div style="text-align: right;">
|
||||
↶ <a href="/">返回首页</a>
|
||||
</div>
|
||||
<% if (site.customConfig.showtag) { %>
|
||||
<% post.tags.forEach((tag) => { %>
|
||||
<a href="<%= tag.link %>">#<%= tag.name %></a>
|
||||
<% }); %>
|
||||
<% } %>
|
||||
<% if (site.customConfig.homeback) { %>
|
||||
<div style="text-align: right;">
|
||||
↶ <a href="/">返回首页</a>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (site.customConfig.twikoo) { %>
|
||||
<h3> </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 %>', // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
|
||||
el: '#tcomment', // 容器元素
|
||||
// region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填
|
||||
// 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') %>
|
||||
|
||||
Reference in New Issue
Block a user