diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index ee05b7c..7ff11e6 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -34,4 +34,4 @@ jobs:
with:
deno-version: ${{ matrix.deno }}
- name: Run unit tests on Deno
- run: deno test
+ run: deno test --allow-none
diff --git a/.gitignore b/.gitignore
index ca35be0..0d3b8d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
_site
+pr.json
diff --git a/.vscode/settings.json b/.vscode/settings.json
index ea4e077..5601ac9 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -2,7 +2,7 @@
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
- "deno.config": "./deno.json",
+ "deno.config": "./deno.jsonc",
"[json][jsonc][markdown][typescript][typescriptreact]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
diff --git a/_config.ts b/_config.ts
index a9d77ef..cb55456 100644
--- a/_config.ts
+++ b/_config.ts
@@ -1,16 +1,33 @@
import { lume } from "./lume_core.ts"
+import type { Processor } from "lume/core/processors.ts"
+
+import multilanguage from "lume/plugins/multilanguage.ts"
import relativeUrls from "lume/plugins/relative_urls.ts"
import inline from "lume/plugins/inline.ts"
import minifyHTML from "lume/plugins/minify_html.ts"
const site = lume()
-site.copy([".css"])
-site.ignore("./README.md")
-site.data("layout", "_includes/base.ts")
-site.use(relativeUrls())
+site
+ .copy([".css"])
+ .ignore("./README.md", "./CONTRIBUTING.md")
+ .data("layout", "_includes/base.ts")
+
+const addMeta: Processor = (pages) =>
+ pages.forEach((page) => {
+ page.data.date = new Date(page.data.basename)
+ page.data.title = page.data.title ?? page.data.basename
+ })
+
+site
+ .preprocess([".md"], addMeta)
+ .use(relativeUrls())
+ .use(multilanguage({ languages: ["ko"] }))
+
if (Deno.env.get("MINIFY")) {
- site.use(inline())
- site.use(minifyHTML())
+ site
+ .use(inline())
+ .use(minifyHTML())
}
+
export default site
diff --git a/_includes/base.ts b/_includes/base.ts
index a75876e..a0cecdd 100644
--- a/_includes/base.ts
+++ b/_includes/base.ts
@@ -1,5 +1,17 @@
export const repo = "https://github.com/scarf005/bn-blog"
+const header = /*html*/ `
+
+`
+
const footer = /*html*/ `