From cb692ea862cf89afaa0a3bca826f9673ad27a23e Mon Sep 17 00:00:00 2001
From: dmxiaoshen
Date: Fri, 21 Apr 2023 10:35:32 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=BB=E9=A2=98=E8=87=AA?=
=?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config.json | 109 +++++++++++--------------------------
templates/_blocks/head.ejs | 11 ++++
templates/archives.ejs | 12 ++--
templates/index.ejs | 4 +-
templates/post.ejs | 30 ++++++++--
templates/tag.ejs | 12 ++--
templates/tags.ejs | 25 +++++----
7 files changed, 100 insertions(+), 103 deletions(-)
diff --git a/config.json b/config.json
index 2ee6060..87fdf0f 100644
--- a/config.json
+++ b/config.json
@@ -2,102 +2,55 @@
"name": "yinwang",
"version": "1.1.0",
"author": "dmxiaoshen",
+ "repository": "https://git.dmxiaoshen.com/dmxiaoshen/gridea-theme-yinwang",
"customConfig": [
{
- "name": "sidebarWidth",
- "label": "菜单栏宽度",
- "group": "布局",
- "value": "320px",
- "type": "input",
- "note": "可填像素类型(如:320px)或百分比类型(如:38.2%)"
- },
- {
- "name": "featureBorderRadius",
- "label": "封面图圆角",
- "group": "布局",
- "value": "3px",
- "type": "input",
- "note": "像素类型(如:3px)"
- },
- {
- "name": "menuColor",
- "label": "菜单颜色",
- "group": "颜色",
- "value": "#dee2e6",
- "type": "input",
- "card": "color",
- "note": "颜色字符串:(如:#EEEEEE、rgba(255, 255, 255, 0.9))"
- },
- {
- "name": "contentBgColor",
- "label": "内容区背景色",
- "group": "颜色",
- "value": "#f8f9fa",
- "type": "input",
- "card": "color",
- "note": "颜色字符串:(如:#EEEEEE、rgba(255, 255, 255, 0.9))"
- },
- {
- "name": "renderKaTeX",
- "label": "是否渲染 KaTeX 公式",
- "group": "渲染",
+ "name": "hitokoto",
+ "label": "是否开启Hitokoto一言",
+ "group": "Hitokoto一言",
+ "type": "switch",
"value": false,
- "type": "switch"
+ "note": "简单来说,一言指的就是一句话,可以是动漫中的台词,也可以是网络上的各种小段子。 或是感动,或是开心,有或是单纯的回忆。来到这里,留下你所喜欢的那一句句话,与大家分享,这就是一言存在的目的。"
},
{
- "name": "renderCode",
- "label": "是否渲染代码高亮",
- "group": "渲染",
+ "name": "homeback",
+ "label": "是否显示返回首页按钮",
+ "group": "返回首页按钮",
+ "type": "switch",
"value": false,
- "type": "switch"
+ "note": "关于、标签云、文章页显示返回首页按钮"
},
{
- "name": "github",
- "label": "Github",
- "group": "社交",
- "value": "",
- "type": "input",
- "note": "链接地址"
+ "name": "showtag",
+ "label": "文章页是否显示标签",
+ "group": "文章页显示标签",
+ "type": "switch",
+ "value": false,
+ "note": "每篇文章的底部会显示该文章的标签"
},
{
- "name": "twitter",
- "label": "Twitter",
- "group": "社交",
- "value": "",
- "type": "input",
- "note": "链接地址"
+ "name": "wordcount",
+ "label": "是否统计文章字数",
+ "group": "统计文章字数",
+ "type": "switch",
+ "value": false,
+ "note": "统计每篇文章的字数,会在首页和归档页面呈现"
},
{
- "name": "weibo",
- "label": "微博",
- "group": "社交",
- "value": "",
+ "name": "twikoo",
+ "label": "evnId",
+ "group": "Twikoo评论",
"type": "input",
- "note": "链接地址"
- },
- {
- "name": "zhihu",
- "label": "知乎",
- "group": "社交",
"value": "",
- "type": "input",
- "note": "链接地址"
+ "note": "请正确获取到Twikoo评论系统的evnId"
},
{
- "name": "facebook",
- "label": "Facebook",
- "group": "社交",
- "value": "",
+ "name": "tversion",
+ "label": "version",
+ "group": "Twikoo评论",
"type": "input",
- "note": "链接地址"
- },
- {
- "name": "customCss",
- "label": "自定义CSS",
- "group": "自定义样式",
"value": "",
- "type": "textarea",
- "note": ""
+ "note": "填写Twikoo评论系统的版本"
},
{
"name": "ga",
diff --git a/templates/_blocks/head.ejs b/templates/_blocks/head.ejs
index 9ed89c0..8642a1a 100644
--- a/templates/_blocks/head.ejs
+++ b/templates/_blocks/head.ejs
@@ -17,3 +17,14 @@
+
+<% if (site.customConfig.ga) { %>
+
+
+<% } %>
diff --git a/templates/archives.ejs b/templates/archives.ejs
index 9da5ad1..6f1d542 100644
--- a/templates/archives.ejs
+++ b/templates/archives.ejs
@@ -27,7 +27,9 @@
-
<%= post.title %>
-
<%= post.stats.words %>字
+ <% if (site.customConfig.wordcount) { %>
+ <%= post.stats.words %>字
+ <% } %>
<%= post.dateFormat %>
@@ -36,9 +38,11 @@
<% }); %>
<%- include('./_blocks/pagination') %>
-
+ <% if (site.customConfig.homeback) { %>
+
+ <% } %>
<%- include('./_blocks/scripts') %>
diff --git a/templates/index.ejs b/templates/index.ejs
index 5f434f7..c44229b 100644
--- a/templates/index.ejs
+++ b/templates/index.ejs
@@ -57,7 +57,9 @@
<%= post.dateFormat %>
<%= post.title %>
- <%= post.stats.words %>字
+ <% if (site.customConfig.wordcount) { %>
+ <%= post.stats.words %>字
+ <% } %>
<% }); %>
diff --git a/templates/post.ejs b/templates/post.ejs
index 560a887..3783434 100644
--- a/templates/post.ejs
+++ b/templates/post.ejs
@@ -14,12 +14,30 @@
<%= post.title %>
<%- post.content %>
- <% post.tags.forEach((tag) => { %>
- #<%= tag.name %>
- <% }); %>
-
+ <% if (site.customConfig.showtag) { %>
+ <% post.tags.forEach((tag) => { %>
+ #<%= tag.name %>
+ <% }); %>
+ <% } %>
+ <% if (site.customConfig.homeback) { %>
+
+ <% } %>
+ <% if (site.customConfig.twikoo) { %>
+
+
+
+
+ <% } %>
<%- include('./_blocks/scripts') %>
diff --git a/templates/tag.ejs b/templates/tag.ejs
index 9b77d29..30f90bc 100644
--- a/templates/tag.ejs
+++ b/templates/tag.ejs
@@ -16,16 +16,20 @@
<% posts.forEach(function(post) { %>
- <%= post.title %>
-
<%= post.stats.words %>字
+ <% if (site.customConfig.wordcount) { %>
+ <%= post.stats.words %>字
+ <% } %>
<%= post.dateFormat %>
<% }); %>
<%- include('./_blocks/pagination') %>
-
+ <% if (site.customConfig.homeback) { %>
+
+ <% } %>
diff --git a/templates/tags.ejs b/templates/tags.ejs
index 341081a..fa752e2 100644
--- a/templates/tags.ejs
+++ b/templates/tags.ejs
@@ -38,16 +38,20 @@
<% }); %>
-
+ <% if (site.customConfig.hitokoto) { %>
+
-
-
+
+ <% } %>
+ <% if (site.customConfig.homeback) { %>
+
+ <% } %>
-
+<% if (site.customConfig.hitokoto) { %>
+<% } %>
<%- include('./_blocks/scripts') %>