diff options
| author | nsfisis <nsfisis@gmail.com> | 2023-03-09 01:13:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2023-03-09 01:13:36 +0900 |
| commit | ff4a917800d99f792a006d12107ea901670e55df (patch) | |
| tree | f048e9e09356ce5297a3c6fc381c354f714bac1b /nuldoc-src | |
| parent | 88ba6cfe220216f371f8756921059fac51a21262 (diff) | |
| download | blog.nsfisis.dev-ff4a917800d99f792a006d12107ea901670e55df.tar.gz blog.nsfisis.dev-ff4a917800d99f792a006d12107ea901670e55df.tar.zst blog.nsfisis.dev-ff4a917800d99f792a006d12107ea901670e55df.zip | |
nuldoc: copy static files on build
Diffstat (limited to 'nuldoc-src')
| -rw-r--r-- | nuldoc-src/command.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nuldoc-src/command.ts b/nuldoc-src/command.ts index 7495427..47b8ee0 100644 --- a/nuldoc-src/command.ts +++ b/nuldoc-src/command.ts @@ -13,6 +13,7 @@ export async function run(config: Config) { const posts = await generatePosts(config); await generateTags(posts, config); await generatePostList(posts, config); + await copyStaticFiles(config); } async function generatePosts(config: Config) { @@ -140,3 +141,12 @@ async function outputTags(tagDocs: [string, Document][], config: Config) { await writeHtmlFile(tagDoc, destFilePath); } } + +async function copyStaticFiles(config: Config) { + const globPattern = joinGlobs([Deno.cwd(), config.locations.staticDir, "*"]); + for await (const entry of expandGlob(globPattern)) { + const src = entry.path; + const dst = src.replace(config.locations.staticDir, config.locations.destDir); + await Deno.copyFile(src, dst); + } +} |
