diff --git a/apps/courses/astro.config.mjs b/apps/courses/astro.config.mjs index f7364fe..32bea99 100644 --- a/apps/courses/astro.config.mjs +++ b/apps/courses/astro.config.mjs @@ -2,6 +2,7 @@ import mdx from '@astrojs/mdx'; import postAudit from '@casoon/astro-post-audit'; import siteFiles from '@casoon/astro-site-files'; import speedMeasure from '@casoon/astro-speed-measure'; +import { shikiStyleToClass } from '@knowledge-core/styles/shiki.mjs'; import tailwindcss from '@tailwindcss/vite'; import { defineConfig } from 'astro/config'; @@ -53,6 +54,7 @@ export default defineConfig({ shikiConfig: { theme: 'github-dark', wrap: true, + transformers: [shikiStyleToClass], }, }, @@ -61,12 +63,14 @@ export default defineConfig({ defaultStrategy: 'viewport', }, + // Astro reads the CSP only under security; a top-level csp key is silently ignored. security: { checkOrigin: true, - }, - - csp: { - algorithm: 'SHA-256', + csp: { + algorithm: 'SHA-256', + // AppShell loads the Inter stylesheet from Google Fonts + styleDirective: { resources: ["'self'", 'https://fonts.googleapis.com'] }, + }, }, image: { diff --git a/apps/docs/astro.config.mjs b/apps/docs/astro.config.mjs index 0ef625f..d9d8fd8 100644 --- a/apps/docs/astro.config.mjs +++ b/apps/docs/astro.config.mjs @@ -2,6 +2,7 @@ import mdx from '@astrojs/mdx'; import postAudit from '@casoon/astro-post-audit'; import siteFiles from '@casoon/astro-site-files'; import speedMeasure from '@casoon/astro-speed-measure'; +import { shikiStyleToClass } from '@knowledge-core/styles/shiki.mjs'; import tailwindcss from '@tailwindcss/vite'; import { defineConfig } from 'astro/config'; @@ -54,6 +55,7 @@ export default defineConfig({ shikiConfig: { theme: 'github-dark', wrap: true, + transformers: [shikiStyleToClass], }, }, @@ -62,12 +64,14 @@ export default defineConfig({ defaultStrategy: 'viewport', }, + // Astro reads the CSP only under security; a top-level csp key is silently ignored. security: { checkOrigin: true, - }, - - csp: { - algorithm: 'SHA-256', + csp: { + algorithm: 'SHA-256', + // AppShell loads the Inter stylesheet from Google Fonts + styleDirective: { resources: ["'self'", 'https://fonts.googleapis.com'] }, + }, }, image: { diff --git a/apps/docs/src/components/DocsHero.astro b/apps/docs/src/components/DocsHero.astro index 62d9e5c..07604e4 100644 --- a/apps/docs/src/components/DocsHero.astro +++ b/apps/docs/src/components/DocsHero.astro @@ -10,8 +10,7 @@ class="inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-100 px-3.5 py-1.5 dark:border-slate-700 dark:bg-slate-900" >