File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,3 +63,6 @@ cypress/screenshots
6363public /sitemap.xml
6464public /robots.txt
6565/instrumented /
66+
67+ # Netlify CLI
68+ .netlify
Original file line number Diff line number Diff line change @@ -34,14 +34,11 @@ export default function HomePage({
3434 </ >
3535 ) ;
3636}
37-
3837export async function getStaticProps ( ) {
39- const posts = await getBlogspotPosts ( ) . catch ( ( ) => [ ] ) ;
40- const props = { blogPosts : posts . slice ( 0 , 8 ) } ;
41-
42- const isDeployPreview = process . env . CONTEXT === "deploy-preview" ;
43- if ( isDeployPreview ) {
44- return { props } ;
45- } // fully static for previews
46- return { props, revalidate : 3600 } ; // ISR for prod
38+ try {
39+ const posts = await getBlogspotPosts ( ) ;
40+ return { props : { blogPosts : posts . slice ( 0 , 8 ) } } ;
41+ } catch {
42+ return { props : { blogPosts : [ ] } } ;
43+ }
4744}
You can’t perform that action at this time.
0 commit comments