diff --git a/lib/controllers/reader.js b/lib/controllers/reader.js index 4cc1b7b..dcd8bef 100644 --- a/lib/controllers/reader.js +++ b/lib/controllers/reader.js @@ -35,6 +35,7 @@ import { validateExcludeTypes, validateExcludeRegex, } from "../utils/validation.js"; +import { proxyItemImages } from "../media/proxy.js"; /** * Reader index - redirect to channels @@ -119,6 +120,14 @@ export async function channel(request, response) { showRead: showReadItems, }); + // Proxy images through media endpoint for privacy + const proxyBaseUrl = application.url; + if (proxyBaseUrl && timeline.items) { + timeline.items = timeline.items.map((item) => + proxyItemImages(item, proxyBaseUrl), + ); + } + // Count read items to show "View read items" button const readCount = await countReadItems( application, diff --git a/package.json b/package.json index 1dfd9b7..76f935d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-microsub", - "version": "1.0.36", + "version": "1.0.37", "description": "Microsub endpoint for Indiekit. Enables subscribing to feeds and reading content using the Microsub protocol.", "keywords": [ "indiekit", diff --git a/views/actor.njk b/views/actor.njk index bbb6a2e..3b2c761 100644 --- a/views/actor.njk +++ b/views/actor.njk @@ -121,8 +121,10 @@ {# Tags #} {% if item.category and item.category.length > 0 %}
- {% for cat in item.category | slice(0, 5) %} + {% for cat in item.category %} + {% if loop.index0 < 5 %} #{{ cat }} + {% endif %} {% endfor %}
{% endif %} @@ -131,9 +133,11 @@ {% if item.photo and item.photo.length > 0 %} {% set photoCount = item.photo.length if item.photo.length <= 4 else 4 %}
- {% for photo in item.photo | slice(0, 4) %} + {% for photo in item.photo %} + {% if loop.index0 < 4 %} + {% endif %} {% endfor %}
{% endif %} diff --git a/views/partials/item-card.njk b/views/partials/item-card.njk index a529c27..77a81e6 100644 --- a/views/partials/item-card.njk +++ b/views/partials/item-card.njk @@ -111,8 +111,10 @@ {# Categories/Tags #} {% if item.category and item.category.length > 0 %}
- {% for cat in item.category | slice(0, 5) %} + {% for cat in item.category %} + {% if loop.index0 < 5 %} #{{ cat | replace("#", "") }} + {% endif %} {% endfor %}
{% endif %} @@ -121,12 +123,14 @@ {% if item.photo and item.photo.length > 0 %} {% set photoCount = item.photo.length if item.photo.length <= 4 else 4 %}
- {% for photo in item.photo | slice(0, 4) %} + {% for photo in item.photo %} + {% if loop.index0 < 4 %} + {% endif %} {% endfor %}
{% endif %}