diff options
| author | nsfisis <nsfisis@gmail.com> | 2023-03-18 22:23:37 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2023-03-18 22:40:43 +0900 |
| commit | 3f82b71a657d8b8218ed468acf0552f29cfd1dd0 (patch) | |
| tree | 5f2f69e8659c62abeb373edec1d2743fa65dc2b4 /nuldoc-src/commands | |
| parent | 2ee549f5f3b1a05f2a769a4e0daa5507997a3159 (diff) | |
| download | blog.nsfisis.dev-3f82b71a657d8b8218ed468acf0552f29cfd1dd0.tar.gz blog.nsfisis.dev-3f82b71a657d8b8218ed468acf0552f29cfd1dd0.tar.zst blog.nsfisis.dev-3f82b71a657d8b8218ed468acf0552f29cfd1dd0.zip | |
feat(nuldoc): first implementation of rendering slide
Diffstat (limited to 'nuldoc-src/commands')
| -rw-r--r-- | nuldoc-src/commands/build.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nuldoc-src/commands/build.ts b/nuldoc-src/commands/build.ts index 8961da9..38af80a 100644 --- a/nuldoc-src/commands/build.ts +++ b/nuldoc-src/commands/build.ts @@ -32,6 +32,7 @@ export async function runBuildCommand(config: Config) { await buildAboutPage(config); await buildNotFoundPage(config); await copyStaticFiles(config); + await copyAssetFiles(slides, config); } async function buildPostPages(config: Config): Promise<PostPage[]> { @@ -182,6 +183,19 @@ async function copyStaticFiles(config: Config) { } } +async function copyAssetFiles(slides: SlidePage[], config: Config) { + const cwd = Deno.cwd(); + const contentDir = join(cwd, config.locations.contentDir); + const destDir = join(cwd, config.locations.destDir); + + for (const slide of slides) { + const src = join(contentDir, slide.slideLink); + const dst = join(destDir, slide.slideLink); + await ensureDir(dirname(dst)); + await Deno.copyFile(src, dst); + } +} + async function writePage(page: Page, config: Config) { const destFilePath = join( Deno.cwd(), |
