Follow change in article lists' header structure by dynamically generating a link to the RSS feed
This commit is contained in:
parent
2a7d721a35
commit
049576154a
1 changed files with 23 additions and 5 deletions
|
@ -83,12 +83,30 @@ function DomRenderer(modules) {
|
||||||
return function(articlePreviews) {
|
return function(articlePreviews) {
|
||||||
return [
|
return [
|
||||||
modules.dom.make('h2', {innerText: pageTitle(tag, all)}),
|
modules.dom.make('h2', {innerText: pageTitle(tag, all)}),
|
||||||
modules.dom.make('a', {
|
modules.dom.make('ul', {}, articlesListLinks(tag, all)),
|
||||||
innerText: all ? blog.wording.latestLink : blog.wording.allLink,
|
modules.dom.make('div', {class: 'articles'},
|
||||||
href: otherUrl(tag, all)
|
articlePreviews.filter(modules.fun.defined)
|
||||||
}),
|
)
|
||||||
modules.dom.make('div', {class: 'articles'}, articlePreviews.filter(modules.fun.defined))
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function articlesListLinks(tag, all) {
|
||||||
|
var links = [
|
||||||
|
modules.dom.make('a', {
|
||||||
|
innerText: all ? blog.wording.latestLink : blog.wording.allLink,
|
||||||
|
href: otherUrl(tag, all),
|
||||||
|
class: 'other'
|
||||||
|
})
|
||||||
|
];
|
||||||
|
if(blog.hasRSS) {
|
||||||
|
links.unshift(modules.dom.make('a', {
|
||||||
|
innerText: blog.wording.rssLink,
|
||||||
|
href: 'rss.xml',
|
||||||
|
class: 'RSS',
|
||||||
|
title: modules.template.render('rssTitle', {tag: tag})
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
return links.map(function(e) {return modules.dom.make('li', {}, [e]);});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue