Standard.site for Eleventy: Publish Your Blog to AT Protocol

Standard.site publishes a blog's posts as records on the AT Protocol. For Eleventy, you verify your domain as your handle, create the records (with a script or the Sequoia CLI), and add link tags in the page head.

By
Brennan Kenneth Brown
Published
Updated
Reading time
10 minutes
Level
Advanced
You need
  • An Eleventy blog
  • A Bluesky or AT Protocol account
  • Node.js
Earth's atmosphere seen from orbit
A view of the launch of Space Shuttle Atlantis on mission STS-115 as it soars over the Space Coast, taken from NASA's WB-57 aircraft.' | Rawpixel (edited by the Author)

Standard.site is a shared set of AT Protocol lexicons that lets a blog publish its posts as records on the AT Protocol, the open network underneath Bluesky. This guide covers how I added Standard.site to my Eleventy blog: verifying my domain as my handle, publishing records with a custom script, adding the link tags in Nunjucks, and moving to Sequoia for ongoing publishing.

If you want the shortest path, do Step 1, skip Step 2, and use Sequoia in Step 4. Step 2 is kept as documentation of what Sequoia does for you.

What do I need to know about the AT Protocol first?

AT Protocol stands for Authenticated Transfer Protocol. It is not the same thing as Bluesky: Bluesky is the first and biggest app built on it. Per the official protocol overview, it is a decentralized protocol for building large-scale social apps, and the ecosystem around it is nicknamed the ATmosphere.

Glossary

  • Lexicon: A contract for a data type, spelling out what fields a given kind of record must have, written in JSON. A Bluesky post is the app.bsky.feed.post lexicon, for example.
  • DID (Decentralized Identifier): a permanent string like did:plc:h4fm3emeptzegfs452eoiaz7 that identifies you underneath everything else. It never changes, even if your handle or host does.
  • Handle: the human-friendly name for your DID. If you own a domain, your handle can be that domain (see Step 1).
  • PDS (Personal Data Server): where your data lives, as a signed repository of records. The protocol docs describe it as "your home in the cloud". You can run your own or use someone else's, and move between them.
  • Repo: your PDS stores what you publish in a structure that behaves much like a Git repository. Researchers involved with the protocol have written up the comparison.
  • Relay / Firehose: a relay collects every account's updates across the network and rebroadcasts them as one real-time stream, the "firehose." Indexes and apps use it to stay current without polling every PDS.
  • AppView: the layer that turns raw firehose data into an app you would recognize. Bluesky is one AppView; others can be built on the same data.
  • XRPC: the HTTP API used to talk to a PDS: log in, create a record, fetch a record. You will use it in Step 2.

Because your identity and data are not tied to one app, a blog post can be a record on this network too, and not only something Bluesky links to. If Bluesky disappeared, your DID, PDS and repo would still exist.

Why use Standard.site for a personal blog?

AT Protocol uses lexicons, typed schemas that define what each record looks like:

  • A Bluesky post is an app.bsky.feed.post record.
  • A follow is an app.bsky.graph.follow record.

The protocol had no lexicon for a long-form essay. Standard.site fills that gap. Leaflet, pckt.blog and Offprint agreed on a shared schema rather than each inventing their own. The result is site.standard.publication and site.standard.document, two lexicons describing a blog and its posts in a form that other ATmosphere apps can read, index and carry between platforms.

The other piece is handle-based identity. Serving your DID at /.well-known/atproto-did means your domain is your identity, so my at:// URIs resolve to brennan.day instead of a platform identifier. If Bluesky ceased to exist, the records and the identity would remain under my control.

What are the two Standard.site records?

Every Standard.site integration creates two types of records on your Personal Data Server (PDS):

  • site.standard.publication: Created once for the whole blog. Contains the URL, name, description, and an optional icon. This is the feed-level record.
  • site.standard.document: Created once per post. Contains the title, path, description, tags, publish date, and an optional plain-text body. Points back at the publication via its AT-URI.

Verification links these records to your domain. The publication is verified by a /.well-known/site.standard.publication file containing its AT-URI. Each document is verified by a <link> tag in the post's <head>:

