parent
6434ac4a7f
commit
31a7511fb1
14 changed files with 57 additions and 144 deletions
@ -1,32 +1,10 @@ |
||||
<%console.log('sidebar: ', page.sidebar);%> |
||||
<aside class='l_side'> |
||||
<% if (page.sidebar) { %> |
||||
<% page.sidebar.forEach(function(widget_id){ %> |
||||
<% theme.widget.forEach(function(widget){ %> |
||||
<% if (widget.id == widget_id){ %> |
||||
<%- partial('../_widget/' + widget.class, {item: widget}) %> |
||||
<% } %> |
||||
<% }) %> |
||||
<% page.sidebar.forEach(function(widget_id){ %> |
||||
<% theme.widget.forEach(function(widget){ %> |
||||
<% if (widget.id == widget_id){ %> |
||||
<%- partial('../_widget/' + widget.class, {item: widget}) %> |
||||
<% } %> |
||||
<% }) %> |
||||
<% } else { %> |
||||
<% |
||||
var ids = []; |
||||
if(is_home() || is_category() || is_archive() || is_tag() || page.layout == 'list') { |
||||
var isPostList = true; |
||||
} else { |
||||
var isPostList = false; |
||||
} |
||||
if (isPostList) { |
||||
ids = theme.layout.on_list.sidebar; |
||||
} else { |
||||
ids = theme.layout.on_page.sidebar; |
||||
} |
||||
%> |
||||
<% ids.forEach(function(widget_id){ %> |
||||
<% theme.widget.forEach(function(widget){ %> |
||||
<% if (widget.id == widget_id){ %> |
||||
<%- partial('../_widget/' + widget.class, {item: widget}) %> |
||||
<% } %> |
||||
<% }) %> |
||||
<% }) %> |
||||
<% } %> |
||||
<% }) %> |
||||
</aside> |
||||
|
@ -1,11 +1,20 @@ |
||||
<% |
||||
if (is_home() || is_category() || is_archive() || is_tag() || page.layout == 'list') { |
||||
if (theme.layout.on_list.sidebar.length == 0) { |
||||
page.sidebar = false; |
||||
if (page.sidebar == undefined) { |
||||
if (theme.layout.on_list.sidebar.length == 0) { |
||||
page.sidebar = []; |
||||
} else { |
||||
page.sidebar = theme.layout.on_list.sidebar; |
||||
} |
||||
} |
||||
|
||||
} else { |
||||
if (theme.layout.on_page.sidebar.length == 0) { |
||||
page.sidebar = false; |
||||
if (page.sidebar == undefined) { |
||||
if (theme.layout.on_page.sidebar.length == 0) { |
||||
page.sidebar = []; |
||||
} else { |
||||
page.sidebar = theme.layout.on_page.sidebar; |
||||
} |
||||
} |
||||
} |
||||
%> |
||||
|
@ -0,0 +1,17 @@ |
||||
<% |
||||
var pf = []; |
||||
if (item.display) { |
||||
item.display.forEach(function(p){ |
||||
pf.push(p); |
||||
}); |
||||
} else { |
||||
pf = ['desktop', 'mobile']; |
||||
} |
||||
|
||||
page.widget_style = (theme.style.shadow.card ? ' card-shadow' : '') + ((theme.style.blur && theme.style.blur.widget) ? ' widget-blur' : ''); |
||||
page.widget_platform = pf.join(' '); |
||||
|
||||
console.log(page.widget_style); |
||||
console.log(page.widget_platform); |
||||
|
||||
%> |
Loading…
Reference in new issue