parent
9bb40275c8
commit
51bd0fb948
3 changed files with 22 additions and 14 deletions
26
_config.ts
26
_config.ts
|
@ -36,12 +36,14 @@ site.use(feed({
|
||||||
info: {
|
info: {
|
||||||
title: "Foster Hangdaan's Blog",
|
title: "Foster Hangdaan's Blog",
|
||||||
description: "My thoughts and ideas.",
|
description: "My thoughts and ideas.",
|
||||||
date: new Date(),
|
published: new Date(),
|
||||||
lang: "en",
|
lang: "en",
|
||||||
},
|
},
|
||||||
items: {
|
items: {
|
||||||
title: "=title",
|
title: "=title",
|
||||||
description: "=description",
|
description: "=description",
|
||||||
|
published: "=date",
|
||||||
|
updated: "=updated",
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
site.use(code_highlight({
|
site.use(code_highlight({
|
||||||
|
@ -59,16 +61,18 @@ site.use(toc({
|
||||||
}));
|
}));
|
||||||
site.use(footnotes());
|
site.use(footnotes());
|
||||||
|
|
||||||
site.process([".html"], (page) => {
|
site.process([".html"], (pages) => {
|
||||||
// NOTE: This is a hack to append a class to JS doctrings so that we
|
pages.forEach((page) => {
|
||||||
// can style them. If only the Hightlight.js plugin could be configured
|
// NOTE: This is a hack to append a class to JS doctrings so that we
|
||||||
// to do this instead.
|
// can style them. If only the Hightlight.js plugin could be configured
|
||||||
page.document?.getElementsByClassName("hljs-comment").forEach((codeCommentElement) => {
|
// to do this instead.
|
||||||
const docStringRegex = /^\/\*\*.*\*\/$/gsm;
|
page.document?.getElementsByClassName("hljs-comment").forEach((codeCommentElement) => {
|
||||||
const matchResult = codeCommentElement.innerText.match(docStringRegex);
|
const docStringRegex = /^\/\*\*.*\*\/$/gsm;
|
||||||
if (matchResult) {
|
const matchResult = codeCommentElement.innerText.match(docStringRegex);
|
||||||
codeCommentElement.classList.add("docstring");
|
if (matchResult) {
|
||||||
}
|
codeCommentElement.classList.add("docstring");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
10
deno.json
10
deno.json
|
@ -1,16 +1,20 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"jsxImportSource": "react"
|
"jsxImportSource": "npm:react",
|
||||||
|
"types": [
|
||||||
|
"https://unpkg.com/@types/react@18.2.37/index.d.ts",
|
||||||
|
"lume/types.ts"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"lume": "echo \"import 'lume/cli.ts'\" | deno run --unstable --allow-write='.' --allow-read='.' --allow-net='deno.land,cdn.deno.land,esm.sh,0.0.0.0:8080' --allow-sys=networkInterfaces --allow-env='LUME_ENV,LUME_LIVE_RELOAD' -",
|
"lume": "echo \"import 'lume/cli.ts'\" | deno run --unstable --allow-write='.' --allow-read='.' --allow-net='deno.land,cdn.deno.land,esm.sh,0.0.0.0:8080' --allow-sys=networkInterfaces --allow-env='LUME_ENV,LUME_LIVE_RELOAD,LUME_LOGS,LUME_NOCACHE,LUME_DRAFTS' -",
|
||||||
"build": "deno task lume",
|
"build": "deno task lume",
|
||||||
"serve": "deno task lume -s",
|
"serve": "deno task lume -s",
|
||||||
"deploy": "rsync -avh --progress --delete ./_site/ podman:/srv/www/fosterhangdaan.com/"
|
"deploy": "rsync -avh --progress --delete ./_site/ podman:/srv/www/fosterhangdaan.com/"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"react/jsx-runtime": "https://esm.sh/react@18.2.0/jsx-runtime",
|
"react/jsx-runtime": "https://esm.sh/react@18.2.0/jsx-runtime",
|
||||||
"lume/": "https://deno.land/x/lume@v1.19.4/"
|
"lume/": "https://deno.land/x/lume@v2.0.0/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
deno.lock
BIN
deno.lock
Binary file not shown.
Loading…
Reference in a new issue