Comparing version 1.0.4 to 1.0.5
@@ -46,2 +46,12 @@ 'use strict'; | ||
item_values.push({'turbo:content': {_cdata: fullContent}}); | ||
if (typeof item.related !== "undefined") { | ||
ifTruePush(item.related, item_values, { | ||
'yandex:related': item.related.map( | ||
function (related) { | ||
return '<link url="' + related.link + '" img="' + related.image_url + '">' + related.text + '</link>'; | ||
} | ||
).join('') | ||
}); | ||
} | ||
channel.push({item: item_values}); | ||
@@ -84,3 +94,4 @@ | ||
content: options.content, | ||
menu: options.menu | ||
menu: options.menu, | ||
related: options.related | ||
}; | ||
@@ -87,0 +98,0 @@ |
{ | ||
"name": "turbo-rss", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "RSS based, feed generator for Yandex turbo", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -47,5 +47,6 @@ ## WIP | ||
* `content` **string** Содержимое страницы | ||
* `related` _optional_ **object** Аффилированные ссылки `yandex:related` в конце статьи. | ||
*Будет добавлено в новых версиях turbo:source, turbo:topic, menu, pubDate как алиас date* | ||
*Будет добавлено в новых версиях turbo:source, turbo:topic, yandex:related, menu, pubDate как алиас date* | ||
##### Получение XML | ||
@@ -77,3 +78,12 @@ | ||
date: 'May 27, 2012', | ||
content: '<p>hello</p>' | ||
content: '<p>hello</p>', | ||
related: [{ | ||
link: 'http://example.com/related/post1', | ||
image_url: 'http://example.com/i/img1.jpg', | ||
text: 'related link text 1' | ||
}, { | ||
link: 'http://example.com/related/post2', | ||
image_url: 'http://example.com/i/img2.jpg', | ||
text: 'related link text 2' | ||
}] | ||
}); | ||
@@ -80,0 +90,0 @@ |
11147
122
100