<link rel="site.standard.publication" href="at://brennan.day/site.standard.publication/self">
<link rel="site.standard.document" href="at://brennan.day/site.standard.document/3mpwdqt4xn42j">

Aggregators and indexers can see your records but can't confirm they belong to your domain without these verification links.

Step 1: How do I verify my domain as my AT Protocol handle?

Before creating the publication records, I needed my domain to be my AT Protocol identity. Bluesky's handle verification uses a /.well-known/atproto-did file served from your domain containing just your DID.

For an Eleventy site, you just need to create src/.well-known/atproto-did with a single line:

did:plc:h4fm3emeptzegfs452eoiaz7

Eleventy's .eleventy.js needs a passthrough copy rule:

eleventyConfig.addPassthroughCopy("src/.well-known");

Once the site is deployed, you confirm the handle in the Bluesky settings under "Change Handle → I have my own domain". Bluesky fetches https://yourdomain.tld/.well-known/atproto-did, finds your DID, and updates your handle on the network. After that, your AT-URIs read as at://yourdomain.tld/... instead of at://did:plc:.../... which is great for readability.

Step 2: Write a custom publish script (optional)

Before setting up Sequoia, I wrote scripts/standard-site-publish.js to publish manually. You can skip this step if you use Sequoia; it is included to show what the XRPC calls look like.

The pattern for AT Protocol interaction is: authenticate, get a session token, then upsert records via XRPC.

Authentication uses com.atproto.server.createSession with a handle and app password (never your main password):

async function authenticate(identifier, password) {
  const res = await fetch(`${PDS_URL}/xrpc/com.atproto.server.createSession`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ identifier, password }),
  });
  const data = await res.json();
  return { token: data.accessJwt, did: data.did };
}

Creating a record is a com.atproto.repo.putRecord call with the collection name and a record key (rkey). I used self as the rkey for the singleton publication record and a TID for each document:

