From a971f047ff104bb2ac23757ddb4d22862eadef78 Mon Sep 17 00:00:00 2001 From: TriDiamond Date: Fri, 7 May 2021 10:12:58 +0800 Subject: [PATCH] Fix feature article script cause missing article #85 --- scripts/lib/generators/post.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/lib/generators/post.js b/scripts/lib/generators/post.js index c1b19380..91cf8ba1 100644 --- a/scripts/lib/generators/post.js +++ b/scripts/lib/generators/post.js @@ -102,10 +102,13 @@ class PostGenerator { this.isFeature = false } else { // Fill until max feature capacity. - dummyData.some(value => { - if (featureData.length === this.featureCapacity) return true - value.data.feature = true - featureData.unshift(value) + dummyData.some((value, index) => { + if (featureData.length === this.featureCapacity) { + fillOutIndexes.shift(fillOutIndexes.indexOf(index), 1) + } else { + value.data.feature = true + featureData.unshift(value) + } }) }