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: {
|
||||
title: "Foster Hangdaan's Blog",
|
||||
description: "My thoughts and ideas.",
|
||||
date: new Date(),
|
||||
published: new Date(),
|
||||
lang: "en",
|
||||
},
|
||||
items: {
|
||||
title: "=title",
|
||||
description: "=description",
|
||||
published: "=date",
|
||||
updated: "=updated",
|
||||
}
|
||||
}));
|
||||
site.use(code_highlight({
|
||||
|
@ -59,16 +61,18 @@ site.use(toc({
|
|||
}));
|
||||
site.use(footnotes());
|
||||
|
||||
site.process([".html"], (page) => {
|
||||
// NOTE: This is a hack to append a class to JS doctrings so that we
|
||||
// can style them. If only the Hightlight.js plugin could be configured
|
||||
// to do this instead.
|
||||
page.document?.getElementsByClassName("hljs-comment").forEach((codeCommentElement) => {
|
||||
const docStringRegex = /^\/\*\*.*\*\/$/gsm;
|
||||
const matchResult = codeCommentElement.innerText.match(docStringRegex);
|
||||
if (matchResult) {
|
||||
codeCommentElement.classList.add("docstring");
|
||||
}
|
||||
site.process([".html"], (pages) => {
|
||||
pages.forEach((page) => {
|
||||
// NOTE: This is a hack to append a class to JS doctrings so that we
|
||||
// can style them. If only the Hightlight.js plugin could be configured
|
||||
// to do this instead.
|
||||
page.document?.getElementsByClassName("hljs-comment").forEach((codeCommentElement) => {
|
||||
const docStringRegex = /^\/\*\*.*\*\/$/gsm;
|
||||
const matchResult = codeCommentElement.innerText.match(docStringRegex);
|
||||
if (matchResult) {
|
||||
codeCommentElement.classList.add("docstring");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
10
deno.json
10
deno.json
|
@ -1,16 +1,20 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
"jsxImportSource": "npm:react",
|
||||
"types": [
|
||||
"https://unpkg.com/@types/react@18.2.37/index.d.ts",
|
||||
"lume/types.ts"
|
||||
]
|
||||
},
|
||||
"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",
|
||||
"serve": "deno task lume -s",
|
||||
"deploy": "rsync -avh --progress --delete ./_site/ podman:/srv/www/fosterhangdaan.com/"
|
||||
},
|
||||
"imports": {
|
||||
"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