weegs.dev#
my personal site. it's a terminal -- the whole thing is styled after my oh-my-posh prompt and a nushell/ratatui-ish TUI, so browsing it feels like poking around a shell.
live at weegs.dev.
what's here#
no framework, no bundler, no dependencies. static HTML + CSS, one TypeScript file compiled to plain JS, deployed on Cloudflare Pages. the only server-side piece is a single Pages Function backing the guestbook.
index.html home page (fastfetch-style card + latest news)
gaming.html game library (playing / finished / dropped / notes)
stuff.html projects, blog, rants, guestbook
tui.ts / tui.js the TUI engine: keyboard nav, markdown + nix rendering
prompt-chrome.js live clock / date / page-load-time in the prompt bar
style.css layout + the terminal look
eldritch.css the eldritch colorscheme as css variables
content/ all page content (markdown + generated index.json)
functions/api/ Cloudflare Pages Function for the guestbook
generate-index.nu builds a folder's index.json from its markdown frontmatter
moderate.nu guestbook moderation (list / delete)
the content system#
pages don't hardcode their content. each list item in the HTML is either a
file (fetches a markdown file) or a folder (fetches an index.json and
expands its children inline). tui.ts fetches on demand and renders it with a
small hand-rolled markdown renderer -- headers, tables, code blocks, and a nix
syntax highlighter for the rants.
folder indexes are generated, not written by hand:
nu generate-index.nu content/blog/
it reads the title: / date: frontmatter from every *.md in the dir and
writes a sorted index.json next to them.
keyboard nav#
it's driven like a file manager:
j/k-- move up/down the list (or scroll the open pane)l/enter-- open the focused itemh/esc-- close the pane, or collapse the parent folder
local dev#
serve the folder with any static file server, e.g.:
npx serve .
# or
python -m http.server
then open the printed localhost url. everything except the guestbook works
fully static -- the guestbook needs the Pages Function, so it only responds
live on the deployed site (or under wrangler pages dev).
build#
tui.js is committed, but it's generated from tui.ts. after editing the
TypeScript:
npm run build # tsc -> tui.js
npm run check # tsc --noEmit, type-check only
guestbook#
functions/api/guestbook.ts is a Cloudflare Pages Function backed by a KV
namespace bound as GUESTBOOK. it does a honeypot field, per-IP rate limiting,
and length-clamps every input.
moderation is moderate.nu:
GUESTBOOK_NS_ID=<your-kv-namespace-id> nu moderate.nu list
GUESTBOOK_NS_ID=<your-kv-namespace-id> nu moderate.nu delete <id>
it shells out to wrangler, so you need to be authenticated with Cloudflare
and have the namespace id in the environment.
license#
MIT. the code is yours to learn from and reuse.
the bundled fonts under fonts/ are third-party and keep their own licenses --
see fonts/NOTICE.md.