Hashtags/Tags are not serialized into the ActivityPub JSON 'tag' array

Issue Summary

Hashtags applied to a Ghost post are not being serialized into the mandatory ActivityPub JSON tag array when the post object is fetched, despite the overall ActivityPub integration being functional. This results in tags not appearing or being clickable on Fediverse platforms like Mastodon.

What did you expect to happen?

When a remote Fediverse server fetches the post’s ActivityPub Object ID (Article/Note), the resulting JSON should contain the tags in the required tag array, structured like:

"tag": [
  {
    "type": "Hashtag",
    "href": "https://sgenov.com/tag/example/",
    "name": "#example"
  }
]

Instead, the tag array is entirely missing from the JSON object.

Steps to Reproduce

  1. Ensure Ghost ActivityPub Service is running and configured (Webfinger/Actor endpoints working).

  2. Create a new post in the Ghost Admin.

  3. Add a tag (e.g., selfhosting) to the post’s dedicated Tags Field in the settings sidebar.

  4. Publish or Re-publish the post to trigger the webhook.

  5. Fetch the post’s ActivityPub Object ID JSON (e.g., at https://yourdomain.com/.ghost/activitypub/article/{post_id}) via cURL or a browser.

  6. Observe: The resulting JSON object is missing the tag array.

Setup Information

Field Detail
Ghost Version 6.9.3
How did you install Ghost? Self-hosted using Docker (ghost container and separate activitypub-sgenov container). Caddy is used as the reverse proxy.
Host & Operating System Docker running on Linux (e.g., Ubuntu, Debian, Proxmox VM/LXC)
Database type MySQL (Shared between Ghost and ActivityPub services)
Browser & OS version N/A (Backend serialization bug)

Relevant Log / Error Output

Evidence of Serialization Success (200 OK) but Data Failure:

The logs confirm the ActivityPub service successfully stores the clean Object ID URL and sends a 200 OK response upon fetch, but the data is incorrect.

20:42:52.487 INF activitypub: KnexKvStore: Set key https://sgenov.com/.ghost/activitypub/article/9e9f497a-0e0f-4af6-a6ec-b5559573603e
20:42:52.594 INF activitypub: 'POST' 'sgenov.com' 'https://sgenov.com/.ghost/activitypub/v1/webhooks/post/published' 'ab8464bc-5bfd-4936-b449-d9b3f6cd794c' 200 150ms

Evidence of Missing Tag Array (The JSON Output):

When fetching the Object ID, the JSON is returned but lacks the necessary tag property.

Example of the missing section (as seen in the valid JSON):

{
    "cc":"https://sgenov.com/.ghost/activitypub/followers/index",
    "id":"https://sgenov.com/.ghost/activitypub/article/9e9f497a-0e0f-4af6-a6ec-b5559573603e",
    "to":"as:Public",
    "url":"https://sgenov.com/my-self-hosting-server-hp-elitedesk-805-g6/",
    // ... [Other post metadata here] ...
    
    // THIS 'tag' ARRAY IS COMPLETELY MISSING FROM THE OUTPUT JSON
    // "tag": [ ... ], 
    
    "summary":"MY TFF home server is running arr... more. It's my #selfhosting part of the internet",
    // ... [Rest of the JSON] ...
}

Hello @DreamWave, thanks for the detailed report!

We indeed don’t currently have support for converting tags from Ghost posts to tags in ActivityPub, nor do we have support for `#hashtag` in notes. I have added your feature request to our list!

Sag

1 Like

If this were in ideas, I’d vote for it. I can’t give up my #caturday :slight_smile:

1 Like