mirror of
https://github.com/LightAir/turbo-rss.git
synced 2026-02-04 03:56:19 +00:00
added yandex:related support
This commit is contained in:
committed by
GitHub
parent
8bd429accc
commit
365abd5592
19
lib/index.js
19
lib/index.js
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user