feat: add fediverse_creator handle for Mastodon attribution
Expose a per-post fediverse_creator frontmatter field plus a site-wide default in config.toml ([site].fediverse_creator). The handle is returned in the post and site payloads, rendered as <dc:creator> in the RSS feed and as authors[].name in the JSON feed, so a front-end can drop it into <meta name="fediverse:creator"> on rendered pages. Per-post value overrides the site default. Validated against a simple @user@host regex. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -88,6 +88,7 @@ slug = "my-post" # optional, defaults to the filename
|
||||
date = 2026-01-15 # first-class TOML date
|
||||
lang = "en" # language code
|
||||
author = "Petr Balvín" # optional
|
||||
fediverse_creator = "@petrbalvin@mastodon.social" # optional, for Mastodon attribution
|
||||
tags = ["ruby", "web"] # optional
|
||||
draft = false # optional
|
||||
excerpt = "Short summary" # optional, auto-derived from body if missing
|
||||
@@ -113,6 +114,21 @@ front-end can offer a language switcher.
|
||||
Set `all_langs = true` on a post to show it in **every** language (useful for
|
||||
posts that have no per-language translations).
|
||||
|
||||
### Fediverse attribution
|
||||
|
||||
Set `fediverse_creator = "@user@instance.tld"` on a post to attach a Mastodon
|
||||
handle to it. The value is exposed as `fediverse_creator` on the post payload
|
||||
(`/api/volumen/posts/{slug}` and `/api/volumen/posts`), and as `<dc:creator>` in
|
||||
the RSS feed and `authors[].name` in the JSON feed. A front-end consuming the
|
||||
API can drop it straight into `<head>`:
|
||||
|
||||
```html
|
||||
<meta name="fediverse:creator" content="@petrbalvin@mastodon.social">
|
||||
```
|
||||
|
||||
A site-wide default can be set in `config.toml` (`[site].fediverse_creator`); a
|
||||
per-post value takes precedence.
|
||||
|
||||
### Why TOML instead of YAML
|
||||
|
||||
- **First-class dates** — `date = 2026-01-15` is a real date, not a guess.
|
||||
|
||||
Reference in New Issue
Block a user