An EmDash plugin (native, content:write only) with one admin page: a diigo username and an ISO week. It reads diigo-cache's public page (?in=<week>&by=created) as microformats, follows rel=next, and creates a draft in issues shaped like seed/issues.json. Transport is a DIIGO_CACHE service binding rather than ctx.http.fetch: EmDash's SSRF guard refuses localhost, and the binding names one worker. Logic lives in src/week.ts with the fetcher passed in; tests read fixtures in diigo-cache's markup. The checklist's goal 2 now names potluck; DiigoBridge waits. Generated-by: Claude Opus 5.5
3.9 KiB
Contributing to potluck
potluck started as EmDash's cloudflare:blog template (pnpm create emdash@latest); it's part of the capsite goal tree, where it is the site that publishes the weekly roundup.
How it's put together
- Issues are the
issuescollection (seed/issues.json):title,week(an ISO week,2026-W40),dek(one-line summary),body(Portable Text). The slug is the week, lowercased:/issues/2026-w40. issues-sketch.md is the dry run behind the three sample issues: real public bookmarks, editorial lines marked draft. - Pages: home and
/issueslist issues (src/pages/issues/);/tag/<tag>lists issues by diigo tag; search and/rss.xmlcover issues. Thepostscollection and its pages are the template's, still in place. - Microformats: an issue list is an
h-feedofh-entrys; an issue is anh-entry(p-name,dt-published,p-summary,e-content). In issue bodies, CiteLink.astro marks off-site links ash-citeand/tag/<tag>links as rel-tagp-category. - Look: plain HTML, after kmjn.org's Plain HTML with a few bureaucratic gestures: system fonts (no webfonts), one ~800px column, links in the text color with a dotted underline. Restyle in src/styles/theme.css, which overrides the defaults in
tokens.css(unlayered, so it always wins); don't edittokens.cssorBase.astrofor visual changes. Colors uselight-dark(<light>, <dark>).
Plugins
diigo-week (Plugins → Draft from diigo in the admin) drafts an issue from a week of diigo bookmarks. It reads diigo-cache's public page as microformats over the DIIGO_CACHE service binding in wrangler.jsonc; in dev, run diigo-cache's pnpm dev alongside. It's linked as link:../diigo-week, and registered in astro.config.mjs. After changing it, restart the dev server.
Seeds
seed/seed.json (site settings, menus, widgets, the template's collections) is applied on the first request to an empty database. seed/issues.json is separate: pnpm seed:issues applies it to the local D1 database, which exists after the dev server's first request. Run it with the dev server stopped.
Checks
pnpm typecheck # astro check
pnpm build
EmDash rules
- All content pages are server-rendered (
output: "server"); nogetStaticPaths()for CMS content. - Image fields are objects (
{ src, alt }), not strings; render with<Image image={...} />from"emdash/ui". entry.idis the slug (for URLs);entry.data.idis the database ULID (for API calls likegetEntryTerms).- When Astro's cache is enabled, pass query hints to
Astro.cache.set(cacheHint). - Taxonomy names in queries match the seed's
"name"exactly ("tag", not"tags"). npx emdash typesregeneratesemdash-env.d.tsfrom a running site (the dev server also regenerates it on start).
The EmDash docs are an MCP server at https://docs.emdashcms.com/mcp (wired up in .mcp.json, .cursor/mcp.json, .vscode/mcp.json). Check them rather than recalling APIs from memory.
Deploying
pnpm wrangler login
pnpm deploy
The first deploy provisions the D1 database and R2 bucket named in wrangler.jsonc. See Deploy to Cloudflare.
Other workerd hosts are untested: the site uses D1 and R2 through @emdash-cms/cloudflare and the Cloudflare adapter (locally, miniflare stands in for both), so a host has to supply those two bindings.
For agents
AGENTS.md is a symlink to this file. capsite's working rules apply here too (the dev server is the user's to start and stop). EmDash skills are in .agents/skills/: building-emdash-site (start here), creating-plugins, emdash-cli.