Skip to content

Commit

Permalink
website: fix missing target_dir error
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrl committed Oct 16, 2024
1 parent 565dc81 commit bfc22ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .docs/eleventy.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ async function shortcode_image(src, alt) {
}

async function shortcode_image_url(src) {
const target_dir = `./_site/img`;
const src_parsed = path.parse(src);
const target = path.join(`./_site/img`, src_parsed.base);
const target = path.join(target_dir, src_parsed.base);
if(!fs.existsSync(path.dirname(target)))
await fs.promises.mkdir(target_dir, { recursive: true });
await fs.promises.copyFile(src, target);
Expand Down

0 comments on commit bfc22ae

Please sign in to comment.