mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
fix: ensure attachment is always an array for Mastodon compatibility
Fedify's JSON-LD compaction collapses single-element arrays to plain objects. Mastodon checks `attachment.is_a?(Array)` and silently skips non-array values, causing profile links to never display. Also adds profile links section to the my-profile admin page and fixes rel=me on the public profile page for bidirectional verification.
This commit is contained in:
@@ -26,6 +26,23 @@
|
||||
{% if profile.summary %}
|
||||
<div class="ap-my-profile__bio">{{ profile.summary | safe }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if profile.attachments and profile.attachments.length > 0 %}
|
||||
<dl class="ap-my-profile__fields">
|
||||
{% for field in profile.attachments %}
|
||||
<div class="ap-my-profile__field">
|
||||
<dt class="ap-my-profile__field-name">{{ field.name }}</dt>
|
||||
<dd class="ap-my-profile__field-value">
|
||||
{% if field.value and (field.value.startsWith("http://") or field.value.startsWith("https://")) %}
|
||||
<a href="{{ field.value }}" rel="me noopener" target="_blank">{{ field.value | replace("https://", "") | replace("http://", "") }}</a>
|
||||
{% else %}
|
||||
{{ field.value }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="ap-my-profile__stats">
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
<dt class="ap-pub__field-name">{{ field.name }}</dt>
|
||||
<dd class="ap-pub__field-value">
|
||||
{% if field.value and (field.value.startsWith("http://") or field.value.startsWith("https://")) %}
|
||||
<a href="{{ field.value }}" rel="noopener nofollow" target="_blank">{{ field.value | replace("https://", "") | replace("http://", "") }}</a>
|
||||
<a href="{{ field.value }}" rel="me noopener" target="_blank">{{ field.value | replace("https://", "") | replace("http://", "") }}</a>
|
||||
{% else %}
|
||||
{{ field.value }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user