This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,17 @@ import Page from './[...slug]'
13
13
* @return {Element } The Search component.
14
14
*/
15
15
export default function Custom404 ( { post} ) {
16
+ const { seo, ...postData } = post
17
+
16
18
// Display dynamic page data if 404 page retrieved from WP.
17
- if ( post ) {
19
+ if ( postData && Object . keys ( postData ) . length > 0 ) {
18
20
return < Page post = { post } />
19
21
}
20
22
21
23
return (
22
- < Layout seo = { { ...post ?. seo } } >
24
+ < Layout seo = { { ...seo } } >
23
25
< h1 > 404 Not Found</ h1 >
24
- < p > That post could not be found!</ p >
26
+ < p > That page could not be found!</ p >
25
27
</ Layout >
26
28
)
27
29
}
Original file line number Diff line number Diff line change @@ -16,14 +16,16 @@ const postType = 'page'
16
16
* @return {Element } The HomePage component.
17
17
*/
18
18
export default function HomePage ( { post} ) {
19
+ const { seo, ...postData } = post
20
+
19
21
// Display dynamic page data if homepage retrieved from WP.
20
- if ( post ) {
22
+ if ( postData && Object . keys ( postData ) . length > 0 ) {
21
23
return < Page post = { post } />
22
24
}
23
25
24
26
// Display static page content as fallback.
25
27
return (
26
- < Layout seo = { { ...post ?. seo } } >
28
+ < Layout seo = { { ...seo } } >
27
29
< Hero
28
30
background = "https://images.unsplash.com/photo-1513106021000-168e5f56609d?ixlib=rb-1.2.1& ixid = eyJhcHBfaWQiOjEyMDd9 & auto = format & fit = crop & w = 2560 & q = 70 "
29
31
title = "Next.js Starter"
You can’t perform that action at this time.
0 commit comments