diff --git a/docs/docs/06-For CISOs/security-vulnerability.md b/docs/docs/06-For CISOs/security-vulnerability.md index e32b225..2a77343 100644 --- a/docs/docs/06-For CISOs/security-vulnerability.md +++ b/docs/docs/06-For CISOs/security-vulnerability.md @@ -2,5 +2,7 @@ slug: /security-vulnerability title: Security Vulnerability draft: true +pagination_next: null --- + # Security Vulnerability diff --git a/docs/pdfs/metal-stack-docs.pdf b/docs/pdfs/metal-stack-docs.pdf new file mode 100644 index 0000000..5145ad7 Binary files /dev/null and b/docs/pdfs/metal-stack-docs.pdf differ diff --git a/package.json b/package.json index 9b5396e..09d9849 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "fetch-readmes": "bun ./scripts/fetch-readmes.js", "optimize:svg": "svgo -f . --recursive --multipass", "prepare": "husky", - "create-release-notes": "bun ./scripts/create-release-notes.js" + "create-release-notes": "bun ./scripts/create-release-notes.js", + "docs:pdf": "bun ./scripts/docs-pdf.mjs" }, "dependencies": { "@carbon/icons-react": "^11.71.0", diff --git a/scripts/docs-pdf.mjs b/scripts/docs-pdf.mjs new file mode 100644 index 0000000..07e9b6d --- /dev/null +++ b/scripts/docs-pdf.mjs @@ -0,0 +1,91 @@ +import { spawnSync } from "node:child_process"; +import { resolve } from "node:path"; +import { readFileSync } from "node:fs"; + +import version from '../src/version.json' with { type: 'json' }; + +function env(name, fallback) { + return process.env[name] ?? fallback; +} + +const DOC_URL = env("DOC_URL", "http://localhost:3000/docs/next/home"); +const DOC_VERSION = env("DOC_VERSION", "3"); +const COVER_IMAGE = env("COVER_IMAGE", "https://metal-stack.io/img/metal-stack.png"); +const COVER_TITLE = env("COVER_TITLE", "metal-stack.io"); +const COVER_SUB = env("COVER_SUB", "Documentation Version " + version.version); + +if (process.env.CI && DOC_URL.includes("localhost")) { + console.error( + `Refusing to run in CI with DOC_URL=${DOC_URL}. Set DOC_URL to your deployed preview URL or start a server in CI.` + ); + process.exit(1); +} + +const logoPath = resolve(__dirname, "../static/img/metal-stack.png"); +const logoBase64 = readFileSync(logoPath).toString("base64"); +const logoDataUri = `data:image/png;base64,${logoBase64}`; + +const headerTemplate = ` + + +