diff --git a/assets/index.html b/assets/index.html new file mode 100644 index 0000000..7d4f928 --- /dev/null +++ b/assets/index.html @@ -0,0 +1,12 @@ + + + + + + Redirecting... + + + +

If you are not redirected automatically, follow this link.

+ + diff --git a/biome.json b/biome.json index 3fd805c..7e35a3a 100644 --- a/biome.json +++ b/biome.json @@ -12,7 +12,8 @@ "dev.ts", "bun_build.js", "postcss.config.js", - "tailwind.config.js" + "tailwind.config.js", + "permlink.js" ], "ignoreUnknown": false, "ignore": [] diff --git a/dev.ts b/dev.ts index 634fac3..e27c98f 100644 --- a/dev.ts +++ b/dev.ts @@ -11,9 +11,9 @@ const app = new Elysia({ idleTimeout: 960, }, }) - .get('/', ({ redirect }) => { - return redirect('/index.xml') - }) + // .get('/', ({ redirect }) => { + // return redirect('/index.xml') + // }) .use( staticPlugin({ assets: 'output', diff --git a/permlink.js b/permlink.js new file mode 100644 index 0000000..3270aff --- /dev/null +++ b/permlink.js @@ -0,0 +1,21 @@ +import { mkdirSync } from 'node:fs' + +const file = Bun.file('./output/forest.json') +const output = await file.text() +const all_trees = JSON.parse(output) +const index_html = await Bun.file('./assets/index.html').text() + +for (const [tree_id, tree] of Object.entries(all_trees)) { + if (tree.metas) { + // console.log(tree_id, tree.metas); + if (tree.metas.permlink) { + const permlink = tree.metas.permlink + console.log(tree_id, permlink) + mkdirSync(`./output/${permlink}`, { recursive: true }) + await Bun.write( + `./output/${permlink}/index.html`, + index_html.replaceAll('./index.xml', `../${tree_id}.xml`), + ) + } + } +} diff --git a/trees/cg-macros.tree b/trees/cg-macros.tree index d55c6e4..a7b43b3 100644 --- a/trees/cg-macros.tree +++ b/trees/cg-macros.tree @@ -3,8 +3,7 @@ \tag{macro} \def\normbar{\verb~|\|~} -\def\norm[x]{\normbar\x\normbar} - +\def\norm[x]{\lVert\x\rVert} \def\point[x]{\boldsymbol{\x}} diff --git a/trees/uts-0018.tree b/trees/uts-0018.tree index 4f14a34..882ef0a 100644 --- a/trees/uts-0018.tree +++ b/trees/uts-0018.tree @@ -1,6 +1,7 @@ \import{macros} % clifford hopf spin tt ag math draft tech exp notes readings \tag{root} +% \meta{permlink}{reading-diary} \put\transclude/numbered{false} @@ -17,6 +18,7 @@ \mdblock{10-09}{ - read [C++ Package Managers: The Ultimate Roundup](https://moderncppdevops.com/pkg-mngr-roundup/), and might start using [xrepo](https://xrepo.xmake.io/) for C/C++ package management, it also supports a wide range of [package repositories](https://xmake.io/#/home?id=supported-package-repositories), including Conan, Conda, Vcpkg, Homebrew, Apt, and Cargo. But not [BinaryBuilder.jl ecosystem](https://github.com/JuliaPackaging/BinaryBuilder.jl) (see also [this FAQ](https://docs.binarybuilder.org/dev/FAQ/#Hey,-this-is-cool,-can-I-use-this-for-my-non-Julia-related-project?)). - clarify the license for GinacLean, laying the ground for potential future work around [Cadabra 2](https://github.com/kpeeters/cadabra2), which is licensed under GPLv3 +- learn about [Kento Okura's forest and Glade](https://kentookura.srht.site/) and [Nota](https://nota-lang.org/) } diff --git a/trees/uts-002F.tree b/trees/uts-002F.tree index aafd903..4b3b02c 100644 --- a/trees/uts-002F.tree +++ b/trees/uts-002F.tree @@ -35,5 +35,5 @@ I'm a bit rusty on Vim mode of VS Code, here are some useful keys that I like us Recalled by [VSCode Vim ROADMAP](https://github.com/VSCodeVim/Vim/blob/HEAD/ROADMAP.md). -Got to this because of trying Vim mode in Zed lately. Should check out [zed-101-setup](https://github.com/jellydn/zed-101-setup) for configurations and key maps inspirations. +Got to this because of trying Vim mode in Zed lately. Should also check out [zed-101-setup](https://github.com/jellydn/zed-101-setup) for configurations and key maps inspirations. }