@rmdes/indiekit-endpoint-microsub 1.0.36 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
validateExcludeTypes,
|
|
36
36
|
validateExcludeRegex,
|
|
37
37
|
} from "../utils/validation.js";
|
|
38
|
+
import { proxyItemImages } from "../media/proxy.js";
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Reader index - redirect to channels
|
|
@@ -119,6 +120,14 @@ export async function channel(request, response) {
|
|
|
119
120
|
showRead: showReadItems,
|
|
120
121
|
});
|
|
121
122
|
|
|
123
|
+
// Proxy images through media endpoint for privacy
|
|
124
|
+
const proxyBaseUrl = application.url;
|
|
125
|
+
if (proxyBaseUrl && timeline.items) {
|
|
126
|
+
timeline.items = timeline.items.map((item) =>
|
|
127
|
+
proxyItemImages(item, proxyBaseUrl),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
122
131
|
// Count read items to show "View read items" button
|
|
123
132
|
const readCount = await countReadItems(
|
|
124
133
|
application,
|
package/package.json
CHANGED
package/views/actor.njk
CHANGED
|
@@ -121,8 +121,10 @@
|
|
|
121
121
|
{# Tags #}
|
|
122
122
|
{% if item.category and item.category.length > 0 %}
|
|
123
123
|
<div class="item-card__categories">
|
|
124
|
-
{% for cat in item.category
|
|
124
|
+
{% for cat in item.category %}
|
|
125
|
+
{% if loop.index0 < 5 %}
|
|
125
126
|
<span class="item-card__category">#{{ cat }}</span>
|
|
127
|
+
{% endif %}
|
|
126
128
|
{% endfor %}
|
|
127
129
|
</div>
|
|
128
130
|
{% endif %}
|
|
@@ -131,9 +133,11 @@
|
|
|
131
133
|
{% if item.photo and item.photo.length > 0 %}
|
|
132
134
|
{% set photoCount = item.photo.length if item.photo.length <= 4 else 4 %}
|
|
133
135
|
<div class="item-card__photos item-card__photos--{{ photoCount }}">
|
|
134
|
-
{% for photo in item.photo
|
|
136
|
+
{% for photo in item.photo %}
|
|
137
|
+
{% if loop.index0 < 4 %}
|
|
135
138
|
<img src="{{ photo }}" alt="" class="item-card__photo" loading="lazy"
|
|
136
139
|
onerror="this.parentElement.removeChild(this)">
|
|
140
|
+
{% endif %}
|
|
137
141
|
{% endfor %}
|
|
138
142
|
</div>
|
|
139
143
|
{% endif %}
|
|
@@ -111,8 +111,10 @@
|
|
|
111
111
|
{# Categories/Tags #}
|
|
112
112
|
{% if item.category and item.category.length > 0 %}
|
|
113
113
|
<div class="item-card__categories">
|
|
114
|
-
{% for cat in item.category
|
|
114
|
+
{% for cat in item.category %}
|
|
115
|
+
{% if loop.index0 < 5 %}
|
|
115
116
|
<span class="item-card__category">#{{ cat | replace("#", "") }}</span>
|
|
117
|
+
{% endif %}
|
|
116
118
|
{% endfor %}
|
|
117
119
|
</div>
|
|
118
120
|
{% endif %}
|
|
@@ -121,12 +123,14 @@
|
|
|
121
123
|
{% if item.photo and item.photo.length > 0 %}
|
|
122
124
|
{% set photoCount = item.photo.length if item.photo.length <= 4 else 4 %}
|
|
123
125
|
<div class="item-card__photos item-card__photos--{{ photoCount }}">
|
|
124
|
-
{% for photo in item.photo
|
|
126
|
+
{% for photo in item.photo %}
|
|
127
|
+
{% if loop.index0 < 4 %}
|
|
125
128
|
<img src="{{ photo }}"
|
|
126
129
|
alt=""
|
|
127
130
|
class="item-card__photo"
|
|
128
131
|
loading="lazy"
|
|
129
132
|
onerror="this.parentElement.removeChild(this)">
|
|
133
|
+
{% endif %}
|
|
130
134
|
{% endfor %}
|
|
131
135
|
</div>
|
|
132
136
|
{% endif %}
|