added yandex:related support

This commit is contained in:
Ivan Pilyugin (aka Archer)
2018-05-29 09:58:53 +03:00
committed by GitHub
parent 8bd429accc
commit 365abd5592

View File

@@ -43,6 +43,22 @@ function generateXML(data) {
let fullContent = '<header>' + img + ' <h1>' + item.title + '</h1>' + menu + '</header>' + item.content; let fullContent = '<header>' + img + ' <h1>' + item.title + '</h1>' + menu + '</header>' + item.content;
item_values.push({'turbo:content': {_cdata: fullContent}}); 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}); channel.push({item: item_values});
}); });
@@ -80,7 +96,8 @@ function YTurbo(options, items) {
author: options.author, author: options.author,
date: options.date || options.pubDate, date: options.date || options.pubDate,
content: options.content, content: options.content,
menu: options.menu menu: options.menu,
related: options.related
}; };
this.items.push(item); this.items.push(item);