parent
635a289f47
commit
a06b3dbf4e
13 changed files with 94 additions and 22 deletions
@ -1,15 +1,29 @@ |
|||||||
<aside class='l_side'> |
<aside class='l_side'> |
||||||
<% if (theme.sidebar && theme.sidebar.length){ %> |
<% if (theme.sidebar && theme.sidebar.length){ %> |
||||||
<% |
<% |
||||||
let supportWidgets = ['author', 'category', 'list', 'music', 'tagcloud', 'toc', 'plain', 'related_posts']; |
let supportWidgets = ['author', 'category', 'list', 'music', 'tagcloud', 'toc', 'plain', 'related_posts', 'square']; |
||||||
%> |
%> |
||||||
<% theme.sidebar.forEach(function(item){ %> |
<% if (page.sidebar){ %> |
||||||
<% if (item.enable != false){ %> |
<% page.sidebar.forEach(function(name){ %> |
||||||
<% let widget_name = item.widget ? item.widget : 'plain'; %> |
<% theme.sidebar.forEach(function(item){ %> |
||||||
<% if (supportWidgets.indexOf(widget_name) > -1){ %> |
<% let widget_name = item.widget ? item.widget : 'plain'; %> |
||||||
<%- partial('../_widget/' + item.widget, {item: item}) %> |
<% if (item.enable != false && widget_name == name){ %> |
||||||
|
<% if (supportWidgets.indexOf(widget_name) > -1){ %> |
||||||
|
<%- partial('../_widget/' + item.widget, {item: item}) %> |
||||||
|
<% } %> |
||||||
|
<% } %> |
||||||
|
<% }) %> |
||||||
|
<% }) %> |
||||||
|
<% } else { %> |
||||||
|
<% theme.sidebar.forEach(function(item){ %> |
||||||
|
<% if (item.enable != false){ %> |
||||||
|
<% let widget_name = item.widget ? item.widget : 'plain'; %> |
||||||
|
<% if (supportWidgets.indexOf(widget_name) > -1){ %> |
||||||
|
<%- partial('../_widget/' + item.widget, {item: item}) %> |
||||||
|
<% } %> |
||||||
<% } %> |
<% } %> |
||||||
<% } %> |
<% }) %> |
||||||
<% }) %> |
<% } %> |
||||||
|
|
||||||
<% } %> |
<% } %> |
||||||
</aside> |
</aside> |
||||||
|
@ -0,0 +1,24 @@ |
|||||||
|
<section class='<%- item.widget %>'> |
||||||
|
<%- partial('header', {item: item, defIcon: '', defTitle: ''}) %> |
||||||
|
<div class='content <%= theme.style %>'> |
||||||
|
<ul class="entry"> |
||||||
|
<% (item.rows||[]).forEach(function(row){ %> |
||||||
|
<li><a class="flat-box" title="<%- url_for(row.url) %>" href="<%- url_for(row.url) %>"> |
||||||
|
<div class='name'> |
||||||
|
<% if(row.img) { %> |
||||||
|
<img src="<%- row.img %>"> |
||||||
|
<% } else if(row.avatar) { %> |
||||||
|
<img src="<%- row.avatar %>" id="round"> |
||||||
|
<% } else { %> |
||||||
|
<i class="<%= row.icon %> fa-fw" aria-hidden="true"></i> |
||||||
|
<% } %> |
||||||
|
<%- row.name %> |
||||||
|
</div> |
||||||
|
<% if(row.desc) { %> |
||||||
|
<div class='badge'>(<%- row.desc %>)</div> |
||||||
|
<% } %> |
||||||
|
</a></li> |
||||||
|
<% }) %> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</section> |
@ -0,0 +1,32 @@ |
|||||||
|
<div class='l_main'> |
||||||
|
<% if (site.posts && site.posts.length > 0) { %> |
||||||
|
<section class="post-list"> |
||||||
|
<% site.posts.each(function(p){ %> |
||||||
|
<% if (p.type == page.type) { %> |
||||||
|
<div class='post-wrapper'> |
||||||
|
<%- partial('_partial/post', {post: p, index: false}) %> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% }) %> |
||||||
|
</section> |
||||||
|
<% if (page && page.posts) { %> |
||||||
|
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 --> |
||||||
|
<% |
||||||
|
var need_mathjax = false; |
||||||
|
page.posts.each(function(post){ |
||||||
|
if (post.mathjax){ |
||||||
|
if (post.mathjax != "internal") { |
||||||
|
need_mathjax = true; |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
%> |
||||||
|
<% if (need_mathjax){ %> |
||||||
|
<%- partial('mathjax') %> |
||||||
|
<% } %> |
||||||
|
|
||||||
|
<% } %> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
<%- partial('_partial/side') %> |
||||||
|
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %> |
Loading…
Reference in new issue