Skip to content
AclevoPublic

About

This is the repository that contains the Aclevo Blog

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Aclevo Blog

Aclevo Blog: the Aclevo community's archive, restored from the original WordPress site. It ships the 25 posts published between 2017 and 2021, with their original dates and bylines, and its own identity rather than a marketing demo. Home page with a featured story and rail, "Continue reading" for half-read articles (with minutes left), latest posts, browse by topic and an About Aclevo band; a paginated, filterable blog (category tabs, tag chips, sort and page all in the URL); article pages with read time, a reading progress bar, "resume where you left off", sticky table of contents, share rail, bookmarks, rich blocks, author box, the archive note and related posts; topic (/topics/:id) and tag (/tags/:tag) landing pages; saved posts (/saved); the four real archive authors' pages; an about/provenance page (/about); a search palette (Ctrl/Cmd K or /) over titles, topics, tags, authors and full article text, with a highlighted snippet from the body; per-post 1200×630 share cards built from the post itself; a light/dark theme toggle; a 404 page; and a live style guide (/styleguide, also linked in the footer).

Run it

bun install
bun run dev        # http://127.0.0.1:5186 (Vite + the Worker in workerd)
bun run build      # dist/client (assets) + dist/blog/index.js (Worker)
bun run images     # regenerate the JPEG, WebP and AVIF files the site ships

With the dev server running, four audits check the design contract: bun run audit:layout (shell alignment, overflow, prose width at 320–1920px), bun run audit:text (rendered text contrast, both themes), bun run audit:a11y (axe-core at WCAG 2.2 AA plus landmarks, both themes at 1440 and 390px, and the focus behaviour of search and the mobile menu) and bun run contrast (token pairs against the worst-case glass, no browser).

Write a post

Posts are Markdown files in content/posts/. The filename is the slug, so content/posts/my-post.md serves /blog/my-post; add a file and the post appears in the blog, its topic and tag pages, the author page, search, the RSS feed and the sitemap — nothing in src/ has to change.

Frontmatter:

---
title: "The headline"
dek: "One-sentence summary, used on cards and in social cards."
category: games           # games | software | privacy | company | kitchen
section: blog             # blog
tags: [Games, Software]
author: theoceanbreeze
date: 2026-01-12          # YYYY-MM-DD — a future date schedules the post
draft: true               # optional: staged, never published
cover:
  photo: studio           # a key from PHOTOS, or `art: 1` for generated art
  alt: "What the image shows"   # required, and it must describe the image
featured: 1               # optional: home-page rail order
hero: true                # optional: exactly one post
---

