import { InitialData } from './types' ; const PAGE_DATA_FILE_NAME = 'page-data.json' ; param routes param pathname export async function loadStaticProps ( pathname ) { const PAGE_DATA_FILE_PATH = `${ pathname === '/' ? '' : pathname }/${ PAGE_DATA_FILE_NAME }` ; return fetch ( PAGE_DATA_FILE_PATH ) . then ( res => res . json ( ) ) . then ( res => { return { data : res } ; } ) ; }