This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default async function getPostTypeStaticProps(
30
30
}
31
31
}
32
32
33
- // Check for Frontend-only routes.
33
+ /* -- Handle Frontend-only routes. -- */
34
34
if ( Object . keys ( frontendPageSeo ) . includes ( postType ) ) {
35
35
const { apolloClient, ...routeData } = await getFrontendPage ( postType )
36
36
@@ -43,7 +43,7 @@ export default async function getPostTypeStaticProps(
43
43
} )
44
44
}
45
45
46
- // Check for dynamic archive display.
46
+ /* -- Handle dynamic archive display. -- */
47
47
if ( ! Object . keys ( params ) . length ) {
48
48
const { apolloClient, ...archiveData } = await getPostTypeArchive ( postType )
49
49
@@ -58,6 +58,8 @@ export default async function getPostTypeStaticProps(
58
58
} )
59
59
}
60
60
61
+ /* -- Handle individual posts. -- */
62
+
61
63
// Handle catch-all routes.
62
64
const slug = Array . isArray ( params . slug ) ? params . slug . join ( '/' ) : params . slug
63
65
@@ -90,9 +92,8 @@ export default async function getPostTypeStaticProps(
90
92
preview : isCurrentPostPreview
91
93
}
92
94
93
- // Custom handling for homepage.
95
+ // Fallback to empty props if homepage not set in WP .
94
96
if ( '/' === slug && error ) {
95
- // Fallback to empty props if homepage not set in WP.
96
97
props . post = null
97
98
props . error = false
98
99
}
You can’t perform that action at this time.
0 commit comments