diff --git a/.npmignore b/.npmignore index fe5b6e4..1433bfd 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,3 @@ .github/ publish.sh -node_modules node_modules \ No newline at end of file diff --git a/_config.yml b/_config.yml index 2cdc913..4be97cf 100755 --- a/_config.yml +++ b/_config.yml @@ -137,6 +137,7 @@ plugins: enable: true css: https://unpkg.com/swiper/swiper-bundle.min.css js: https://unpkg.com/swiper/swiper-bundle.min.js + ## optional plugins ## # preload preload: diff --git a/languages/en.yml b/languages/en.yml index 0fddc1d..74c7d20 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -15,10 +15,9 @@ btn: meta: recent_update: Recent Update toc: TOC - read_prev: PREV - read_next: NEXT + read_prev: or prev + read_next: READ NEXT older: Older - newer: Newer references: References comment_title: Join the discussion back_to_top: Back to top diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index f26c956..90b06d3 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -15,10 +15,9 @@ btn: meta: recent_update: 最近更新 toc: 本文目录 - read_prev: 回顾上一篇 + read_prev: 上一篇 read_next: 接下来阅读 - older: 较早文章 - newer: 较新文章 + older: 更早一篇 references: 参考资料 comment_title: 快来参与讨论吧 back_to_top: 回到顶部 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 26c1b9a..b6a867f 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -15,10 +15,9 @@ btn: meta: recent_update: 最近更新 toc: 本文目錄 - read_prev: 回顧上一篇 + read_prev: 上一篇 read_next: 接下來閱讀 - older: 較早文章 - newer: 較新文章 + older: 更早一篇 references: 參考資料 comment_title: 快來參與討論吧 back_to_top: 回到頂部 diff --git a/layout/404.ejs b/layout/404.ejs index 7f99b93..f58daf2 100755 --- a/layout/404.ejs +++ b/layout/404.ejs @@ -2,7 +2,7 @@ page.class = '404'; page.layout = '404'; page.comment_title = ''; -page.comment_id = '1'; +page.header = false; %>

