Public
Markdown blog with a FastComments thread under every post
blogcommentsfastcommentstemplate
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Blog with comments

A Markdown blog with a FastComments thread under every post and a comment count next to every row on the index. Remix it and you have a working commented blog on a live URL, with no signup and no backend to run.

Built on Val Town's blog template.

Remix, then make it yours

Comments post into the shared demo tenant until you say otherwise, which is why this works immediately. Everyone running the demo writes into the same threads, so switch before you publish anything real:

  1. Get a tenant ID at fastcomments.com. Free 30 day trial, then plans from $0.99/mo.
  2. 👉 Add FASTCOMMENTS_TENANT_ID here: https://www.val.town/x/fastcomments/blog-with-comments/environment-variables?key=FASTCOMMENTS_TENANT_ID
  3. Add your val's domain to the account's allowed domains. A new account with no configured domains refuses to load the widget.

Accounts created on eu.fastcomments.com also need FASTCOMMENTS_REGION set to eu.

Write posts as Markdown files in posts/. The filename is the slug.

How the comments are wired

FileWhat it does
config.tsTenant ID, region, CDN host, and threadId()
components/Comments.tsxThe widget under each post, plus the no-JavaScript fallback
components/Home.tsxCount markers per row and one bulk count request for the page

urlId is the thing to get right. It decides which thread a comment lands in. Left unset it defaults to a cleaned version of the page URL, so a trailing slash, a preview deploy, or a renamed post each silently start a separate empty thread. Here it is keyed to the post slug, which survives all of that.

While the tenant is demo, threadId() prefixes the slug with valtown-blog- so this demo does not collide with every other demo user. Set your own tenant and the prefix disappears.

Counts are one request, not one per row. Home.tsx marks each row with class="fast-comments-count" data-fast-comments-url-id="..." and loads the bulk count widget once. A per-row count widget would be one request per post.

No API key anywhere. A tenant ID is public and belongs in browser code. An API key does not, and nothing here needs one. You would only need one to log your own readers in with Secure SSO.

Teaching your agent the rest

val.town/x/fastcomments/skills is a remixable library of FastComments agent skills covering SSO, the REST API, moderation, and migrating off Disqus. Townie and the Val Town MCP server pick them up automatically once the remix is in your account.

Routes

RoutePurpose
/Post index with comment counts
/:slugA post and its thread
/styles.cssStyles
/sourceRedirects to this val's source