diff --git a/sitegin/tags.js b/sitegin/tags.js index 86390ced2833c462f33082d4fde33140cf6da209..42b14afb35453d709ea99303b89fe7a7dd0f801e 100644 --- a/sitegin/tags.js +++ b/sitegin/tags.js @@ -12,7 +12,18 @@ module.exports = function(obj) { var tags = []; var tagPages = {}; obj.pages.forEach(function(article) { + if(!article.metadata.tags && !article.metadata.notarticle) { + article.metadata.tags = [ 'Článek' ]; + } if(article.metadata.tags) { + if(!article.metadata.notarticle) { + var hasarticletag = false; + article.metadata.tags.forEach(function(tag) { + if(toURL(tag) == 'clanek') hasarticletag = true; + }) + if(!hasarticletag) article.metadata.tags.push('Článek'); + } + var ntags = []; article.metadata.tags.forEach(function(tag) { tag = { diff --git a/sitegin/theme.js b/sitegin/theme.js index 1b00c187d59577f76452745f66f1e1ae32bf6b7b..bb743ea7393260311b8763455c7beed1c2ac0903 100644 --- a/sitegin/theme.js +++ b/sitegin/theme.js @@ -11,12 +11,9 @@ module.exports = function(obj) { todo++; jobs.run('nunjucks', obj, type) .then(function(data) { + if(!obj.rendered) obj.rendered = []; data.forEach(function(o){ - if(o.type == 'html') obj.content = o.content; - else { - if(!obj.otherContent) obj.otherContent = []; - obj.otherContent.push(o); - } + obj.rendered.push(o); }); done(); diff --git a/sitegin/writeFiles.js b/sitegin/writeFiles.js index 781dbd764664759eea577612d274ba7c67670def..7fbfa8b3fe72dd7a36cc1a793cbfe1ce622229eb 100644 --- a/sitegin/writeFiles.js +++ b/sitegin/writeFiles.js @@ -20,10 +20,8 @@ module.exports = function(obj) { } var writeFile = function(article) { - var filename = path.join(builddir,article.file,'index.html'); - doWrite(filename, article.content); - if(article.otherContent) { - article.otherContent.forEach(function(o) { + if(article.rendered) { + article.rendered.forEach(function(o) { var f = path.join(builddir,article.file,'index.'+o.type); doWrite(f, o.content); }) diff --git a/theme/templates/partials/list.html.nunj b/theme/templates/partials/list.html.nunj index 71717a83fc04393240a0b74f2e4474336dc9e8a9..c0ba0519ea980f2b7dcf56ee8c7f6eeae408c254 100644 --- a/theme/templates/partials/list.html.nunj +++ b/theme/templates/partials/list.html.nunj @@ -22,7 +22,7 @@ {{page.metadata.perex_e | truncate}} {% else %} {% if page.content %} - {{ page.content | string | striptags | truncate }} + {{ page.content | striptags | truncate }} {% endif %} {% endif %} {% endif %}