diff --git a/_config.yml b/_config.yml index 8fb3351..bd1be08 100755 --- a/_config.yml +++ b/_config.yml @@ -1,6 +1,10 @@ # Top menu menu: - # About: /about + # Tags: /tags + # Categories: /categories + +# Site Icon +favicon: # Camera icon for website baseurl: @@ -19,10 +23,10 @@ comments: disqus_shortname: valine: enable: true - appId: # leancloud application app id - appKey: # leancloud application app key + appId: appid + appKey: appkey placeholder: random # Placeholder. Set to random string if you want to have random placeholders(一言api). - + # Google Analytics Tracking ID google_analytics: @@ -41,8 +45,13 @@ image_viewer: true toc: enable: true +footer: + enable: true + beian: 浙ICP备2022036129号-2 + # content: 本站采用 CC BY-NC-SA 4.0 协议进行许可 + # using highlight.js to show the code # https://highlightjs.org/ hljs: enable: true - theme: xcode + theme: atom-one-dark diff --git a/layout/_partial/article-full.ejs b/layout/_partial/article-full.ejs index 092a430..4442b79 100755 --- a/layout/_partial/article-full.ejs +++ b/layout/_partial/article-full.ejs @@ -1,3 +1,10 @@ +<% + var title = item.title || theme.default_post_title || "Untitled"; + var mainTitle = title.split(" | ")[0]; + var subTitle = title.split(" | ")[1]; +%> + +
<%- partial('_partial/backhome') %> @@ -9,8 +16,11 @@

- <%- item.title || theme.default_post_title || "Untitled" %> + <%- mainTitle %>

+
+ <%- subTitle %> +

diff --git a/layout/_partial/article-index.ejs b/layout/_partial/article-index.ejs index ace536e..40b3280 100755 --- a/layout/_partial/article-index.ejs +++ b/layout/_partial/article-index.ejs @@ -1,8 +1,21 @@
-

- <%- item.title || theme.default_post_title || "Untitled" %> -

+
+ + <% + var title = item.title || theme.default_post_title || "Untitled"; + var mainTitle = title.split(" | ")[0]; + var subTitle = title.split(" | ")[1]; + %> +
+ <%- mainTitle %> +
+
+ + <%- subTitle %> +
+
+ <%- item.excerpt %>
\ No newline at end of file diff --git a/layout/_partial/comment.ejs b/layout/_partial/comment.ejs index 011bbb1..20279f4 100644 --- a/layout/_partial/comment.ejs +++ b/layout/_partial/comment.ejs @@ -26,7 +26,7 @@ appId: '<%= theme.comments.valine.appId %>', appKey: '<%= theme.comments.valine.appKey %>', placeholder: '<%= theme.comments.valine.placeholder %>', - avatar: 'retro', + avatar: '', enableQQ: true, emojiCDN: '//i0.hdslb.com/bfs/emote/', // 表情title和图片映射 diff --git a/layout/_partial/darkmode.ejs b/layout/_partial/darkmode.ejs new file mode 100644 index 0000000..e69de29 diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs new file mode 100644 index 0000000..ffe6a39 --- /dev/null +++ b/layout/_partial/footer.ejs @@ -0,0 +1,12 @@ +<% if (theme.footer && theme.footer.enable) { %> + <% if (theme.footer.content) { %> +
+ <%- theme.footer.content %> +
+ <% } %> + <% if (theme.footer.beian) { %> +
+ <%- theme.footer.beian %> +
+ <% } %> +<% } %> \ No newline at end of file diff --git a/layout/_partial/go-top.ejs b/layout/_partial/go-top.ejs new file mode 100644 index 0000000..e5cf8e9 --- /dev/null +++ b/layout/_partial/go-top.ejs @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 5b46d2c..f68c12a 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -22,7 +22,7 @@ <% var title = []; - if (page.current > 1) title.push(__('page', page.current)); + if (page.title) title.push(page.title); if (page.category) title.push(page.category); if (page.tag) title.push(page.tag); @@ -34,14 +34,12 @@ %> <%= title.join(' | ') %> - -
- <% if (theme.menu && theme.menu.length){ %> - <% Object.keys(theme.menu).forEach(key => { %> - <%=key%> - <% }); %> - <% } %> -
+ + <%if (theme.favicon){ %> + + <% } else { %> + + <% } %> @@ -49,9 +47,27 @@ + + <%- css('css/style.css') %> + +
+ <% if (theme.menu) { %> + <% Object.keys(theme.menu).forEach(key => { %> + <%=key%> + <% }); %> + <% } %> + + + + +
+ + + + @@ -75,4 +91,6 @@ + + diff --git a/layout/_partial/page-categories.ejs b/layout/_partial/page-categories.ejs new file mode 100644 index 0000000..418a791 --- /dev/null +++ b/layout/_partial/page-categories.ejs @@ -0,0 +1,37 @@ +
+ + <%- partial('_partial/backhome') %> + + +
+
+
+
+
+

+ <%- item.title %> +

+
+
+
+
+
+
+ + +
+
+
+ +
+ <%- list_categories(site.categories, {orderby:'count'}) %> +
+ + +
+ <%- partial("_partial/comment.ejs") %> +
+
+
+
+
\ No newline at end of file diff --git a/layout/_partial/page-tags.ejs b/layout/_partial/page-tags.ejs new file mode 100644 index 0000000..decddec --- /dev/null +++ b/layout/_partial/page-tags.ejs @@ -0,0 +1,38 @@ +
+ + <%- partial('_partial/backhome') %> + + +
+
+
+
+
+

+ <%- item.title %> +

+
+
+
+
+
+
+ + +
+
+
+ +
+ + <%- tagcloud({orderby: 'count', order: 1, min_font: 0.8, max_font: 2, unit: 'em', amount: 40, show_count: true, class: 'tagcloud'}) %> +
+ + +
+ <%- partial("_partial/comment.ejs") %> +
+
+
+
+
\ No newline at end of file diff --git a/layout/_partial/pagination.ejs b/layout/_partial/pagination.ejs index 1403b74..f08ca79 100755 --- a/layout/_partial/pagination.ejs +++ b/layout/_partial/pagination.ejs @@ -2,6 +2,35 @@ <% if (page.prev){ %> <% } %> + <% var page_list = []; %> + <% if (page.total > 1){ + var total = page.total; + var current = page.current; + if (total <= 5){ + for (var i = 1; i <= total; i++){ + page_list.push(i); + } + } else { + if (current < 3){ + page_list = [1, 2, 3, '...', total]; + } else if (current >= 3 && current < total - 2){ + page_list = [1, '...', current - 1, current, current + 1, '...', total]; + } else { + page_list = [1, '...', total - 2, total - 1, total]; + } + } + } %> + <% page_list.forEach(function(item){ %> + <% if (item == '...'){ %> +
  • ...
  • + <% } else { %> + <% if (item == page.current){ %> +
  • <%- item %>
  • + <% } else { %> +
  • <%- item %>
  • + <% } %> + <% } %> + <% }) %> <% if (page.next){ %> <% } %> diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index ccd5ca7..98500b2 100755 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -1,4 +1,5 @@ \ No newline at end of file diff --git a/layout/_partial/toc.ejs b/layout/_partial/toc.ejs index e7f1402..948d2cc 100644 --- a/layout/_partial/toc.ejs +++ b/layout/_partial/toc.ejs @@ -1,4 +1,4 @@ -<% if (theme.toc.enable){ %> +<% if (theme.toc.enable && !post.type) { %>