Skip to content

Commit

Permalink
siteを環境変数で設定するように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
miyaji255 committed Dec 7, 2023
1 parent 2795e32 commit f1f96f8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import mdx from '@astrojs/mdx'

// https://astro.build/config
export default defineConfig({
site: 'https://oucc.org',
site: import.meta.env.SITE_URL,
// 旧ウェブサイトでよくアクセスされていたURLにリダイレクトを設定する
redirects: {
'/about.html': '/',
Expand Down
Empty file added src/.env
Empty file.
1 change: 1 addition & 0 deletions src/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SITE_URL="http://localhost:4321"
1 change: 1 addition & 0 deletions src/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SITE_URL="https://oucc.org"
8 changes: 8 additions & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

interface ImportMetaEnv {
readonly SITE_URL: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
}

0 comments on commit f1f96f8

Please sign in to comment.