diff --git a/layout/_partial/article/read_next.ejs b/layout/_partial/article/read_next.ejs deleted file mode 100644 index 9a15b78..0000000 --- a/layout/_partial/article/read_next.ejs +++ /dev/null @@ -1,89 +0,0 @@ -<% -function layoutDiv() { - var prev,next; - var title = ''; - var title_prev = ''; - var title_next = ''; - if (page.layout == 'post') { - prev = page.prev; - next = page.next; - title = __('meta.read_next'); - title_prev = __('meta.newer'); - title_next = __('meta.older'); - } else if (page.layout == 'wiki' && page.wiki && page.wiki.length > 0) { - title = page.wiki; - title_prev = __('meta.read_prev'); - title_next = __('meta.read_next'); - var wikis = []; - wikis = site.pages.filter(function (p) { - if (p.layout == 'wiki' && p.wiki && p.wiki == page.wiki) { - if (p.order == undefined) { - p.order = 0; - } - return true; - } else { - return false; - } - }).sort('order'); - wikis.forEach((p, i) => { - if (p.order < page.order) { - if (prev == undefined || p.order > prev.order) { - prev = p; - } - } else if (p.order > page.order) { - if (next == undefined || p.order < next.order) { - next = p; - } - } - }); - } - let wrapper = ''; - if (prev || next) { - wrapper += ''; - } - return wrapper; -} -%> -<%- layoutDiv(); %> diff --git a/layout/_partial/main/article/read_next.ejs b/layout/_partial/main/article/read_next.ejs new file mode 100644 index 0000000..0709625 --- /dev/null +++ b/layout/_partial/main/article/read_next.ejs @@ -0,0 +1,63 @@ +<% +function layoutDiv() { + var prev,next; + var title = __('meta.read_next'); + var title_prev = __('meta.read_prev'); + if (page.layout == 'post') { + prev = page.next; + next = page.prev; + title_prev = __('meta.older'); + } else if (page.layout == 'wiki' && page.wiki && page.wiki.length > 0) { + title_prev = __('meta.read_prev'); + var wikis = []; + wikis = site.pages.filter(function (p) { + if (p.layout == 'wiki' && p.wiki && p.wiki == page.wiki) { + if (p.order == undefined) { + p.order = 0; + } + return true; + } else { + return false; + } + }).sort('order'); + wikis.forEach((p, i) => { + if (p.order < page.order) { + if (prev == undefined || p.order > prev.order) { + prev = p; + } + } else if (p.order > page.order) { + if (next == undefined || p.order < next.order) { + next = p; + } + } + }); + } + let wrapper = ''; + if (prev || next) { + wrapper += ''; + } + return wrapper; +} +%> +<%- layoutDiv(); %> diff --git a/layout/_partial/article/references.ejs b/layout/_partial/main/article/references.ejs similarity index 100% rename from layout/_partial/article/references.ejs rename to layout/_partial/main/article/references.ejs diff --git a/layout/_partial/article/related_posts.ejs b/layout/_partial/main/article/related_posts.ejs similarity index 100% rename from layout/_partial/article/related_posts.ejs rename to layout/_partial/main/article/related_posts.ejs diff --git a/layout/_partial/article/wiki_cover.ejs b/layout/_partial/main/article/wiki_cover.ejs similarity index 100% rename from layout/_partial/article/wiki_cover.ejs rename to layout/_partial/main/article/wiki_cover.ejs diff --git a/layout/_partial/main/header/index.ejs b/layout/_partial/main/header/index.ejs new file mode 100644 index 0000000..9614719 --- /dev/null +++ b/layout/_partial/main/header/index.ejs @@ -0,0 +1,6 @@ +<% +console.log(page.path, page.header); +%> +<% if (page.header != false) { %> + <%- partial('../../sidebar/header') %> +<% } %> diff --git a/layout/_partial/navbar/breadcrumb.ejs b/layout/_partial/main/navbar/breadcrumb.ejs similarity index 100% rename from layout/_partial/navbar/breadcrumb.ejs rename to layout/_partial/main/navbar/breadcrumb.ejs diff --git a/layout/_partial/main/navbar/list_post.ejs b/layout/_partial/main/navbar/list_post.ejs new file mode 100644 index 0000000..17c0360 --- /dev/null +++ b/layout/_partial/main/navbar/list_post.ejs @@ -0,0 +1,28 @@ + diff --git a/layout/_partial/main/navbar/list_wiki.ejs b/layout/_partial/main/navbar/list_wiki.ejs new file mode 100644 index 0000000..549671f --- /dev/null +++ b/layout/_partial/main/navbar/list_wiki.ejs @@ -0,0 +1,28 @@ + diff --git a/layout/_partial/post_list/paginator.ejs b/layout/_partial/main/post_list/paginator.ejs similarity index 100% rename from layout/_partial/post_list/paginator.ejs rename to layout/_partial/main/post_list/paginator.ejs diff --git a/layout/_partial/post_list/post_card.ejs b/layout/_partial/main/post_list/post_card.ejs similarity index 100% rename from layout/_partial/post_list/post_card.ejs rename to layout/_partial/main/post_list/post_card.ejs diff --git a/layout/_partial/post_list/wiki_card.ejs b/layout/_partial/main/post_list/wiki_card.ejs similarity index 100% rename from layout/_partial/post_list/wiki_card.ejs rename to layout/_partial/main/post_list/wiki_card.ejs diff --git a/layout/_partial/navbar/list_post.ejs b/layout/_partial/navbar/list_post.ejs deleted file mode 100644 index 6a93b1d..0000000 --- a/layout/_partial/navbar/list_post.ejs +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/layout/_partial/navbar/list_wiki.ejs b/layout/_partial/navbar/list_wiki.ejs deleted file mode 100644 index d0117d3..0000000 --- a/layout/_partial/navbar/list_wiki.ejs +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/layout/_partial/scripts/index.ejs b/layout/_partial/scripts/index.ejs index a7cdbf5..d050184 100644 --- a/layout/_partial/scripts/index.ejs +++ b/layout/_partial/scripts/index.ejs @@ -1,11 +1,12 @@ <%- partial('global') %> +<%- js({src: theme.plugins.jquery || 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js'}) %> <% if (theme.stellar.cdn_js) { %> <%- js({src: theme.stellar.cdn_js, async: true}) %> <% } else { %> <%- js({src: 'js/main.js', async: true}) %> <% } %> -<%- js({src: theme.plugins.jquery || 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js'}) %> + diff --git a/layout/_partial/sidebar/header.ejs b/layout/_partial/sidebar/header.ejs index 2e2c927..8b4353f 100644 --- a/layout/_partial/sidebar/header.ejs +++ b/layout/_partial/sidebar/header.ejs @@ -12,6 +12,5 @@ <% } %> <% }); %> - - + \ No newline at end of file diff --git a/layout/_partial/sidebar/logo.ejs b/layout/_partial/sidebar/logo.ejs index 8c1040b..c92fe62 100644 --- a/layout/_partial/sidebar/logo.ejs +++ b/layout/_partial/sidebar/logo.ejs @@ -1,6 +1,8 @@ - - <% if (theme.sidebar.logo.avatar != false) { %> -
- <% } %> -
<%- theme.sidebar.logo.title || config.title %>
-
+
+ + <% if (theme.sidebar.logo.avatar != false) { %> +
+ <% } %> + <%- theme.sidebar.logo.title || config.title %> +
+
diff --git a/layout/archive.ejs b/layout/archive.ejs index 2e8d7d7..104f8c7 100755 --- a/layout/archive.ejs +++ b/layout/archive.ejs @@ -7,7 +7,7 @@ if (page.class == undefined) { <%- partial('index') %> <% } else { %> <% page.title = __('btn.archives'); %> - <%- partial('_partial/navbar/list_post') %> + <%- partial('_partial/main/navbar/list_post') %>
<% var years = []; %> <% site.posts.sort('date', -1).each(function(post) { %> diff --git a/layout/categories.ejs b/layout/categories.ejs index fb74330..faba0a6 100755 --- a/layout/categories.ejs +++ b/layout/categories.ejs @@ -6,7 +6,7 @@ if (page.class == undefined) { <% if (site.categories.length) { %> <% page.title = __('btn.categories'); %> <% page.layout = 'categories'; %> - <%- partial('_partial/navbar/list_post') %> + <%- partial('_partial/main/navbar/list_post') %>
<%- __('page.categories', site.categories.length) %>
diff --git a/layout/index.ejs b/layout/index.ejs index 510578f..8b78d54 100755 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -8,28 +8,28 @@ if (page.class == undefined) { } %> <% if (page.class == 'post') { %> - <%- partial('_partial/navbar/list_post') %> + <%- partial('_partial/main/navbar/list_post') %> <% if (page.posts) { %>
<% page.posts.each(function(post){ %>
- <%- partial('_partial/post_list/post_card', {post: post}) %> + <%- partial('_partial/main/post_list/post_card', {post: post}) %>
<% }) %> - <%- partial('_partial/post_list/paginator') %> + <%- partial('_partial/main/post_list/paginator') %>
<% } %> <% } else if (page.class == 'wiki') { %> <% function outputExcerpt(post) { %>
- <%- partial('_partial/post_list/wiki_card', {post: post}) %> + <%- partial('_partial/main/post_list/wiki_card', {post: post}) %>
<% } %> - <%- partial('_partial/navbar/list_wiki') %> + <%- partial('_partial/main/navbar/list_wiki') %> <% if (page.title && page.wiki) { %>
<% page.wiki.forEach((wiki, i) => { %> diff --git a/layout/layout.ejs b/layout/layout.ejs index 144456d..0070586 100755 --- a/layout/layout.ejs +++ b/layout/layout.ejs @@ -2,13 +2,13 @@ <%- partial('_partial/head') %> - <%- partial('_partial/article/wiki_cover') %> + <%- partial('_partial/main/article/wiki_cover') %>
- <%- partial('_partial/sidebar/header') %> + <%- partial('_partial/main/header/index') %> <%- body %>