This commit is contained in:
Tben
2022-07-27 18:16:20 +01:00
parent 60d5051e07
commit 355f519079
6 changed files with 39 additions and 17 deletions
+1
View File
@@ -82,6 +82,7 @@ export default function BlogIndex({ blogPost }) {
if (element.tag.match(/img/i)) {
return <img
key={ reactKey }
src={ element.src }
width={ element.width }
height={ element.height }
+3 -1
View File
@@ -8,6 +8,7 @@ import Head from "next/head";
// const contentful = require('contentful');
const fs = require("fs")
/** ********************************************** */
/** ********************************************** */
@@ -134,6 +135,7 @@ export async function getStaticProps({ req, res, query }) {
// })
// console.log(blogPosts.data);
const posts = JSON.parse(fs.readFileSync("./jsonData/blogposts.json", "utf8"))
/** ********************************************** */
/** ********************************************** */
@@ -142,7 +144,7 @@ export async function getStaticProps({ req, res, query }) {
// ## Server Props Return
return {
props: {
blogPosts: [],
blogPosts: posts,
},
};