Skip to content

Commit b90c0c2

Browse files
Update description
1 parent 51a6052 commit b90c0c2

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

pages/index.js

+26-23
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ const POSTS = [
1010
'<p>Mr. Worf, you sound like a man who&#8217;s asking his friend if he can start dating his sister. Is it my imagination, or have tempers become a little frayed on the ship lately? I&#8217;ll be sure to note that in my log. Fear is the true enemy, the only enemy. Some days you get the bear, and some days the bear gets you. Now we know what they mean by &#8216;advanced&#8217; tactical training. Fate protects fools, little children and ships named Enterprise.</p>\n',
1111
title: 'Fate. It protects fools.',
1212
slug: 'fate-it-protects-fools',
13-
featuredImage: { node: [Object] },
13+
thumbnail: {
14+
sourceUrl:
15+
'https://dynahead.wpengine.com/wp-content/uploads/2020/12/ayo-ogunseinde-sibVwORYqs0-unsplash-150x150.jpg',
16+
},
1417
},
1518
{
1619
id: 'cG9zdDo2',
@@ -19,7 +22,10 @@ const POSTS = [
1922
'<p>Did you come here for something in particular or just general Riker-bashing? Ensign Babyface! We could cause a diplomatic crisis. Take the ship into the Neutral Zone Now, how the hell do we defeat an enemy that knows us better than we know ourselves? I will obey your orders. I will serve this ship as First Officer. And in an attack against the Enterprise, I will die with this crew. But I will not break my oath of loyalty to Starfleet. You&#8217;re going to be an interesting companion, Mr. Data. You bet I&#8217;m agitated! I may be surrounded by insanity, but I am not insane.</p>\n',
2023
title: 'You enjoyed that',
2124
slug: 'you-enjoyed-that',
22-
featuredImage: { node: [Object] },
25+
thumbnail: {
26+
sourceUrl:
27+
'https://dynahead.wpengine.com/wp-content/uploads/2020/12/christopher-campbell-rDEOVtE7vOs-unsplash-150x150.jpg',
28+
},
2329
},
2430
{
2531
id: 'cG9zdDox',
@@ -28,43 +34,40 @@ const POSTS = [
2834
'<p>Did you come here for something in particular or just general Riker-bashing? I guess it&#8217;s better to be lucky than good. You&#8217;re going to be an interesting companion, Mr. Data. I recommend you don&#8217;t fire until you&#8217;re within 40,000 kilometers. But the probability of making a six is no greater than that of rolling a seven. And blowing into maximum warp speed, you appeared for an instant to be in two places at once. Maybe we better talk out here; the observation lounge has turned into a swamp. I&#8217;ll be sure to note that in my log. I am your worst nightmare! We have a saboteur aboard.</p>\n',
2935
title: 'Well, that’s certainly good',
3036
slug: 'hello-world',
31-
featuredImage: { node: [Object] },
37+
thumbnail: {
38+
sourceUrl:
39+
'https://dynahead.wpengine.com/wp-content/uploads/2020/12/bruce-mars-AndE50aaHn4-unsplash-150x150.jpg',
40+
},
3241
},
3342
];
3443

3544
export default function Home() {
3645
return (
3746
<div className={styles.container}>
3847
<Head>
39-
<title>Next.js & Wordpress Dynamic</title>
48+
<title>Next.js & Wordpress Static</title>
4049
<link rel='icon' href='/favicon.ico' />
4150
</Head>
4251

4352
<main className={styles.main}>
44-
<h1 className={styles.title}>Headless Wordpress</h1>
53+
<h1 className={styles.title}>
54+
Static Headless <strike>Wordpress</strike>
55+
</h1>
4556

4657
<p className={styles.description}>
47-
Next.js with dynamic data from Wordpress (fetching on each request)
48-
<br />
49-
Request time in app logs
58+
Next.js with static hard coded data
5059
</p>
5160

5261
<div className={styles.grid}>
53-
{POSTS.map(({ id, title, url, content, featuredImage }) => {
54-
const thumbnail = featuredImage.node.mediaDetails.sizes.find(
55-
({ name }) => name === 'thumbnail'
56-
);
57-
58-
return (
59-
<Post
60-
key={id}
61-
url={url}
62-
title={title}
63-
content={content}
64-
imgUrl={thumbnail.sourceUrl}
65-
/>
66-
);
67-
})}
62+
{POSTS.map(({ id, title, url, content, thumbnail }) => (
63+
<Post
64+
key={id}
65+
url={url}
66+
title={title}
67+
content={content}
68+
imgUrl={thumbnail.sourceUrl}
69+
/>
70+
))}
6871
</div>
6972
</main>
7073
</div>

0 commit comments

Comments
 (0)