-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
5,980 additions
and
5,714 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# For the static build, we only need the following variables. | ||
# They need to be part of `.github/workflows/*build.yaml` | ||
# They are enforced by `astro.config.mjs` `env.schema`` | ||
|
||
# KEYSTATIC_STORAGE_KIND: "local" | ||
# ASTRO_ENV: "production" | ||
# ASTRO_OUTPUT_MODE: "static" | ||
# ASTRO_USE_NETLIFY_ADAPTER: "false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Keystatic | ||
# Docs: https://keystatic.com/docs/github-mode | ||
KEYSTATIC_GITHUB_CLIENT_ID= # empty | ||
KEYSTATIC_GITHUB_CLIENT_SECRET= # empty | ||
KEYSTATIC_SECRET= # empty | ||
PUBLIC_KEYSTATIC_GITHUB_APP_SLUG=rsv-info-keystatic | ||
KEYSTATIC_STORAGE_KIND=local | ||
|
||
ASTRO_ENV=development | ||
ASTRO_OUTPUT_MODE=hybrid | ||
ASTRO_USE_NETLIFY_ADAPTER=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Keystatic | ||
# Docs: https://keystatic.com/docs/github-mode | ||
KEYSTATIC_GITHUB_CLIENT_ID= # See Bitwarden | ||
KEYSTATIC_GITHUB_CLIENT_SECRET= # See Bitwarden | ||
KEYSTATIC_SECRET= # See Bitwarden | ||
PUBLIC_KEYSTATIC_GITHUB_APP_SLUG=rsv-info-keystatic | ||
KEYSTATIC_STORAGE_KIND=github | ||
|
||
ASTRO_ENV=staging | ||
ASTRO_OUTPUT_MODE=server | ||
ASTRO_USE_NETLIFY_ADAPTER=true | ||
|
||
# Those variables need to be added to the Netlify site settings manually. | ||
# To create them, setup Keystatic for Github on local, following https://keystatic.com/docs/github-mode#setting-up-git-hub-mode | ||
# To edit the Github application, see https://github.com/Thinkmill/keystatic/pull/1358/files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,71 @@ | ||
import markdoc from '@astrojs/markdoc' | ||
import mdx from '@astrojs/mdx' | ||
import netlify from '@astrojs/netlify' | ||
import react from '@astrojs/react' | ||
import sitemap from '@astrojs/sitemap' | ||
import tailwind from '@astrojs/tailwind' | ||
import keystatic from '@keystatic/astro' | ||
import { defineConfig } from 'astro/config' | ||
import { defineConfig, envField } from 'astro/config' | ||
|
||
import sitemap from '@astrojs/sitemap' | ||
// ABOUT: | ||
// We have to fetch settings from `.env` | ||
// Which we have to do manually, see https://docs.astro.build/en/guides/configuring-astro/#environment-variables | ||
// | ||
// USAGE: | ||
// `npm run dev` uses hybrid mode and keystatic() | ||
// `npm run build` (server) is based on .env and has different settings for Netlify (CMS/Keystatic) vs. IONOS (Static site) | ||
// `npm run build:local && npm run serve` overwrites the .env settings to have a local test case for what is on IONOS | ||
import { loadEnv } from 'vite' | ||
const { ASTRO_OUTPUT_MODE, ASTRO_USE_NETLIFY_ADAPTER } = loadEnv( | ||
process.env.NODE_ENV, | ||
process.cwd(), | ||
'', | ||
) | ||
|
||
// CONFIG: | ||
// https://astro.build/config | ||
export default defineConfig({ | ||
site: 'https://radschnellverbindungen.info', | ||
integrations: [ | ||
ASTRO_OUTPUT_MODE === 'static' ? undefined : keystatic(), | ||
tailwind(), | ||
react(), | ||
markdoc(), | ||
mdx(), | ||
keystatic(), | ||
tailwind(), | ||
sitemap({ | ||
filter: (page) => !page.endsWith('--preview/'), | ||
}), | ||
sitemap(), // We don't exclute inactive pages but rely on the per page `noindex` | ||
], | ||
redirects: { | ||
'abstimmungen/abstimmungsprozesse/': | ||
'/kommunikation/radschnellwegeplanung-als-zusammenspiel-vieler-akteur-innen/', | ||
// On Netlify and during development we use `hybrid`, on Github Pages we usd `static`. | ||
// Using static makes sure features like Astros redirecting work as expected. | ||
// Docs https://docs.astro.build/en/basics/rendering-modes/ | ||
output: ASTRO_OUTPUT_MODE, | ||
adapter: ASTRO_USE_NETLIFY_ADAPTER === 'true' ? netlify() : undefined, | ||
redirects: {'abstimmungen/abstimmungsprozesse/': | ||
'/kommunikation/radschnellwegeplanung-als-zusammenspiel-vieler-akteur-innen/',}, | ||
experimental: { | ||
env: { | ||
schema: { | ||
ASTRO_OUTPUT_MODE: envField.enum({ | ||
values: ['static', 'hybrid', 'server'], | ||
access: 'secret', | ||
context: 'server', | ||
optional: false, | ||
}), | ||
ASTRO_USE_NETLIFY_ADAPTER: envField.boolean({ | ||
access: 'secret', | ||
context: 'server', | ||
optional: false, | ||
}), | ||
KEYSTATIC_STORAGE_KIND: envField.enum({ | ||
values: ['local', 'github'], | ||
access: 'public', | ||
context: 'client', | ||
optional: false, | ||
}), | ||
ASTRO_ENV: envField.enum({ | ||
values: ['development', 'staging', 'production'], | ||
access: 'public', | ||
context: 'client', | ||
optional: false, | ||
}), | ||
}, | ||
}, | ||
}, | ||
output: 'hybrid', | ||
adapter: netlify(), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.