updates
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user