diff --git a/assets/reader.css b/assets/reader.css index 47bf9f7..04e685d 100644 --- a/assets/reader.css +++ b/assets/reader.css @@ -1281,6 +1281,45 @@ .ap-my-profile__bio .invisible { display: none; } .ap-my-profile__bio .ellipsis::after { content: "…"; } +.ap-my-profile__fields { + border: var(--border-width-thin) solid var(--color-outline); + border-radius: var(--border-radius-small); + margin: var(--space-s) 0; + overflow: hidden; +} + +.ap-my-profile__field { + border-bottom: var(--border-width-thin) solid var(--color-outline); + display: grid; + grid-template-columns: 120px 1fr; +} + +.ap-my-profile__field:last-child { + border-bottom: 0; +} + +.ap-my-profile__field-name { + background: var(--color-offset); + color: var(--color-on-offset); + font-size: var(--font-size-s); + font-weight: 600; + padding: var(--space-xs) var(--space-s); + text-transform: uppercase; + letter-spacing: 0.03em; +} + +.ap-my-profile__field-value { + font-size: var(--font-size-s); + overflow: hidden; + padding: var(--space-xs) var(--space-s); + text-overflow: ellipsis; + white-space: nowrap; +} + +.ap-my-profile__field-value a { + color: var(--color-primary); +} + .ap-my-profile__stats { display: flex; gap: var(--space-m); diff --git a/lib/federation-bridge.js b/lib/federation-bridge.js index a1f01d8..9e7466c 100644 --- a/lib/federation-bridge.js +++ b/lib/federation-bridge.js @@ -89,6 +89,14 @@ async function sendFedifyResponse(res, response, request) { if (json.endpoints?.type) { delete json.endpoints.type; } + // WORKAROUND: Fedify's JSON-LD compaction collapses single-element + // arrays to a plain object. Mastodon's update_account_fields checks + // `attachment.is_a?(Array)` and skips if it's not an array, so + // profile links/PropertyValues are silently ignored. + // Force `attachment` to always be an array for Mastodon compatibility. + if (json.attachment && !Array.isArray(json.attachment)) { + json.attachment = [json.attachment]; + } const patched = JSON.stringify(json); res.setHeader("content-length", Buffer.byteLength(patched)); res.end(patched); diff --git a/package.json b/package.json index 2161e71..779baca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.0.20", + "version": "2.0.21", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit", diff --git a/views/activitypub-my-profile.njk b/views/activitypub-my-profile.njk index 4a27290..ca8cae5 100644 --- a/views/activitypub-my-profile.njk +++ b/views/activitypub-my-profile.njk @@ -26,6 +26,23 @@ {% if profile.summary %}
{{ profile.summary | safe }}
{% endif %} + + {% if profile.attachments and profile.attachments.length > 0 %} +
+ {% for field in profile.attachments %} +
+
{{ field.name }}
+
+ {% if field.value and (field.value.startsWith("http://") or field.value.startsWith("https://")) %} + {{ field.value | replace("https://", "") | replace("http://", "") }} + {% else %} + {{ field.value }} + {% endif %} +
+
+ {% endfor %} +
+ {% endif %}
diff --git a/views/activitypub-public-profile.njk b/views/activitypub-public-profile.njk index 88263a9..490a63f 100644 --- a/views/activitypub-public-profile.njk +++ b/views/activitypub-public-profile.njk @@ -480,7 +480,7 @@
{{ field.name }}
{% if field.value and (field.value.startsWith("http://") or field.value.startsWith("https://")) %} - {{ field.value | replace("https://", "") | replace("http://", "") }} + {{ field.value | replace("https://", "") | replace("http://", "") }} {% else %} {{ field.value }} {% endif %}