diff --git a/_config.yml b/_config.yml index f88be01..cba0195 100755 --- a/_config.yml +++ b/_config.yml @@ -62,7 +62,7 @@ home_cover: url: https://xaoxuu.com/projects/ - name: 归档 icon: fas fa-archive - url: archives/ + url: blog/archives/ - name: 关于 icon: fas fa-info-circle url: about/ @@ -71,13 +71,13 @@ home_cover: menu: - name: Cocoa Dev icon: fab fa-apple - url: categories/cocoa-dev/ + url: blog/categories/cocoa-dev/ - name: Dev icon: fas fa-laptop-code - url: categories/dev/ + url: blog/categories/dev/ - name: Life icon: fas fa-coffee - url: categories/life/ + url: blog/categories/life/ # 侧边栏小部件 @@ -95,7 +95,7 @@ sidebar: url: https://xaoxuu.com/projects/ - name: 文章归档 icon: fas fa-archive - url: archives/ + url: blog/archives/ - name: 我的友链 icon: fas fa-link url: friends/ @@ -108,12 +108,12 @@ sidebar: - widget: category more: icon: fas fa-expand-arrows-alt - url: categories/ + url: blog/categories/ - widget: tagcloud icon: fas fa-fire more: icon: fas fa-expand-arrows-alt - url: tags/ + url: blog/tags/ - widget: related_posts - widget: music icon: fas fa-compact-disc diff --git a/layout/_partial/archive.ejs b/layout/_partial/archive.ejs index 3f2e9ee..070dade 100755 --- a/layout/_partial/archive.ejs +++ b/layout/_partial/archive.ejs @@ -1,6 +1,4 @@ - <% if (site.posts && site.posts.length > 0) { %> -
<% if (page.prev == 0) { %> <% site.posts.each(function(post){ %> @@ -11,65 +9,6 @@ <% } %> <% }) %> <% } %> - - - - <% if (is_current('categories') && !page.posts) { %> -
- -
- <% } %> - - <% if (is_current('tags') && !page.posts) { %> -
- -
- <% } %> - <% if (page.posts && page.posts.length > 0) { %> <% page.posts.each(function(post){ %> <% if (!post.top) { %> @@ -79,55 +18,48 @@ <% } %> <% }) %> <% } %> -
- -<% } %> - - -<% if (page.posts && page.posts.length > 0) { %> - - <% if (page.total > 1) { %> + <% if (page && page.posts) { %> + <% if (page.total > 1) { %>
-
- <% if (page.prev != 0) { %> - - <% } %> -

- <%= page.current%> / <%= page.total%> -

- <% if (page.next != 0) { %> - - <% } %> +
+ <% if (page.prev != 0) { %> + + <% } %> +

+ <%= page.current%> / <%= page.total%> +

+ <% if (page.next != 0) { %> + + <% } %> -
+
- <% } %> - - - <% - var need_mathjax = false; - page.posts.each(function(post){ - if (post.mathjax){ - if (post.mathjax != "internal") { - need_mathjax = true; + <% } %> + + <% + var need_mathjax = false; + page.posts.each(function(post){ + if (post.mathjax){ + if (post.mathjax != "internal") { + need_mathjax = true; + } } - } - }); - %> + }); + %> + <% if (need_mathjax){ %> + <%- partial('mathjax') %> + <% } %> - <% if (need_mathjax){ %> - <%- partial('mathjax') %> <% } %> - <% } %> diff --git a/layout/archive.ejs b/layout/archive.ejs index 01e08aa..f8f394b 100755 --- a/layout/archive.ejs +++ b/layout/archive.ejs @@ -49,19 +49,20 @@ <%- partial('_partial/footer', null, {cache: !config.relative_link}) %> +<% if (page && page.posts) { %> + + <% + var need_mathjax = false; + page.posts.each(function(post){ + if (post.mathjax){ + if (post.mathjax != "internal") { + need_mathjax = true; + } + } + }); + %> - -<% -var need_mathjax = false; -page.posts.each(function(post){ - if (post.mathjax){ - if (post.mathjax != "internal") { - need_mathjax = true; - } - } -}); -%> - -<% if (need_mathjax){ %> - <%- partial('_partial/mathjax') %> + <% if (need_mathjax){ %> + <%- partial('_partial/mathjax') %> + <% } %> <% } %> diff --git a/layout/blog.ejs b/layout/blog.ejs deleted file mode 100755 index 30a1ace..0000000 --- a/layout/blog.ejs +++ /dev/null @@ -1,75 +0,0 @@ - -
- - <% if (site.posts && site.posts.length > 0) { %> -
- <% if (page.prev == 0) { %> - <% site.posts.each(function(post){ %> - <% if (post.top) { %> -
- <%- partial('_partial/post', {post: post}) %> -
- <% } %> - <% }) %> - <% } %> - <% site.posts.sort(config.index_generator.order_by).each(function(post){ %> - <% if (!post.top) { %> -
- <%- partial('_partial/post', {post: post}) %> -
- <% } %> - <% }) %> -
- - <% if (page.total > 1) { %> -
-
-
- <% if (page.prev != 0) { %> - - <% } %> -

- <%= page.current%> / <%= page.total%> -

- <% if (page.next != 0) { %> - - <% } %> -
-
- <% } %> - -<% } %> - -<% if (page.posts && page.posts.length > 0) { %> - - - - - <% - var need_mathjax = false; - page.posts.each(function(post){ - if (post.mathjax){ - if (post.mathjax != "internal") { - need_mathjax = true; - } - } - }); - %> - - <% if (need_mathjax){ %> - <%- partial('_partial/mathjax') %> - <% } %> - -<% } %> - -
-<%- partial('_partial/side') %> -<%- partial('_partial/footer', null, {cache: !config.relative_link}) %> diff --git a/layout/category.ejs b/layout/category.ejs index ce2178e..6e5e43d 100755 --- a/layout/category.ejs +++ b/layout/category.ejs @@ -1,6 +1,32 @@ -
- <%- partial('_partial/archive') %> + <% if (site.posts && site.posts.length > 0) { %> +
+
+ +
+
+ <% } %>
<%- partial('_partial/side') %> <%- partial('_partial/footer', null, {cache: !config.relative_link}) %> diff --git a/layout/index.ejs b/layout/index.ejs index 51f88fb..c27fb06 100755 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -1,5 +1,6 @@ -
- <% if (page.prev == 0) { %> + +<% if (page.prev == 0) { %> +

<%- theme.home_cover.title %>


@@ -33,9 +34,11 @@
- <% } %> + <%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %> +
+<% } else { %> <%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %> - +<% } %>
diff --git a/layout/tag.ejs b/layout/tag.ejs index ce2178e..3d93ec4 100755 --- a/layout/tag.ejs +++ b/layout/tag.ejs @@ -1,6 +1,34 @@ -
- <%- partial('_partial/archive') %> + <% if (site.posts && site.posts.length > 0) { %> +
+
+ +
+
+ <% } %>
<%- partial('_partial/side') %> <%- partial('_partial/footer', null, {cache: !config.relative_link}) %>