async function putRecord(token, did, collection, rkey, record) {
  const res = await fetch(`${PDS_URL}/xrpc/com.atproto.repo.putRecord`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${token}`,
    },
    body: JSON.stringify({ repo: did, collection, rkey, record }),
  });
  return res.json();
}

The document record for a post pulls from the frontmatter. The minimum required fields are $type, site (the publication AT-URI), title, and publishedAt:

const record = {
  $type: 'site.standard.document',
  site: publicationUri,
  title,
  path: `/${slugify(title)}/`,
  publishedAt: new Date(date).toISOString(),
  description,
  tags: tags.slice(0, 10),
  textContent: markdownBody.slice(0, 10000),
};

After creation, the script writes the returned AT-URI back to the post's frontmatter as atUri. This value populates the <link> tag at build time.

I also wrote a small helper to convert the DID-based AT-URI the PDS returns (at://did:plc:.../...) into a handle-based one (at://brennan.day/...) before writing to frontmatter:

function toHandleUri(uri, handle) {
  return uri.replace(/^at:\/\/did:[^/]+/, `at://${handle}`);
}

Both forms resolve identically; the handle-based form is simply more readable in the HTML source.

Once atUri is in frontmatter, the template work is minimal. In src/_includes/partials/meta.njk:

{# Standard.site AT Protocol integration | https://standard.site #}
{% if atUri %}
  <link rel="site.standard.document" href="{{ atUri }}">
{% endif %}
{% if site.atproto.publicationUri %}
  <link rel="site.standard.publication" href="{{ site.atproto.publicationUri }}">
{% endif %}

The publication link appears on every page. The document link appears on any post that has an atUri in its YAML frontmatter, which the publishing script adds.

The publication URI lives in src/_data/site.json so it's globally accessible to every template:

"atproto": {
  "publicationUri": "at://brennan.day/site.standard.publication/self",
  "did": "did:plc:h4fm3emeptzegfs452eoiaz7",
  "icon": "/assets/images/favicon/apple-touch-icon.png",
  "basicTheme": {
    "background": "#ffffff",
    "foreground": "#1a1a1a",
    "accent": "#8a1814",
    "accentForeground": "#ffffff"
  },
  "preferences": {
    "showInDiscover": true
  }
}

The optional fields (icon, basicTheme, preferences) are used by Standard.site-compatible apps and aggregators when displaying your publication. The basicTheme colors help readers see your content in a way that matches your site's visual identity.

Step 4: Publish with Sequoia

Sequoia is a purpose-built CLI for this kind of workflow. Once I learned it existed (thanks to Kat), I migrated to it for ongoing publishing. It's framework-agnostic, reads standard frontmatter fields, and maintains a .sequoia-state.json file for change detection via content hashing.

The config lives in sequoia.json at the project root. The key settings for an Eleventy blog with title-based slugs and no path prefix:

{
  "$schema": "https://tangled.org/stevedylan.dev/sequoia/raw/main/sequoia.schema.json",
  "contentDir": "src/posts",
  "publicationUri": "at://did:plc:h4fm3emeptzegfs452eoiaz7/site.standard.publication/self",
  "siteUrl": "https://brennan.day",
  "publicDir": "src",
  "outputDir": "_site",
  "pathPrefix": "",
  "frontmatter": {
    "publishDate": "date",
    "slugField": "title",
    "updatedAt": "updated",
    "coverImage": "featured_image",
    "tags": "tags",
    "description": "description",
    "textContent": "textContent",
    "bskyPostRef": "bskyPostRef",
    "contributors": "contributors",
    "labels": "labels"
  },
  "identity": "brennan.day",
  "autoSync": true,
  "ignore": ["posts.json"]
}

A few things to note:

  • slugField: "title" tells Sequoia to derive post paths from the title frontmatter field rather than the filename. This matches Eleventy's | slugify permalink behaviour.
  • frontmatter mappings connect your existing frontmatter fields to Standard.site document fields. For example, featured_image maps to coverImage, and updated maps to updatedAt. This lets you keep your existing field names while publishing valid Standard.site records.
  • publicDir: "src" so the /.well-known/site.standard.publication file is written to src/.well-known/, which Eleventy's passthrough copy then includes in the build output.
  • autoSync: true means Sequoia fetches your existing PDS records and reconciles them with local files before publishing, preventing duplicates on fresh clones or CI builds.
  • ignore: ["posts.json"] skips the Eleventy data cascade file that lives in src/posts/.

Since I had 220 posts with records already created by the custom script, I wrote a one-time state builder script that reads each post's atUri frontmatter and computes its SHA-256 content hash, generating .sequoia-state.json in Sequoia's format. With the state file in place, sequoia publish --dry-run correctly reported all posts as up-to-date, rather than trying to create 220 duplicate records.

Sequoia stores credentials via sequoia auth (app password) for local use, and reads ATP_IDENTIFIER / ATP_APP_PASSWORD environment variables in CI, which are the same names I was already using. The package.json scripts became:

"standard-site:publish": "sequoia publish",
"standard-site:dry-run": "sequoia publish --dry-run",
"standard-site:inject": "sequoia inject",
"standard-site:sync": "sequoia sync --update-frontmatter"

The workflow for a new post is:

write → `npm run standard-site:publish` → commit the updated frontmatter and state file → push.

Sequoia adds the atUri to the post's frontmatter automatically after creating the record, so the <link> tag is present the moment the site builds.

Step 5: How do I handle cover images over the 1MB limit?

The AT Protocol has a 1MB size limit for blob uploads, so cover images must be compressed before they can be uploaded as part of Standard.site documents. Many of my site images exceed this limit, so I created a compression workflow.

The solution is to add a new frontmatter field atproto_image that points to compressed versions, while keeping featured_image for the full-quality site images.

First, I wrote scripts/compress-atproto-images.js which:

  1. Scans all blog posts for featured_image paths
  2. Compresses images to under 900KB (safely under the 1MB limit)
  3. Converts PNG to WebP, JPEG to JPEG with quality 75%
  4. Resizes if over 1920px width/height
  5. Saves compressed versions to src/assets/images/atproto/
  6. Adds atproto_image field to each post's frontmatter pointing to the compressed version

The script uses sharp for image processing:

const sharp = require('sharp');

async function compressImage(sourcePath, outputPath) {
  let image = sharp(inputPath);
  const metadata = await image.metadata();

  // Resize if too large
  if (metadata.width > 1920 || metadata.height > 1920) {
    image = image.resize(1920, 1920, {
      fit: 'inside',
      withoutEnlargement: true
    });
  }

  // Convert to WebP or JPEG with compression
  if (outputExt === '.webp') {
    image = image.webp({ quality: 75 });
  } else {
    image = image.jpeg({ quality: 75 });
  }

  await image.toFile(outputPathFull);
}

Then I updated sequoia.json to use the new atproto_image field:

{
  "imagesDir": "src/assets/images/atproto",
  "frontmatter": {
    "coverImage": "atproto_image"
  }
}

The blog post frontmatter now has both fields:

featured_image: /assets/images/blog/squeeze.jpg
atproto_image: assets/images/atproto/squeeze.jpg

The workflow is now:

write → node scripts/compress-atproto-images.js → npm run standard-site:publish → commit

I still have full-quality images on my site, and new compressed versions uploaded as blobs to the AT Protocol for rich previews in Bluesky and other ATmosphere apps.

What I'd Do Differently

The custom script I created was a good learning exercise in understanding the XRPC calls, how putRecord works, and how TIDs are generated. But I would skip straight to using Sequoia, since it handles all of this and more.

Also, stick with TID-based rkeys for site.standard.document. The site.standard.document lexicon currently specifies key: "tid", which means the record key must be a valid Timestamp Identifier (TID) such as 3mpwdqt4xn42j. A slug-based rkey like why-start-again would make the AT-URI a pure function of the post slug, but that is not valid under the current lexicon. Some PDSes and validators may accept it anyway, but strict lexicon validation will reject it and it may cause interop problems with aggregators.

The idiomatic approach is to let the PDS generate a TID for each document (via com.atproto.repo.createRecord) and write the returned atUri back to the post's frontmatter. To re-run publishing without creating duplicates, use a state file like Sequoia's .sequoia-state.json or check the frontmatter for an existing atUri before creating a new record. There is an ongoing discussion in the Standard.site lexicons repo about whether the rkey type could be relaxed to any in the future, but until the lexicon is officially changed, use TIDs.

How do I check that Standard.site is working?

You can verify any Standard.site-compatible blog by fetching its .well-known endpoint and checking the <link> tags in the HTML:

# Publication verification
curl https://brennan.day/.well-known/site.standard.publication

# Document verification (check <head> for the link tag)
curl -s https://brennan.day/a-case-for-the-ethical-treatment-of-generative-ai/ \
  | grep "site.standard"

You can also browse records directly at pdsls.dev (Kat pointed me to this), a handy AT Protocol record explorer that requires no account to use.

Troubleshooting

I ran into a few issues during setup:

As noted in Step 5, the AT Protocol has a 1MB limit for blob uploads. My compression script targets 900KB to stay safely under this limit, but some images still exceeded it. I had to manually recompress the offending image with more aggressive settings (quality 50 instead of 75).

My custom publish script checked for atproto_uri in frontmatter to skip already-published posts, but I was using atUri instead. This caused the script to add duplicate atUri lines to all posts. I fixed this by updating the script to check for atUri instead.

Even with the verification files in place, my posts weren't showing up on Leaflet or pckt.blog because the actual records didn't exist on the PDS. The publication and document records need to be created via XRPC calls; the verification files alone aren't enough. Once I ran sequoia publish successfully, the records were created and the aggregators could find them.

When debugging, I initially queried api.bsky.app which returned RecordNotFound errors. The correct endpoint for direct PDS queries is https://bsky.social/xrpc/ (or your custom PDS URL).

Summary

With Standard.site, your posts stay on your domain and are also records on an open network that any client can read. The setup comes down to two records and two verification links. The publish script, Nunjucks partials, state builder and Sequoia config are all available in the site's source on GitLab.