fix: normalize category to array in my-profile controller

When a post has a single category, Indiekit stores it as a string
(e.g. "Fraude") rather than an array. Nunjucks iterates strings
character by character, producing hashtag pills like #F #r #a #u #d #e.
This commit is contained in:
Ricardo
2026-02-28 18:21:32 +01:00
parent ecba2b5748
commit 5c2fd09f8f
3 changed files with 8 additions and 4 deletions

View File

@@ -38,7 +38,11 @@ function postToCardItem(post, profile) {
photo: profile?.icon || "",
},
photo,
category: props.category || [],
category: Array.isArray(props.category)
? props.category
: props.category
? [props.category]
: [],
};
}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@rmdes/indiekit-endpoint-activitypub",
"version": "2.1.1",
"version": "2.1.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@rmdes/indiekit-endpoint-activitypub",
"version": "2.1.1",
"version": "2.1.2",
"license": "MIT",
"dependencies": {
"@fedify/debugger": "^2.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@rmdes/indiekit-endpoint-activitypub",
"version": "2.1.1",
"version": "2.1.2",
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
"keywords": [
"indiekit",