Follow change in article lists' header structure by dynamically generating a link to the RSS feed

This commit is contained in:
Tissevert 2020-05-06 10:25:46 +02:00
parent 2a7d721a35
commit 049576154a

View file

@ -83,12 +83,30 @@ function DomRenderer(modules) {
return function(articlePreviews) {
return [
modules.dom.make('h2', {innerText: pageTitle(tag, all)}),
modules.dom.make('a', {
innerText: all ? blog.wording.latestLink : blog.wording.allLink,
href: otherUrl(tag, all)
}),
modules.dom.make('div', {class: 'articles'}, articlePreviews.filter(modules.fun.defined))
modules.dom.make('ul', {}, articlesListLinks(tag, all)),
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]);});
}
}