diff --git a/layout/_widget/category.ejs b/layout/_widget/category.ejs
index a851b52..25abcdf 100755
--- a/layout/_widget/category.ejs
+++ b/layout/_widget/category.ejs
@@ -1,15 +1,6 @@
<% if (site.categories.length){ %>
- <%
- var plats = [];
- if (item.display) {
- item.display.forEach(function(plat){
- plats.push(plat);
- });
- } else {
- plats = ['desktop', 'mobile'];
- }
- %>
-
+ <%- partial('_pre') %>
+
<%- partial('header', {item: item}) %>
-
diff --git a/layout/_widget/copyright.ejs b/layout/_widget/copyright.ejs
index 9802c21..2e3ffae 100755
--- a/layout/_widget/copyright.ejs
+++ b/layout/_widget/copyright.ejs
@@ -1,14 +1,5 @@
-<%
-var plats = [];
-if (item.display) {
- item.display.forEach(function(plat){
- plats.push(plat);
- });
-} else {
- plats = ['desktop', 'mobile'];
-}
-%>
-
<% if (item.blockquote == true) { %>
diff --git a/layout/_widget/grid.ejs b/layout/_widget/grid.ejs index 2a15de3..00d04f8 100755 --- a/layout/_widget/grid.ejs +++ b/layout/_widget/grid.ejs @@ -1,14 +1,5 @@ -<% -var plats = []; -if (item.display) { - item.display.forEach(function(plat){ - plats.push(plat); - }); -} else { - plats = ['desktop', 'mobile']; -} -%> -+<%- partial('_pre') %> + <%- partial('header', {item: item}) %> diff --git a/layout/_widget/list.ejs b/layout/_widget/list.ejs index dea38d6..e52c3d5 100755 --- a/layout/_widget/list.ejs +++ b/layout/_widget/list.ejs @@ -1,14 +1,5 @@ -<% -var plats = []; -if (item.display) { - item.display.forEach(function(plat){ - plats.push(plat); - }); -} else { - plats = ['desktop', 'mobile']; -} -%> -
+<%- partial('_pre') %> + <%- partial('header', {item: item}) %> diff --git a/layout/_widget/qrcode.ejs b/layout/_widget/qrcode.ejs index ebc1d69..ef7e7a1 100755 --- a/layout/_widget/qrcode.ejs +++ b/layout/_widget/qrcode.ejs @@ -1,14 +1,5 @@ -<% -var plats = []; -if (item.display) { - item.display.forEach(function(plat){ - plats.push(plat); - }); -} else { - plats = ['desktop', 'mobile']; -} -%> -
+<%- partial('_pre') %> + <%- partial('header', {item: item}) %> <% (item.images||[]).forEach(function(url){ %> diff --git a/layout/_widget/related_posts.ejs b/layout/_widget/related_posts.ejs index dfdf15b..50832d3 100755 --- a/layout/_widget/related_posts.ejs +++ b/layout/_widget/related_posts.ejs @@ -1,15 +1,6 @@ <% if(page.layout == 'post' && page.content && page.path != undefined){ %> - <% - var plats = []; - if (item.display) { - item.display.forEach(function(plat){ - plats.push(plat); - }); - } else { - plats = ['desktop', 'mobile']; - } - %> -+ <%- partial('_pre') %> + <%- partial('header', {item: item}) %> <%- popular_posts( { maxCount: 10 , ulClass: 'popular-posts' , PPMixingRate: 0.2 } , page ) %> diff --git a/layout/_widget/tagcloud.ejs b/layout/_widget/tagcloud.ejs index b305fb6..e693e8f 100755 --- a/layout/_widget/tagcloud.ejs +++ b/layout/_widget/tagcloud.ejs @@ -1,15 +1,6 @@ <% if (site.tags.length){ %> - <% - var plats = []; - if (item.display) { - item.display.forEach(function(plat){ - plats.push(plat); - }); - } else { - plats = ['desktop', 'mobile']; - } - %> -+ <%- partial('_pre') %> + <%- partial('header', {item: item}) %> <%- tagcloud(site.tags, { diff --git a/layout/_widget/text.ejs b/layout/_widget/text.ejs index a322e48..6ad310e 100755 --- a/layout/_widget/text.ejs +++ b/layout/_widget/text.ejs @@ -1,14 +1,5 @@ -<% -var plats = []; -if (item.display) { - item.display.forEach(function(plat){ - plats.push(plat); - }); -} else { - plats = ['desktop', 'mobile']; -} -%> -+<%- partial('_pre') %> + <%- partial('header', {item: item}) %> <% (item.content||[]).forEach(function(row){ %> diff --git a/layout/_widget/toc.ejs b/layout/_widget/toc.ejs index c0b2345..2f36aab 100755 --- a/layout/_widget/toc.ejs +++ b/layout/_widget/toc.ejs @@ -1,15 +1,6 @@ +<%- partial('_pre') %> <% if(page.content && page.toc != false && toc(page.content).length > 0){ %> - <% - var plats = []; - if (item.display) { - item.display.forEach(function(plat){ - plats.push(plat); - }); - } else { - plats = ['desktop', 'mobile']; - } - %> -+ <%- partial('header', {item: item}) %> <%- toc(page.content, {list_number: item.list_number, min_depth: item.min_depth, max_depth: item.max_depth}) %> diff --git a/layout/index.ejs b/layout/index.ejs index b3d854a..eeda40f 100755 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -1,5 +1,4 @@ <%- partial('_pre') %> -<% console.log('index: page.sidebar', page.sidebar); %>'> <%- partial('_partial/archive') %>