From acd60d592293205ae4618d30f1f4f8fc53c74c78 Mon Sep 17 00:00:00 2001 From: Kirill Myagkikh Date: Wed, 18 Nov 2020 15:17:29 +0500 Subject: [PATCH 1/2] add possibility to set turbo false --- lib/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 4b25c58..04012bd 100755 --- a/lib/index.js +++ b/lib/index.js @@ -48,7 +48,7 @@ function addRelated(related, itemValues, relatedfinity) { function items(items, channel) { items.forEach(function (item) { let item_values = []; - item_values.push({_attr: {'turbo': 'true'}}); + item_values.push({_attr: {'turbo': item.turboEnabled}}); item_values.push({link: item.url}); ifTruePush(item.turboSource, item_values, {'turbo:source': item.turboSource}); @@ -143,6 +143,7 @@ function itemData(data) { turboSource: data.turboSource || '', turboTopic: data.turboTopic || '', goals: data.goals || [], + turboEnabled: !data.turboDisabled || false, }; } /** From a8e4ba436caae1862fd7cd130e0ec8d75dec1e17 Mon Sep 17 00:00:00 2001 From: Kirill Myagkikh Date: Sun, 29 Nov 2020 19:20:10 +0500 Subject: [PATCH 2/2] review fixes --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 04012bd..cc718e4 100755 --- a/lib/index.js +++ b/lib/index.js @@ -48,7 +48,7 @@ function addRelated(related, itemValues, relatedfinity) { function items(items, channel) { items.forEach(function (item) { let item_values = []; - item_values.push({_attr: {'turbo': item.turboEnabled}}); + item_values.push({_attr: {'turbo': item.turboEnabled ? 'true' : 'false'}}); item_values.push({link: item.url}); ifTruePush(item.turboSource, item_values, {'turbo:source': item.turboSource}); @@ -143,7 +143,7 @@ function itemData(data) { turboSource: data.turboSource || '', turboTopic: data.turboTopic || '', goals: data.goals || [], - turboEnabled: !data.turboDisabled || false, + turboEnabled: data.turboEnabled || true, }; } /**