import Document, { Head, Html, Main, NextScript } from "next/document"; // class Document extends NextDocument { class MyDocument extends Document { render() { return ( <Html> <Head> <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100;300;400;500;600;700&display=swap" rel="stylesheet" /> </Head> <body> <Main /> <NextScript /> </body> </Html> ); } } export default MyDocument;
![Next.js で Google Fonts を取り扱うメモ - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/418dab94eefb717b5d19a91af73fe09aaeda72ea/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTkxNiZoPTMzNiZ0eHQ9TmV4dC5qcyUyMCVFMyU4MSVBNyUyMEdvb2dsZSUyMEZvbnRzJTIwJUUzJTgyJTkyJUU1JThGJTk2JUUzJTgyJThBJUU2JTg5JUIxJUUzJTgxJTg2JUUzJTgzJUExJUUzJTgzJUEyJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmdHh0LWNsaXA9ZWxsaXBzaXMmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz0yNGU3NzZlNDQ1ZTE3YjI5NTM0NGUyNTBkYTkxOWM3ZQ%26mark-x%3D142%26mark-y%3D112%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTcxNiZ0eHQ9JTQwZG9zdWtvaV9tYW4mdHh0LWNvbG9yPSUyMzIxMjEyMSZ0eHQtZm9udD1IaXJhZ2lubyUyMFNhbnMlMjBXNiZ0eHQtc2l6ZT0zMiZ0eHQtYWxpZ249bGVmdCUyQ3RvcCZzPTU0ZWU3MmNhMjA5OWRhYzU0ZDlmMjJkMDFjNWZkMGUx%26blend-x%3D142%26blend-y%3D491%26blend-mode%3Dnormal%26s%3D21073bcc43193e3518f933b334b9e439)