_document.tsx (1091B)
1 import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'; 2 import { 3 DocumentHeadTags, 4 documentGetInitialProps, 5 } from '@mui/material-nextjs/v14-pagesRouter'; 6 import { Html, Head, Main, NextScript } from 'next/document'; 7 8 import type { DocumentHeadTagsProps } from '@mui/material-nextjs/v14-pagesRouter'; 9 import type { DocumentContext, DocumentProps } from 'next/document'; 10 11 export default function MyDocument( 12 props: DocumentProps & DocumentHeadTagsProps, 13 ) { 14 return ( 15 <Html lang='ja' data-color-scheme='light'> 16 <Head> 17 <DocumentHeadTags {...props} /> 18 <link rel='manifest' href='/manifest.json' /> 19 <meta name='theme-color' content='#029494' /> 20 <link rel='icon' sizes='16x16' href='/favicon.ico' /> 21 <link 22 rel='apple-touch-icon' 23 sizes='192x192' 24 href='/maskable_icon_x192.png' 25 /> 26 </Head> 27 <body> 28 <InitColorSchemeScript /> 29 <Main /> 30 <NextScript /> 31 </body> 32 </Html> 33 ); 34 } 35 36 MyDocument.getInitialProps = async (ctx: DocumentContext) => { 37 const finalProps = await documentGetInitialProps(ctx); 38 return finalProps; 39 };