From 3a4882bc537e6f9784a7192c2498ca0c7c0eda99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Correa=20Casablanca?= Date: Mon, 29 Apr 2024 11:18:09 +0200 Subject: [PATCH] docs: upgrade website docs Signed-off-by: Andres Correa Casablanca --- @kindspells/astro-shield/package.json | 2 +- @kindspells/astro-shield/src/headers.mjs | 8 +- docs/astro.config.mjs | 8 ++ docs/package.json | 7 +- .../content-security-policy.mdx | 6 + docs/sst.config.ts | 4 +- docs/tsconfig.json | 3 +- pnpm-lock.yaml | 136 +++++++++--------- 8 files changed, 93 insertions(+), 81 deletions(-) diff --git a/@kindspells/astro-shield/package.json b/@kindspells/astro-shield/package.json index 2994c35..aacaa57 100644 --- a/@kindspells/astro-shield/package.json +++ b/@kindspells/astro-shield/package.json @@ -80,7 +80,7 @@ "url": "https://ko-fi.com/coderspirit" } ], - "packageManager": "pnpm@8.15.6", + "packageManager": "pnpm@9.0.6", "engines": { "node": ">= 18.0.0" }, diff --git a/@kindspells/astro-shield/src/headers.mjs b/@kindspells/astro-shield/src/headers.mjs index 46c65c5..df16aa5 100644 --- a/@kindspells/astro-shield/src/headers.mjs +++ b/@kindspells/astro-shield/src/headers.mjs @@ -21,9 +21,7 @@ export const serialiseHashes = hashes => * @returns {string} */ export const serializeCspDirectiveSources = hashes => - Array.from(hashes) - .sort() - .join(' ') + Array.from(hashes).sort().join(' ') /** * @param {CSPDirectives} directives @@ -44,9 +42,7 @@ export const serialiseCspDirectives = directives => export const setSrcDirective = (directives, srcType, hashes) => { const baseSrcDirective = directives[srcType] if (baseSrcDirective) { - const srcDirective = new Set( - baseSrcDirective.split(/\s+/), - ) + const srcDirective = new Set(baseSrcDirective.split(/\s+/)) for (const hash of hashes) { srcDirective.add(`'${hash}'`) } diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 2b6305e..be34149 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -16,6 +16,10 @@ export default defineConfig({ image: { service: passthroughImageService(), }, + i18n: { + locales: ['en'], + defaultLocale: 'en', + }, integrations: [ shield({}), starlight({ @@ -26,6 +30,10 @@ export default defineConfig({ label: 'English', lang: 'en', }, + en: { + label: 'English', + lang: 'en', + }, }, social: { github: 'https://github.com/kindspells/astro-shield', diff --git a/docs/package.json b/docs/package.json index 00c4cf3..797aadb 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,11 +3,12 @@ "type": "module", "version": "1.4.0", "scripts": { - "dev": "sst dev astro dev", - "start": "astro dev", + "astro": "astro", "build": "moon run build", + "deploy":"sst deploy --stage prod", + "dev": "sst dev astro dev", "preview": "astro preview", - "astro": "astro" + "start": "astro dev" }, "dependencies": { "astro-sst": "^2.41.5", diff --git a/docs/src/content/docs/guides/security-headers/content-security-policy.mdx b/docs/src/content/docs/guides/security-headers/content-security-policy.mdx index 31f254e..79ef04b 100644 --- a/docs/src/content/docs/guides/security-headers/content-security-policy.mdx +++ b/docs/src/content/docs/guides/security-headers/content-security-policy.mdx @@ -58,6 +58,12 @@ export default defineConfig({ `} /> + +