Skip to content

Commit e124e66

Browse files
bexelbieCopilot
andauthored
Add fediverse:creator meta tag for link preview attribution (#5445)
Emit <meta name="fediverse:creator"> when author.fediverse is set, enabling "by @user@instance" attribution on Mastodon, Pixelfed, Flipboard, and other fediverse platforms. Follows the same pattern as the existing twitter:creator support. The value is read from the resolved author object, so it works with both site.author in _config.yml and per-page overrides via _data/authors.yml. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2fdf34a commit e124e66

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ author:
119119
bio : "I am an **amazing** person."
120120
location : "Somewhere"
121121
email :
122+
# fediverse : "@you@instance.social" # used for fediverse:creator meta tag
122123
links:
123124
- label: "Email"
124125
icon: "fas fa-fw fa-square-envelope"

_includes/seo.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@
9696
{% endif %}
9797
{% endif %}
9898

99+
{% if author.fediverse %}
100+
<meta name="fediverse:creator" content="{{ author.fediverse }}">
101+
{% endif %}
102+
99103
{% if page.date %}
100104
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
101105
{% endif %}

docs/_docs/05-configuration.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,18 @@ And if I assign `@mmistakes` as an author account it will appear in the Twitter
798798
**Note**: You need to validate cards are working and have Twitter [approve Player Cards](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/player-card) before they begin showing up.
799799
{: .notice--warning}
800800

801+
##### Fediverse creator
802+
803+
If the site author (or a per-page author override) has a `fediverse` value set, a `<meta name="fediverse:creator">` tag is emitted. This enables "by @user@instance" attribution on Mastodon, Pixelfed, Flipboard, and other fediverse platforms — the same role `twitter:creator` plays for Twitter Cards.
804+
805+
The value is set in the `author` block of `_config.yml` (or in `_data/authors.yml` for multi-author sites):
806+
807+
```yaml
808+
author:
809+
name: "Your Name"
810+
fediverse: "@you@instance.social"
811+
```
812+
801813
##### Facebook Open Graph
802814

803815
If you have a Facebook ID or publisher page add them:
@@ -916,6 +928,7 @@ author:
916928
avatar : "/assets/images/bio-photo.jpg"
917929
bio : "My awesome biography constrained to a sentence or two goes here."
918930
location : "Somewhere, USA"
931+
fediverse: "@you@instance.social"
919932
```
920933

921934
Author links are all optional, include the ones you want visible under the `author.links` array.

docs/_docs/09-authors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Billy Rick:
1818
name : "Billy Rick"
1919
bio : "What do you want, jewels? I am a very extravagant man."
2020
avatar : "/assets/images/bio-photo-2.jpg"
21+
fediverse : "@billyrick@instance.social"
2122
links:
2223
- label: "Email"
2324
icon: "fas fa-fw fa-square-envelope"

0 commit comments

Comments
 (0)