mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
Reader now resolves ActivityPub links internally instead of navigating to external instances. Actor links open the profile view, post links open a new post detail view with thread context (parent chain + replies). External links in post content get rich preview cards (title, description, image, favicon) fetched via unfurl.js at ingest time with fire-and-forget async processing and concurrency limiting. New files: post-detail controller, og-unfurl module, lookup-cache, link preview template/CSS, client-side link interception JS. Includes SSRF protection for OG fetching and GoToSocial URL support.
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
{# Link preview cards for external links (OpenGraph) #}
|
|
{% if item.linkPreviews and item.linkPreviews.length > 0 %}
|
|
<div class="ap-link-previews">
|
|
{% for preview in item.linkPreviews %}
|
|
<a href="{{ preview.url }}"
|
|
rel="noopener"
|
|
target="_blank"
|
|
class="ap-link-preview"
|
|
aria-label="{{ __('activitypub.reader.linkPreview.label') }}: {{ preview.title }}">
|
|
|
|
<div class="ap-link-preview__text">
|
|
<p class="ap-link-preview__title">{{ preview.title }}</p>
|
|
|
|
{% if preview.description %}
|
|
<p class="ap-link-preview__desc">{{ preview.description }}</p>
|
|
{% endif %}
|
|
|
|
<p class="ap-link-preview__domain">
|
|
{% if preview.favicon %}
|
|
<img src="{{ preview.favicon }}" alt="" class="ap-link-preview__favicon" loading="lazy" />
|
|
{% endif %}
|
|
{{ preview.domain }}
|
|
</p>
|
|
</div>
|
|
|
|
{% if preview.image %}
|
|
<div class="ap-link-preview__image">
|
|
<img src="{{ preview.image }}" alt="" loading="lazy" decoding="async" />
|
|
</div>
|
|
{% endif %}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|