From 5c43cd7271a6b7430c605cfc4e47a93b205466cd Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Mon, 25 Nov 2024 20:10:12 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=82=92=E5=8F=AF=E8=83=BD=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ astro.config.ts | 2 +- eslint.config.mjs | 10 +++++----- package.json | 2 ++ pnpm-lock.yaml | 12 +++++++++++ src/constants/characterInfos/callNameInfo.ts | 1 + src/layouts/Base.astro | 21 ++------------------ src/pages/robots.txt.ts | 7 +++---- 8 files changed, 31 insertions(+), 29 deletions(-) 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..39472962 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が片方だけ指定されている場合はエラーを出す @@ -99,24 +100,6 @@ const hasImage = imageUrl != undefined && imageAlt != undefined; - {/* セキュリティ対策。というよりSEO対策。 */} - { - import.meta.env.PROD && ( - <> - - - - - - ) - } - {/* Google Analytics */}