diff --git a/themes/yilia/layout/_partial/archive.ejs b/themes/yilia/layout/_partial/archive.ejs index 5238781..9a4c527 100644 --- a/themes/yilia/layout/_partial/archive.ejs +++ b/themes/yilia/layout/_partial/archive.ejs @@ -1,6 +1,6 @@ <% if (pagination == 2){ - page.posts.each(function(post){ %> - <%- partial('article', {post: post, index: true}) %> + page.posts.each(function(post, postIndex){ %> + <%- partial('article', {post, param: {index: true, postIndex}}) %> <% }) } else { var last; diff --git a/themes/yilia/layout/_partial/article.ejs b/themes/yilia/layout/_partial/article.ejs index 1b5fdb5..380f05d 100644 --- a/themes/yilia/layout/_partial/article.ejs +++ b/themes/yilia/layout/_partial/article.ejs @@ -1,16 +1,19 @@ -
+<% if (param.postIndex === 0 || !param.index){ %> +<%- partial('_partial/aside') %> +<% } %> +
<% if (post.link || post.title){ %>
<%- partial('post/title', {class_name: 'article-title'}) %> <% if (!post.noDate){ %> <%- partial('post/date', {class_name: 'archive-article-date', - date_format: config.date_format+(post.excerpt && index ? '':' '+config.time_format)}) %> + date_format: config.date_format+(post.excerpt && param.index ? '':' '+config.time_format)}) %> <% } %>
<% } %>
- <% if (post.excerpt && index){ %> + <% if (post.excerpt && param.index){ %> <%- post.excerpt %> <% } else { %> <% if (!page.pageid){ %> @@ -29,7 +32,7 @@ <% } %> <%- post.content %> <% } %> - <% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !index){ %> + <% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !param.index){ %>
@@ -71,24 +74,23 @@ <% } %> <%- partial('post/tag') %> <%- partial('post/category') %> - <% if (index){ %> + <% if (param.index){ %>

<%= __('show_full_text') %> >>

<% } %> - <% if (!index && theme.share_jia){ %> + <% if (!param.index && theme.share_jia){ %> <%- partial('post/share') %> <% } %>
-<% if (!index){ %> +<% if (!param.index){ %> <%- partial('post/nav') %> <% } %> -<%- partial('_partial/aside') %> -<% if (!index && post.comments){ %> +<% if (!param.index && post.comments){ %> <% if (theme.changyan_appid && theme.changyan_conf){ %> <%- partial('post/changyan', { key: post.slug, diff --git a/themes/yilia/layout/_partial/post/title.ejs b/themes/yilia/layout/_partial/post/title.ejs index 69d646f..f729c50 100644 --- a/themes/yilia/layout/_partial/post/title.ejs +++ b/themes/yilia/layout/_partial/post/title.ejs @@ -3,7 +3,7 @@ <% } else if (post.title){ %> - <% if (index){ %> + <% if (param.index){ %>

<%= post.title %>

diff --git a/themes/yilia/layout/archive.ejs b/themes/yilia/layout/archive.ejs index 52f9b21..8b00cc9 100644 --- a/themes/yilia/layout/archive.ejs +++ b/themes/yilia/layout/archive.ejs @@ -1 +1 @@ -<%- partial('_partial/archive', {pagination: config.archive, index: true}) %> \ No newline at end of file +<%- partial('_partial/archive', {pagination: config.archive, param:{index: true}}) %> \ No newline at end of file diff --git a/themes/yilia/layout/category.ejs b/themes/yilia/layout/category.ejs index 3ffe252..8ebad88 100644 --- a/themes/yilia/layout/category.ejs +++ b/themes/yilia/layout/category.ejs @@ -1 +1 @@ -<%- partial('_partial/archive', {pagination: config.category, index: true}) %> \ No newline at end of file +<%- partial('_partial/archive', {pagination: config.category, param:{index: true}}) %> \ No newline at end of file diff --git a/themes/yilia/layout/page.ejs b/themes/yilia/layout/page.ejs index bea6318..70fbd48 100644 --- a/themes/yilia/layout/page.ejs +++ b/themes/yilia/layout/page.ejs @@ -1 +1 @@ -<%- partial('_partial/article', {post: page, index: false}) %> \ No newline at end of file +<%- partial('_partial/article', {post: page, param:{index: false}}) %> \ No newline at end of file diff --git a/themes/yilia/layout/post.ejs b/themes/yilia/layout/post.ejs index bea6318..70fbd48 100644 --- a/themes/yilia/layout/post.ejs +++ b/themes/yilia/layout/post.ejs @@ -1 +1 @@ -<%- partial('_partial/article', {post: page, index: false}) %> \ No newline at end of file +<%- partial('_partial/article', {post: page, param:{index: false}}) %> \ No newline at end of file diff --git a/themes/yilia/layout/tag.ejs b/themes/yilia/layout/tag.ejs index 048cdb0..e044b65 100644 --- a/themes/yilia/layout/tag.ejs +++ b/themes/yilia/layout/tag.ejs @@ -1 +1 @@ -<%- partial('_partial/archive', {pagination: config.tag, index: true}) %> \ No newline at end of file +<%- partial('_partial/archive', {pagination: config.tag, param:{index: true}}) %> \ No newline at end of file diff --git a/themes/yilia/source-src/js/fix.js b/themes/yilia/source-src/js/fix.js index 48f7345..c742b66 100644 --- a/themes/yilia/source-src/js/fix.js +++ b/themes/yilia/source-src/js/fix.js @@ -18,7 +18,9 @@ function init() { // 避免由于动画带来的fix元素定位失效, 移到动画元素外层 var sideOpt = document.querySelector('.wrap-side-operation') - document.getElementById('container').appendChild(sideOpt) + if(sideOpt) { + document.getElementById('container').appendChild(sideOpt) + } } export default { init } \ No newline at end of file