added yandex:related support

This commit is contained in:
Ivan Pilyugin (aka Archer) authored and GitHub committed 2018-05-29 09:58:53 +03:00
1 parent 8bd429accc
commit 365abd5592
1 file changed
+18 -1
+18 -1
View File
@@ -43,6 +43,22 @@ function generateXML(data) {
let fullContent = '<header>' + img + ' <h1>' + item.title + '</h1>' + menu + '</header>' + item.content;
item_values.push({'turbo:content': {_cdata: fullContent}});
let relatedLink = function(related) {
return (
'<link url="' +
related.url +
'" img="' +
related.image +
'">' +
related.text +
'</link>'
);
};
ifTruePush(item.related, item_values, {
'yandex:related': item.related.map(relatedLink).join('')
});
channel.push({item: item_values});
});
@@ -80,7 +96,8 @@ function YTurbo(options, items) {
author: options.author,
date: options.date || options.pubDate,
content: options.content,
menu: options.menu
menu: options.menu,
related: options.related
};
this.items.push(item);