From 513f54bb2ec027fce371005c1f52f5ffb1a0ca6f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 31 Mar 2021 02:55:17 +0200 Subject: [PATCH] only link to posts with the same main category --- node/blog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node/blog.js b/node/blog.js index 00ab6a7..a3dfd17 100644 --- a/node/blog.js +++ b/node/blog.js @@ -76,7 +76,8 @@ function getAdjacentPost(json, index, move) { let post = json[index]; if (!post) break; - if (post.cat.includes(cat) && !post.archived) + // only link to posts with the same main category + if (post.cat[0] === cat && !post.archived) return post; } } \ No newline at end of file