Three changes from an author field
Leto website · · 中文 · 日本語

Three changes from an author field

The author name and its fingerprint used to be hard-coded in SITE.author and SITE.authorId in src/content.js, written once per language.

Every post showed the same author, followed by a fixed fingerprint.

author became a frontmatter field: omit it and the blogger stands, name someone else's id and that person does. Name, role and avatar are all looked up by id in AUTHORS (src/content.js).

An unknown id, a missing picture, a picture of the wrong size or one with see-through pixels fails the build and names the person (tools/build-site.js:112 and checkAvatars); it never falls back to the blogger or to a block.

The avatar seed must not change. An avatar has two possible renderings: the person's picture when there is one, and a 5×5 block drawn from the seed otherwise (tools/build-site.js:290, avatarFor).

The seed is fixed by id and does not vary with language — one person is three names across three languages, and seeding on the name would give them three different faces.

All twelve authors, the blogger included, have pictures today, so the fallback path is unreachable.

Change the seed and rebuild, and the output is byte for byte identical, so a diff review cannot catch a seed edit either. What the fixed seed buys shows up only when someone's picture is removed: the fallback block is then still the same one.

The site icons have nothing to do with the seed. favicon.svg and apple-touch-icon.png are standalone static files, copied as they are at build time (tools/build-site.js:963), generated from no seed.

A comment in src/content.js once claimed the icon was still drawn from the identicon; it disagreed with the code and has been corrected (ae4645d).

A missing language means something else now. Under the old rule, "this post has no English body" was the same as "this post is absent from the English site". A missing language is now filled in zh → en → ja, field by field, with title, summary and body each decided on its own.

Only the content is filled; interface copy is still maintained per language, and the lang of a text block follows the copy actually used.

The block is no longer one person's mark. The 5×5 block was designed for a single author; shared by everyone, it became the same shape in a row. Each person now has a picture, and the block is back to being a fallback.