commit 563a5953ea2d21b4882d217dd087c21a55d57cf3
parent 2a280fd0a88384bb1c9c297e6b3528ea5f8353dd
Author: cognitive137 <36829952+cognitive137@users.noreply.github.com>
Date: Fri, 13 Sep 2019 21:46:56 +0530
pass on cover from tagData
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gatsby-node.js b/gatsby-node.js
@@ -1,4 +1,5 @@
const path = require('path');
+const tagData = require('./src/tagData');
const createTagPages = (createPage, posts) => {
const allTagsIndexTemplate = path.resolve('src/templates/allTagsIndex.js');
@@ -30,11 +31,12 @@ const createTagPages = (createPage, posts) => {
tags.forEach(tag => {
const posts = postsByTag[tag];
-
+ const cover = tagData.filter(el => el.tag == tag);
createPage({
path: `/tags/${tag}`,
component: singleTagIndexTemplate,
context: {
+ cover,
posts,
tag,
},