Добавлена опция relatedfinity для формирования непрерывной ленты статей

This commit is contained in:
la
2018-05-30 14:53:25 +03:00
parent 4b0f033aa9
commit c65b6ccc12
5 changed files with 66 additions and 19 deletions

View File

@@ -46,6 +46,7 @@ test('related item', function(t) {
url: 'http://example.com/article4?this&that',
author: 'LightAir',
date: 'May 27, 2018 00:00 AM',
menu: '<a href="http://example.com/page1.html">Текст ссылки</a> <a href="http://example.com/page2.html">Текст ссылки</a>',
content: '<p>hello</p>',
related: [{
link: 'http://example.com/related/post1',
@@ -60,3 +61,34 @@ test('related item', function(t) {
t.equal(feed.xml(), expectedOutput.relatedItem.trim());
});
test('related item', function(t) {
t.plan(1);
let feed = new YTurbo({
title: 'title',
description: 'description',
link: 'http://example.com/rss.xml',
site_url: 'http://example.com'
});
feed.item({
title: 'item title',
image_url: 'http://example.com/example.png',
url: 'http://example.com/article4?this&that',
author: 'LightAir',
date: 'May 27, 2018 00:00 AM',
content: '<p>hello</p>',
relatedfinity: true,
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'
}]
});
t.equal(feed.xml(), expectedOutput.relatedItemInfinity.trim());
});