From 1f02221e17dafb59689d2c3f593ab08451917ded Mon Sep 17 00:00:00 2001 From: rot1024 Date: Tue, 24 Oct 2023 23:08:04 +0900 Subject: [PATCH] chore: reenable integration --- src/integrations/index.ts | 23 ++++++++++++----------- src/notion/markdown.ts | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/integrations/index.ts b/src/integrations/index.ts index 311f668..b5d1f9f 100644 --- a/src/integrations/index.ts +++ b/src/integrations/index.ts @@ -1,22 +1,23 @@ -// import child_process from "node:child_process"; -// import fs from "node:fs"; +import child_process from "node:child_process"; +import fs from "node:fs"; import type { AstroIntegration } from "astro"; -// import { debug } from "../utils"; +import { debug } from "../utils"; -// const assetsDir = ".astro/.astrotion/static"; -// const assetDirName = "static"; +const assetsDir = ".astro/.astrotion/static"; +const assetDirName = "static"; export default (): AstroIntegration => ({ name: "astrotion", hooks: { - "astro:build:done": async ({ dir: _ }) => { - // const outDir = new URL(assetDirName, dir.href).pathname; - // fs.mkdirSync(outDir, { recursive: true }); - // const command = `cp -n -r ${assetsDir}/* ${outDir} || true`; - // debug(`copying assets: ${command}`); - // child_process.execSync(command); + "astro:build:done": async ({ dir }) => { + const outDir = new URL(assetDirName, dir.href).pathname; + fs.mkdirSync(outDir, { recursive: true }); + + const command = `cp -n -r ${assetsDir}/* ${outDir} || true`; + debug(`copying assets: ${command}`); + child_process.execSync(command); }, }, }); diff --git a/src/notion/markdown.ts b/src/notion/markdown.ts index 12b407f..c3ad533 100644 --- a/src/notion/markdown.ts +++ b/src/notion/markdown.ts @@ -20,7 +20,7 @@ export const md2html = unified() .use(remarkRehype) .use(rehypeKatex) .use(rehypeMermaid, { strategy: "pre-mermaid" }) - .use(rehypePrism as any) // rehypePrism reports type error + .use(rehypePrism) .use(rehypeStringify); export function transformMdBlocks(