mirror of
https://github.com/LightAir/turbo-rss.git
synced 2026-02-04 12:06:20 +00:00
Added turbo:goal support
This commit is contained in:
16
lib/index.js
16
lib/index.js
@@ -71,6 +71,19 @@ function items(items, channel) {
|
||||
|
||||
let fullContent = '<header>' + img + ' <h1>' + item.title + '</h1>' + menu + '</header>' + item.content;
|
||||
|
||||
if (item.goals.length > 0) {
|
||||
item.goals.forEach(goal => item_values.push({
|
||||
"turbo:goal": {
|
||||
_attr: {
|
||||
type: goal.type || 'yandex',
|
||||
'turbo-goal-id': goal.id,
|
||||
name: goal.name,
|
||||
id: goal.counter_id,
|
||||
}
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
item_values.push({'turbo:content': {_cdata: fullContent}});
|
||||
|
||||
if (typeof item.related !== 'undefined') {
|
||||
@@ -128,7 +141,8 @@ function itemData(data) {
|
||||
related: data.related,
|
||||
relatedfinity: data.relatedfinity || false,
|
||||
turboSource: data.turboSource || '',
|
||||
turboTopic: data.turboTopic || ''
|
||||
turboTopic: data.turboTopic || '',
|
||||
goals: data.goals || [],
|
||||
};
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user