diff --git a/package.json b/package.json index 0326931..ab104e0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "vocs dev", "lint": "tsc --noEmit", - "build": "vocs build", + "build": "vocs build && node scripts/copy-markdown-routes.mjs", "preview": "vocs preview" }, "dependencies": { diff --git a/public/bloom-mark.svg b/public/bloom-mark.svg index ce01cc1..e39ed42 100644 --- a/public/bloom-mark.svg +++ b/public/bloom-mark.svg @@ -1,4 +1,4 @@ - + diff --git a/public/favicon.svg b/public/favicon.svg index ce01cc1..e39ed42 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1,4 +1,4 @@ - + diff --git a/scripts/copy-markdown-routes.mjs b/scripts/copy-markdown-routes.mjs new file mode 100644 index 0000000..251c13a --- /dev/null +++ b/scripts/copy-markdown-routes.mjs @@ -0,0 +1,19 @@ +import { copyFile, mkdir, readdir } from 'node:fs/promises' +import { dirname, join, relative } from 'node:path' + +const publicDir = join(process.cwd(), 'dist/public') +const mdDir = join(publicDir, 'assets/md') + +async function* walk(dir) { + for (const entry of await readdir(dir, { withFileTypes: true })) { + const path = join(dir, entry.name) + if (entry.isDirectory()) yield* walk(path) + else if (entry.isFile() && entry.name.endsWith('.md')) yield path + } +} + +for await (const source of walk(mdDir)) { + const destination = join(publicDir, relative(mdDir, source)) + await mkdir(dirname(destination), { recursive: true }) + await copyFile(source, destination) +} diff --git a/src/pages/_root.css b/src/pages/_root.css new file mode 100644 index 0000000..6c6eedd --- /dev/null +++ b/src/pages/_root.css @@ -0,0 +1,14 @@ +/* + * Vocs already shows the header logo link below the large-screen sidebar + * breakpoint and hides it on desktop when the sidebar is present. Match that + * default/Centaur pattern; only give Bloom's square SVG mark an explicit + * mobile header size so it paints reliably in the top bar. + */ +@media (max-width: 1023.98px) { + [data-v-logo-image] { + width: 1.75rem; + height: 1.75rem; + max-height: 1.75rem; + object-fit: contain; + } +}