Body syntax: paragraphs (inline **bold**, *italic*, `code`, [links](https://…)), ## Heading / ### Subheading (which feed the table of contents), - item and 1. item lists, > quote with an optional final > — cite line, fenced code with ```ts filename.ts, and three directives:

::: tip Keep prompts in version control
Callout body. Tones: info, tip, warning.
:::

::: stats
64% | of marketers use AI weekly
3.1x | more drafts per writer
:::

::: figure photo:studio
Alt text for the image
---
Optional caption
:::

Tags are a small vocabulary. The archive's 67 one-off tags ("slushie tutorial", "juice to slushie", "pacman package manager", …) made a page each with one article on it, so TAG_ALIASES in src/content/schema.ts maps them onto the 7 tags the site serves — slushie tutorial → Recipes, pacman package manager → Software, and so on. The build applies the alias (scripts/build-content.ts), so the frontmatter keeps what the author wrote while every page, feed, sitemap entry and JSON-LD keywords carries the merged tag, and /tags/<old> 301s to the merged page the way retired topics do. To add a tag, use it in a post; when two tags mean the same thing, add an alias instead of a second thin page.

Alt text is required. Every cover and figure needs a description; bun run content fails with the file and the field when it is missing, blank, a placeholder (image, photo, screenshot) or looks like a filename. This is enforced in src/content/parse.ts (requireAlt), so an inaccessible image cannot reach the site, the feeds or the share cards.

Internal links are checked at build time. bun run content resolves every in-body link (src/content/links.ts) against the routes the site serves: published posts and their heading anchors, topic and tag pages (retired topics included, they 301), shows, author pages, feeds and the static pages. A typo fails the build with the file, the link and the reason instead of shipping an anchor that lands on the 404 page.

Drafts and scheduling. draft: true keeps a post out of the site however new it is. A date in the future schedules it: it is absent from the blog, its topic and author pages, search, the RSS feed and the sitemap until the first build on or after that day. Both are enforced in scripts/build-content.ts through src/content/publish.ts, so a staged post is not in posts.generated.ts at all — nothing can link to it, and /blog/<slug> returns 404. Drafts still parse, so a malformed one fails the build the moment it is saved rather than on the day it would have gone live.

Publish a post

The path from a saved Markdown file to a live page is deliberately manual: content is bundled at build time, and Freebuff Sites does not build on push or expose a deploy hook. A git-based CMS is planned for later and is not set up, so until then publishing needs someone at a terminal.

  1. Add or edit the Markdown in content/posts/. A future date schedules it; draft: true keeps it out of every route, feed and the sitemap.
  2. Run bun run content (the dev server, build, tests and typecheck also run it) and fix anything the parser or the internal-link check rejects.
  3. Run bun run verify — eleven checks, including the rendered audits. It ends with dist/ built and the size budget checked.
  4. Run bun run cards if the post is new or its title changed. It writes public/share/<slug>.jpg; tests/share-cards.test.ts fails until it exists.
  5. Commit the post, the regenerated module and the new card.
  6. Deploy deploy.json with the sites_deploy tool. Deploying does not publish: a new deployment stays offline in an unpublished environment, and sites_set_published is the separate step that makes it public.
  7. Rebuild the card only when the title, byline or topic changes; the card is a static file, not a build step.

bun run content compiles the Markdown into src/content/posts.generated.ts (committed, so a cold typecheck works). The dev server, build, tests and typecheck all run it, and the dev server reruns it when a post is saved, so you rarely call it by hand. The generated module is plain data on purpose: the Cloudflare Worker imports it to render feeds, the sitemap and per-URL share cards without a bundler in the loop.

The archive says it is the archive. The 25 posts restored from the old WordPress site keep their original dates and bylines, and each one carries "From the archive — first published " under the byline, both in the page React renders and in the no-JS HTML (src/content/archive.ts). ARCHIVE.md records where those posts came from, what the import repaired, the four text repairs made to damaged archive sentences, and the external-link sweep it has had since.

Publishing is a deploy. See Publish a post above for the exact order. bun run build regenerates the content, builds the Worker and the SPA into dist/, and that is what gets uploaded (deploy.json). A post goes live when the build is deployed and the environment is published — not when you save the file. That is the trade for shipping content inside the bundle; TODO.md records when it would be worth moving posts to R2 or D1 instead.

Import the WordPress archive

The 25 archive posts came from a server disk image, not from an export file. The import is reproducible without the original server:

  1. Copy the WordPress tree and the MariaDB datadir out of the image (read-only: mount -o ro,noload on the root LV, or dd the partition out first).
  2. Dump the site database with a container matching the archive's server, e.g. podman run --rm --network none -v <datadir-copy>:/var/lib/mysql:rw mariadb:10.11 (--skip-networking; the datadir must be a copy, not the mount).
  3. Export the tables to /tmp/wp-restore/out/*.tsv with every text column base64-encoded — JSON_OBJECT and --raw get mangled by CLI escaping: posts, attachments, meta, terms, users, options.
  4. Keep the uploads tree at /tmp/wp-restore/wp/var/www/wordpress/wp-content/uploads.
  5. Run bun run import:wp (or WP_RESTORE=/path bun scripts/import-wordpress.ts).

What it does: converts each published post's Gutenberg HTML to Markdown with scripts/wp-html.ts, replaces every file in content/posts/, copies covers and in-body images to media/images/articles/, writes the MEDIA registry to src/content/media.generated.ts, and lists every conversion warning plus any unreadable image in $WP_RESTORE/import-report.md.

Notes:

  • The import sets no hero/featured flags: both queries fall back to date order across all posts, so the homepage follows the newest content. Add the flags by hand to pin a lead story.
  • Images referenced by URL that still resolve (one Unsplash photo) are cached once and mapped in the importer's REMOTE_MEDIA; dead aclevo.xyz originals stay as links and stay in the report.
  • Old WordPress permalinks (/blog/YYYY/MM/DD/<postname>/) 301 to /blog/<slug> in src/worker/index.ts, and retired topic URLs 301 through RETIRED_TOPICS in src/content/schema.ts.
  • After importing, run bun run content (or any script, which does it) and bun run images for the shipped JPEG, WebP and AVIF files.
  • Upload budget: Sites rejects a deploy whose assets exceed 10 MiB (dist/client). Originals live in media/ so they are not uploaded; the shipped set is the 1200px JPEG fallbacks, the WebP and AVIF ladders, and the 25 per-post share cards (~1 MB). dist/client currently lands at 8,990,412 bytes (85.7% of the cap), leaving 1,495,348 bytes of headroom. bun run budget sums the files under dist/client and the verify gate runs it right after the build, so an over-size bundle fails in about a minute instead of in sites_deploy after the whole gate. It prints bytes used, bytes remaining, percent of the cap and the trim levers, and names the overage when it fails. The cap is one constant, CAP_BYTES in scripts/budget.mjs, labelled with the Freebuff Sites plan it comes from. If you add many more images, lower -quality in scripts/images.mjs or trim a width — a deploy error saying "Site file exceeds the upload limit" means the bundle grew, not that a single file is too big.

Edit the rest

  • src/data.ts holds the site structure: name, canonical origin, licence, tagline and the real Aclevo links, categories and the four archive authors. It re-exports POSTS, PHOTOS and the post types from the content layer, so existing imports keep working.
  • No analytics. The owner declined analytics (R12, 29 November 2026), so the site measures nothing. The rail under the 404 page is an explicit "Start here" list of editor picks (src/components/StartHere.tsx) and says it is not a ranking; there is no MOST_READ list or hidden popularity path.
  • Images: PHOTOS in src/data.ts is the one place photo paths live (shipped files in public/images, originals in media/images, which is not uploaded). Replace the originals or the paths with your own photography, then run bun run images: it writes a 1200px JPEG fallback at the PHOTOS path plus <name>-480/-960/-1600.avif and .webp beside it, and Cover offers them in a <picture> (AVIF, then WebP, then the JPEG) through srcset/sizes. Pass sizes for covers that render larger than a third of the viewport. A cover can also be { art: n }, a generated SVG composition from src/components/Cover.tsx, so a post never needs an image file.
  • src/styles.css holds the tokens as raw CSS variables in two blocks, light (:root) and dark ([data-theme='dark']), mapped onto Tailwind utilities with @theme inline (bg-bg, text-ink, ring-line...). A blue-to-indigo gradient canvas with translucent, blurred panels (the glass, glass-soft and glass-dark utilities), near-white ink #f5f8ff, indigo brand for filled buttons, a pale accent for links and labels, white hairline borders, large radii (12px controls, 20px cards, 22px media, 28px dialogs), tinted shadows, motion durations, and Manrope with Anta for the wordmark and navigation. :root is the light palette and [data-theme='dark'] replaces it; .on-dark pins the dark set for surfaces that stay dark in both themes (code slabs, dialogs). Components use the semantic tokens (text-ink, bg-surface, border-line) rather than literal whites, which is what makes one palette swap work. The theme toggle (header, mobile menu) is remembered in localStorage; until used, the OS setting applies. index.html sets the theme before first paint. Two utilities carry the hover motion: title-link (underline that grows from the left) and zoom-media (slow image zoom), both triggered by a parent .group.
  • Icons and install metadata live in public/: favicon.svg (scalable), apple-touch-icon.png (180×180), icon-192.png, icon-512.png and site.webmanifest; index.html links the icon, the touch icon and the manifest. Regenerate the PNGs from the SVG with ImageMagick if the mark changes.
  • Fonts are self-hosted from public/fonts (Manrope as one variable file, Anta, JetBrains Mono) with @font-face in src/fonts.css and preloads in index.html; there is no third-party font request.
  • src/components/ are the pieces, all shown at /styleguide: ui.tsx (Container, Button with loading, IconButton, Spinner, Input, Field, Select, Check/Checkbox, Chip, ChipLink, Tabs, Eyebrow, Badge, Avatar, SectionHeading, ArrowLink, PageHeader, EmptyState, ProgressBar, Kbd, Pagination), Dialog (the one overlay: Esc, scrim click, focus trap and restore, scroll lock), Toaster, ThemeToggle, BookmarkButton, Cover, PostCard (card, rail row, list item, byline), PostGrid, Blocks, Toc, ReadingProgress, ContinueReading, SearchOverlay, Nav, Footer, Reveal, StartHere.
  • src/pages/ are the screens: Home, Listing (blog), Article, Topic (topic and tag), Saved, Author, About, NotFound, StyleGuide.
  • src/lib/ holds the state: storage.ts (a tiny persisted store used for theme, bookmarks and reading progress), meta.ts (per-route title and share-card tags), params.ts (?page= and filter URLs), motion.ts (motion tokens mirrored from the CSS), search.ts (full-text search over post bodies — AND across terms, title beats dek/tag/author beats body-only — plus the snippet window the palette highlights).
  • Listing page size is PAGE_SIZE.
  • Motion uses motion: page transitions, staggered hero entrance, scroll reveals, animated filter grid, overlays. prefers-reduced-motion is respected.
  • src/worker/index.ts is the Cloudflare Worker:
    • Legacy WordPress/Nuxt URLs beyond the date permalinks (R14): every old feed (/feed/, /feed.xml, /feeds/all.atom.xml, …) 301s to /rss.xml; /category/<slug> and /blog/category/<slug> 301 to the topic that covers them; /tag/<slug> and /blog/tag/<slug> 301 to the live or merged tag page. The seven-slug category table and its Wayback provenance live in src/content/legacy-urls.ts; unknown slugs stay 404.
    • SITE.origin (https://www.blog.aclevo.com) is the canonical origin. The canonical tag, JSON-LD identifiers, sitemap, RSS links and og:url use it regardless of the host that served the request; any other host gets X-Robots-Tag: noindex, nofollow and a disallowing robots.txt, so the preview cannot compete with the real site for its own posts (R2/R3).
    • For an article URL it also writes the post itself into #root: the title, dek, byline, date and every body block, rendered by src/worker/article-html.ts. A crawler that does not run JavaScript, a text browser or a reader with JS off gets the article instead of an empty shell; createRoot() clears #root on first render, so the hydrated page replaces that markup rather than duplicating it. Only generated art covers need the bundle.
    • GET /rss.xml (optionally ?topic=games), /sitemap.xml and /robots.txt.
    • For every HTML page it rewrites the title, description and Open Graph / Twitter tags for that URL (article cover as the share image), injects Article JSON-LD for /blog/<slug> (src/worker/jsonld.ts, fields omitted when the post has none) and returns status 404 for unknown URLs, so crawlers and link previews see the right card and schema without running JavaScript.

Checks

One command runs everything, in order, and stops at the first failure:

bun run verify     # 11 checks, ~4 minutes
step what it proves
content every Markdown post parses and the generated module is current
typecheck tsc --noEmit is clean
tests the suite (bun test tests) passes
contrast the palette's worst-case text/panel pairs clear 4.5:1
build + postbuild the production bundle and Worker build
budget the built client fits the Sites 10 MiB upload cap, with headroom printed
perf LCP ≤ 2500 ms, CLS ≤ 0.10 and ≤ 1.5 MiB transferred at 390×844 for / and an article
audit:text rendered text, both themes, composited backgrounds
audit:a11y axe-core at WCAG 2.2 AA + landmarks on four routes, both themes, 1440 and 390px, plus search/menu focus behaviour
audit:layout 320–1920px: shared shell edges, no horizontal scroll, 720px prose

The last three drive headless Chromium against vite preview (the built client, not a dev server), so they measure what ships. They are what a stale generated module or a contrast, name or geometry regression used to slip past — each fails the gate now, which is verified by deliberately breaking a test, the layout and a control's accessible name and watching it exit 1.

Without Chromium, SKIP_AUDITS=1 bun run verify runs the other seven checks. If Chromium is installed somewhere off PATH, set CHROME_PATH. CI (.github/workflows/verify.yml) installs Chromium through Playwright and runs the same command.

The individual commands are still there for working on one thing: bun run audit:layout, bun run audit:text, bun run audit:a11y and bun run contrast expect a dev server on 127.0.0.1:5186 (override with AUDIT_ORIGIN).

bun run audit:links is the one audit that is not in the gate: it needs the network, so it runs on demand. It probes every external link in content/posts, follows each web.archive.org wrapper back to its original, and writes LINK-REPORT.md with a verdict per link; --unwrap rewrites only the wrappers whose original still answers. The last sweep and what it left alone are recorded in ARCHIVE.md.

Deploy with Freebuff Sites

deploy.json already points at the build output. After bun run build, deploy it with the sites_deploy tool (or the Sites API) from this directory.

The canonical origin is https://www.blog.aclevo.com (SITE.origin). That host is attached to the site and is the only one that is indexable; the freebuff hosts still serve the pages but answer noindex, and every canonical link points at the custom domain.

About

This is the repository that contains the Aclevo Blog

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages