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 +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import getPostTypeArchive from './getPostTypeArchive'
4
4
import { addApolloState } from '@/api/apolloConfig'
5
5
import getMenus from '@/api/wordpress/menus/getMenus'
6
6
import config from '@/functions/config'
7
+ import getFrontendPage , { frontendPageSeo } from './getFrontendPage'
7
8
8
9
/**
9
10
* Retrieve static props by post type.
@@ -33,6 +34,19 @@ export default async function getPostTypeStaticProps(
33
34
}
34
35
}
35
36
37
+ // Check for Frontend-only routes.
38
+ if ( Object . keys ( frontendPageSeo ) . includes ( postType ) ) {
39
+ const { apolloClient, ...routeData } = await getFrontendPage ( postType )
40
+
41
+ return addApolloState ( apolloClient , {
42
+ props : {
43
+ ...routeData ,
44
+ ...sharedProps
45
+ } ,
46
+ revalidate
47
+ } )
48
+ }
49
+
36
50
// Check for dynamic archive display.
37
51
if ( ! Object . keys ( params ) . length ) {
38
52
const { apolloClient, ...archiveData } = await getPostTypeArchive ( postType )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export default function Search({post}) {
36
36
* @return {object } Post props.
37
37
*/
38
38
export async function getStaticProps ( ) {
39
- return await getPostTypeStaticProps ( { slug : '/' } , 'search' )
39
+ return await getPostTypeStaticProps ( null , 'search' )
40
40
}
41
41
42
42
Search . propTypes = {
You can’t perform that action at this time.
0 commit comments