diff --git a/README.md b/README.md index 5d8a4229..b98c64a7 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,11 @@ pnpm run deploy Netlify を使ってプレビュー環境デプロイを行っています。 `preview`ブランチに push すると、Netlify のプレビュー環境にデプロイされます。 +```bash +# ビルド +pnpm run preview-build +``` + ## リソース情報の更新 コードの更新 diff --git a/astro.config.ts b/astro.config.ts index 8106a0fa..612c0b51 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ integrations: [ mdx(), sitemap({ - filter: (page) => page.includes("/dev/"), + filter: (page) => !page.includes("/dev/"), }), react(), partytown({ diff --git a/eslint.config.mjs b/eslint.config.mjs index d21d3b29..af876b65 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,12 +1,12 @@ // @ts-check -import eslint from "@eslint/js"; -import tseslint from "typescript-eslint"; +import js from "@eslint/js"; +import typescript from "typescript-eslint"; import astro from "eslint-plugin-astro"; -export default tseslint.config( - eslint.configs.recommended, - tseslint.configs.recommended, +export default typescript.config( + js.configs.recommended, + typescript.configs.recommended, astro.configs["flat/recommended"], astro.configs["flat/jsx-a11y-recommended"], { diff --git a/package.json b/package.json index 2b3de98c..f40e8e13 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "start": "astro dev", "build": "astro check && astro build", "preview": "astro preview", + "preview-build": "cross-env PREVIEW=1 astro build", "deploy": "astro check && astro build && gh-pages -d dist", "lint": "eslint src/", "fmt": "eslint src/ --fix", @@ -38,6 +39,7 @@ "astro": "4.16.10", "astro-seo": "0.8.4", "bulma": "1.0.2", + "cross-env": "7.0.3", "eslint": "9.15.0", "eslint-plugin-astro": "1.3.1", "eslint-plugin-jsx-a11y": "6.10.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89fa284e..f83826e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,6 +74,9 @@ importers: bulma: specifier: 1.0.2 version: 1.0.2 + cross-env: + specifier: 7.0.3 + version: 7.0.3 eslint: specifier: 9.15.0 version: 9.15.0 @@ -1468,6 +1471,11 @@ packages: resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} + cross-env@7.0.3: + resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} + engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} + hasBin: true + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -4773,6 +4781,10 @@ snapshots: cookie@0.7.2: {} + cross-env@7.0.3: + dependencies: + cross-spawn: 7.0.6 + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 diff --git a/src/constants/characterInfos/callNameInfo.ts b/src/constants/characterInfos/callNameInfo.ts index b882ed6e..7249e6cd 100644 --- a/src/constants/characterInfos/callNameInfo.ts +++ b/src/constants/characterInfos/callNameInfo.ts @@ -470,6 +470,7 @@ export const callNameInfos: { 藍田ノエル: "あいえるさん/あいえるはん", 満別花丸: "満別さん/花丸はん", 琴詠ニア: "琴詠さん/ニアはん", + Voidoll: "ボイドールさん/ぼいどーるはん", }, No7: { me: ["私", "僕"], diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index 72b6ca35..a55d3667 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -35,12 +35,13 @@ const { description, image: _image, imageAlt, - noindex, + noindex: noindex_, defaultHideHeader, isDark, isNemo, } = Astro.props; +const noindex = import.meta.env.PREVIEW || noindex_; const isProduction = import.meta.env.PROD; // imageとimageAltが片方だけ指定されている場合はエラーを出す diff --git a/src/pages/robots.txt.ts b/src/pages/robots.txt.ts index 3e0f164d..cf137089 100644 --- a/src/pages/robots.txt.ts +++ b/src/pages/robots.txt.ts @@ -1,12 +1,11 @@ /** - * https://docs.astro.build/ja/guides/integrations-guide/sitemap/ からコピー + * https://docs.astro.build/ja/guides/integrations-guide/sitemap/#sitemap-link-in-robotstxt からコピー */ import type { APIRoute } from "astro"; -const getRobotsTxt = (sitemapURL: URL) => ` -User-agent: * -Allow: / +const getRobotsTxt = (sitemapURL: URL) => `User-agent: * +${import.meta.env.PREVIEW ? "Disallow" : "Allow"}: / Sitemap: ${sitemapURL.href} `;