Static site for jonnil.games: pages, games, team info, blog, feeds, webmentions, and post-deploy syndication.
- Node.js 24 or newer
- npm
npm install
npm run dev
npm run build
npm run lint
npm run formatnpm run dev builds once, then serves public/ on port 3001. It does not watch files.
.
├── build.js # static site builder
├── lib/ # shared URL and syndication helpers
├── netlify.toml # Netlify build, redirects, headers, edge functions
├── netlify/
│ ├── edge-functions/ # bot and agents endpoints
│ ├── functions/ # serverless functions
│ ├── plugins/post-deploy-syndication/
│ └── post-deploy/run-syndication.js
├── src/
│ ├── .well-known/ # copied to public/.well-known/
│ ├── assets/ # copied to public/
│ ├── blog/ # Markdown posts, templates, styles, scripts
│ ├── capsules/ # reusable HTML/CSS/JS fragments
│ ├── config.json # fonts, metadata, rel=me links
│ ├── pages/ # static pages and game pages
│ └── styles/ # bundled into public/styles.css
└── public/ # generated output, do not edit
npm run build runs node build.js.
The builder:
- Deletes and recreates
public/ - Processes every file under
src/pages/ - Expands
<drop capsule="name"></drop>tags - Injects shared resources from
src/config.json - Adds canonical URLs using
https://jonnil.games - Adds
/scripts/i18n-init.jswhere needed - Writes global CSS to
public/styles.css - Writes shared JS to
public/scripts.js - Copies standalone scripts such as
i18n-init.jstopublic/scripts/ - Copies used capsule scripts to
public/capsules/<name>/<name>.js - Copies
src/assets/topublic/ - Copies
src/.well-known/topublic/.well-known/ - Copies
lib/sanitize-url.jstopublic/lib/sanitize-url.js - Builds the blog into
public/blog/ - Generates
public/blog/rss.xml,public/blog/atom.xml,public/blog/recent-posts.json, andpublic/blog/sticky-paws-changelog.json
Add or edit static pages in src/pages/.
HTML files are processed by the build. Non-HTML files under src/pages/ are copied as-is, which is how game-specific images and styles are handled.
Canonical paths:
src/pages/index.html->/src/pages/about.html->/about.htmlsrc/pages/games/sticky/index.html->/games/sticky/
Put shared assets under src/assets/.
Examples:
src/assets/images/example.png->/images/example.pngsrc/assets/icons/example.svg->/icons/example.svgsrc/assets/i18n/en.json->/i18n/en.json
Page-local assets can live beside a page under src/pages/; those are copied to the same relative path in public/.
Capsules are reusable site fragments.
Use one in a page or blog template:
<drop capsule="header"></drop>Create one with:
src/capsules/<name>/<name>.html
src/capsules/<name>/<name>.css
src/capsules/<name>/<name>.js
Only the HTML file is required. CSS is bundled into public/styles.css. JS is copied and injected only when that capsule is used.
Current capsules:
headerfooterfollow-updatescontinue-discussion
Posts live in src/blog/posts/*.md. The filename is the slug.
Example:
---
title: "Post title"
date: "2026-05-11"
publishedAt: "2026-05-11T14:30:00Z"
author: "Jonnil"
excerpt: "Short summary for cards, feeds, and social previews."
image: "/images/example.png"
categories:
- "News"
- "Sticky Paws"
---Required:
date:YYYY-MM-DDor ISO 8601
publishedAt is the publication instant used for newest-first ordering. Use an
ISO 8601 datetime with Z or an explicit UTC offset. Keep date as the date
readers should see; adding publishedAt does not change it. When no publication
time is known, ordering falls back to date, and equal dates keep their existing
filename order. The older patch-note timestamps were recovered from their first
publication commits, rather than later announcement-confirmation commits.
Recommended:
title: defaults to filename when missingauthor: defaults toJonnil Gamesexcerpt: falls back to the first 180 plain-text characterscategories: first category powers the blog filter and card badgeimage: social preview image, defaults to/images/og-preview.png
Optional:
draft: true
canonical: "https://example.com/post"
webmentionTarget: "https://example.com/social-post"Drafts are skipped unless BLOG_INCLUDE_DRAFTS=1 is set.
Posts can include localized body sections:
Default-language body.
:::lang sv
Swedish body.
:::Add localized metadata when needed:
defaultLanguage: "en"
languages:
- "en"
- "sv"
translations:
sv:
title: "Localized title"
excerpt: "Localized excerpt."Translation entries can also provide author, categories, and body content via body, content, or markdown.
Production deploys run netlify/plugins/post-deploy-syndication, which calls netlify/post-deploy/run-syndication.js.
To request syndication for a post:
syndicate:
- "bluesky"
- "discord"Supported targets:
bluesky: published through Bridgydiscord: published throughDISCORD_WEBHOOK_URL
After syndication, automation writes state back into the post frontmatter:
syndication:
bluesky: "https://bsky.app/..."
discord: "https://discord.com/..."
syndicationStatus:
bluesky: "confirmed"
discord: "confirmed"
syndicationComplete: trueDo not add those state fields by hand unless repairing a failed publish.
Required Netlify/GitHub env for writeback:
GITHUB_TOKENGITHUB_OWNERGITHUB_REPOGITHUB_BRANCHoptional, defaults tomain
Discord also needs:
DISCORD_WEBHOOK_URL
The blog build writes:
public/blog/index.htmlpublic/blog/<slug>/index.htmlpublic/blog/styles.csspublic/blog/scripts/public/blog/recent-posts.jsonpublic/blog/sticky-paws-changelog.jsonpublic/blog/rss.xmlpublic/blog/atom.xml
Feed metadata can be adjusted with:
BLOG_TITLEBLOG_DESCBLOG_LANGBLOG_AUTHORBLOG_RECENT_COUNTBLOG_EMPTY_FEED_UPDATED
Blog pages include webmention UI. Runtime fetching uses:
netlify/functions/webmentions.jssrc/blog/scripts/webmentions.js
Build-time webmention fetching is currently disabled in build.js.
Netlify uses:
[build]
publish = "public"
command = "npm run build"netlify.toml also configures:
- Node 24
- post-deploy syndication plugin
- edge function routing for
/* - Discord and Bluesky redirects
- feed aliases
- legal page aliases
- security, cache, feed, and
.well-knownheaders - 404 fallback to
/404.html
src/config.json controls shared build-time metadata:
- Google Fonts resource injection
- global title fallback
rel=melinks
Canonical URLs always use https://jonnil.games, including deploy previews.
- Edit files under
src/,lib/,netlify/, or root config - Do not edit
public/by hand - Run
npm run buildbefore publishing site changes - Run
npm run lintfor JavaScript changes