+
-
diff --git a/layout/_partial/post/post-share.ejs b/layout/_partial/post/post-share.ejs
new file mode 100644
index 00000000..41a8b2d7
--- /dev/null
+++ b/layout/_partial/post/post-share.ejs
@@ -0,0 +1,21 @@
+
diff --git a/layout/_partial/post-tools.ejs b/layout/_partial/post/post-tools.ejs
similarity index 100%
rename from layout/_partial/post-tools.ejs
rename to layout/_partial/post/post-tools.ejs
diff --git a/layout/_partial/post/reward-author.ejs b/layout/_partial/post/reward-author.ejs
new file mode 100644
index 00000000..e5f8408e
--- /dev/null
+++ b/layout/_partial/post/reward-author.ejs
@@ -0,0 +1,10 @@
+
+
+
diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs
index c93320be..5b4ce843 100644
--- a/layout/_partial/scripts.ejs
+++ b/layout/_partial/scripts.ejs
@@ -1,53 +1,61 @@
+
<%- __js([
'js/utils.js',
- 'js/main.js',
'js/header-shrink.js',
'js/back2top.js',
- 'js/dark-light-toggle.js'
+ 'js/dark-light-toggle.js',
+ 'js/main.js',
+ 'js/libs/anime.min.js'
]) %>
-<%
-const {
- local_search: t_local_search,
- code_copy: t_code_copy,
- code_block: t_code_block,
- lazyload: t_lazyload,
- toc: t_toc,
- pjax: t_pjax,
- comment: t_comment
-} = theme
-%>
-
-<% if (t_local_search?.enable === true) { %>
+
+<% if (theme?.local_search?.enable === true) { %>
<%- __js('js/local-search.js') %>
<% } %>
-<% if (t_code_copy?.enable === true || t_code_block?.enable === true || t_code_block?.tools?.enable === true) { %>
+
+<% if (theme?.code_block?.tools?.enable === true) { %>
<%- __js('js/code-block.js') %>
<% } %>
-<% if (t_lazyload?.enable === true) { %>
+
+<% if (theme?.lazyload?.enable === true) { %>
<%- __js('js/lazyload.js') %>
<% } %>
-
+
<% if (is_post()) { %>
- <%- __js('js/post-helper.js') %>
- <% if (t_toc?.enable === true || t_comment?.enable === true) { %>
- <%- __js('js/libs/anime.min.js') %>
+
+ <%- __js('js/post/post-helper.js') %>
+
+
+ <% if (theme?.toc?.enable === true) { %>
+ <%- __js('js/post/toc.js') %>
+ <% } %>
+
+
+ <% if (theme?.post?.copyright_info === true) { %>
+ <%- __js('js/post/copyright-info.js') %>
<% } %>
- <% if (t_toc?.enable === true) { %>
- <%- __js('js/toc.js') %>
+
+
+ <% if (theme?.post?.share === true) { %>
+ <%- __js('js/post/share.js') %>
<% } %>
<% } %>
+
+
<% if (isCategoriesPage(page.path) === true) { %>
<%- __js('js/category-page.js') %>
<% } %>
+
+
<% if (isLinksPage(page.path) === true) { %>
<%- __js('js/links-page.js') %>
<% } %>
-<% if (t_pjax?.enable === true) { %>
+
+<% if (theme?.pjax?.enable === true) { %>
<%- partial('pjax/pjax') %>
<% } %>
diff --git a/layout/_partial/side-tools.ejs b/layout/_partial/side-tools.ejs
index 4732231e..61cfda00 100644
--- a/layout/_partial/side-tools.ejs
+++ b/layout/_partial/side-tools.ejs
@@ -24,12 +24,6 @@
<% } %>
- <% if (theme?.style?.scroll?.percent !== true) { %>
-
-
-
- <% } %>
-
@@ -52,11 +46,9 @@
- <% if (theme?.style?.scroll?.percent === true) { %>
-
-
-
-
- <% } %>
+
+
+
+
diff --git a/layout/_partial/tagcloud.ejs b/layout/_partial/tagcloud.ejs
index 5ccede72..24932a71 100644
--- a/layout/_partial/tagcloud.ejs
+++ b/layout/_partial/tagcloud.ejs
@@ -13,9 +13,7 @@
<%- partial('_partial/common/empty-content') %>
<% } %>
<% if (page?.comment === true) { %>
-
+ <%- partial('_partial/comment/comment') %>
<% } %>
diff --git a/layout/article-content.ejs b/layout/article-content.ejs
index 70315a0c..9ac38d27 100644
--- a/layout/article-content.ejs
+++ b/layout/article-content.ejs
@@ -3,17 +3,21 @@
- <% if (page?.cover) { %>
-
+ <% if (page?.post_cover || page?.home_cover) { %>
+
<%= page.title %>
-
+
<% } %>
-
- <% if (!page?.cover) { %>
+
+ <% if (!page?.post_cover && !page?.home_cover) { %>
<%= page.title %>
@@ -62,19 +66,30 @@
<% if (
(theme?.post?.copyright_info === true || theme?.copyright_info?.enable === true) && page?.copyright_info !== false
) { %>
-
- <%- partial('_partial/article-copyright-info') %>
-
+ <%- partial('_partial/post/post-copyright-info') %>
<% } %>
- <% if (page.tags.length) { %>
-
+
+
+ <% if (page.tags.length) { %>
+
+ <% } %>
+
+
+ <% if (theme?.post?.share === true && page?.share !== false) { %>
+ <%- partial('_partial/post/post-share') %>
+ <% } %>
+
+
+
+ <% if (theme?.post?.reward?.enable === true && theme?.post?.reward?.img_link && page?.reward !== false) { %>
+ <%- partial('_partial/post/reward-author') %>
<% } %>
<% if (page.prev || page.next) { %>
diff --git a/layout/category-list.ejs b/layout/category-list.ejs
index cd790448..2776ace1 100644
--- a/layout/category-list.ejs
+++ b/layout/category-list.ejs
@@ -9,11 +9,8 @@
<% } else { %>
<%- partial('_partial/common/empty-content') %>
<% } %>
-
<% if (page?.comment === true) { %>
-
+ <%- partial('_partial/comment/comment') %>
<% } %>
diff --git a/layout/home-content.ejs b/layout/home-content.ejs
index a525131a..7f70fd23 100644
--- a/layout/home-content.ejs
+++ b/layout/home-content.ejs
@@ -3,21 +3,23 @@
<% page.posts.forEach(post => { %>
- <% if (post?.cover) { %>
+ <% if (post?.home_cover) { %>
<% if (post.sticky) { %>
<%- __('top') %>
<% } %>
-
+
<% } %>
- <% if (post.sticky && !post?.cover) { %>
+ <% if (post.sticky && !post?.home_cover) { %>
<%- __('top') %>
diff --git a/layout/layout.ejs b/layout/layout.ejs
index 0c25c0ee..bd5a4ce0 100644
--- a/layout/layout.ejs
+++ b/layout/layout.ejs
@@ -7,7 +7,11 @@
<% if (theme?.inject?.enable === true) { %>
<% theme?.inject?.js?.forEach((js_path) => { %>
<% if (js_path && isJsFile(js_path)) { %>
- <%- js(js_path) %>
+ <%- js({
+ class: 'custom-inject-js',
+ src: js_path,
+ 'data-pjax': true
+ }) %>
<% } %>
<% }) %>
<% } %>
diff --git a/layout/page-template.ejs b/layout/page-template.ejs
index 84e78899..2d779fb5 100644
--- a/layout/page-template.ejs
+++ b/layout/page-template.ejs
@@ -20,9 +20,7 @@ const is_render_friends_link = (
<% } %>
<% if (page?.comment === true) { %>
-
+ <%- partial('_partial/comment/comment') %>
<% } %>
diff --git a/layout/page.ejs b/layout/page.ejs
index e9f93146..30be4a26 100644
--- a/layout/page.ejs
+++ b/layout/page.ejs
@@ -61,7 +61,7 @@
<% if (is_post()) { %>
- <%- partial('_partial/post-tools') %>
+ <%- partial('_partial/post/post-tools') %>
<% } %>
diff --git a/scripts/helpers/export-config.js b/scripts/helpers/export-config.js
index b07c2fb5..80f5606f 100644
--- a/scripts/helpers/export-config.js
+++ b/scripts/helpers/export-config.js
@@ -10,10 +10,10 @@ const yaml = require('js-yaml')
/**
* Export theme config to js
*/
-hexo.extend.helper.register('exportConfig', function () {
+hexo.extend.helper.register('exportThemeConfig', function () {
const { config, theme } = this
- // ------------------------ export language to js ------------------------
+ // -------------------------- export languages --------------------------
const languageDir = path.join(__dirname, '../../languages')
let file = fs.readdirSync(languageDir).find((v) => v === `${config.language}.yml`)
file = languageDir + '/' + (file ? file : 'en.yml')
@@ -40,7 +40,6 @@ hexo.extend.helper.register('exportConfig', function () {
style: theme.style || {},
local_search: theme.local_search || {},
code_block: theme.code_block || {},
- side_tools: theme.side_tools || {},
pjax: theme.pjax || {},
lazyload: theme.lazyload || {},
comment: theme.comment || {},
@@ -49,8 +48,8 @@ hexo.extend.helper.register('exportConfig', function () {
version: require('../../package.json').version
}
- return `