@rmdes/indiekit-endpoint-activitypub 1.1.2 → 1.1.4

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.
package/assets/reader.css CHANGED
@@ -123,6 +123,16 @@
123
123
  width: 40px;
124
124
  }
125
125
 
126
+ .ap-card__avatar--default {
127
+ align-items: center;
128
+ background: var(--color-offset);
129
+ color: var(--color-text-muted);
130
+ display: inline-flex;
131
+ font-size: 1.1em;
132
+ font-weight: 600;
133
+ justify-content: center;
134
+ }
135
+
126
136
  .ap-card__author-info {
127
137
  display: flex;
128
138
  flex-direction: column;
package/index.js CHANGED
@@ -95,11 +95,28 @@ export default class ActivityPubEndpoint {
95
95
  }
96
96
 
97
97
  get navigationItems() {
98
- return {
99
- href: `${this.options.mountPath}/admin/reader`,
100
- text: "activitypub.reader.title",
101
- requiresDatabase: true,
102
- };
98
+ return [
99
+ {
100
+ href: this.options.mountPath,
101
+ text: "activitypub.title",
102
+ requiresDatabase: true,
103
+ },
104
+ {
105
+ href: `${this.options.mountPath}/admin/reader`,
106
+ text: "activitypub.reader.title",
107
+ requiresDatabase: true,
108
+ },
109
+ {
110
+ href: `${this.options.mountPath}/admin/reader/notifications`,
111
+ text: "activitypub.notifications.title",
112
+ requiresDatabase: true,
113
+ },
114
+ {
115
+ href: `${this.options.mountPath}/admin/reader/moderation`,
116
+ text: "activitypub.moderation.title",
117
+ requiresDatabase: true,
118
+ },
119
+ ];
103
120
  }
104
121
 
105
122
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-activitypub",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
5
5
  "keywords": [
6
6
  "indiekit",
@@ -1,8 +1,8 @@
1
- {% extends "layouts/reader.njk" %}
1
+ {% extends "layouts/ap-reader.njk" %}
2
2
 
3
3
  {% from "heading/macro.njk" import heading with context %}
4
4
 
5
- {% block content %}
5
+ {% block readercontent %}
6
6
  {{ heading({
7
7
  text: title,
8
8
  level: 1,
@@ -1,9 +1,9 @@
1
- {% extends "layouts/reader.njk" %}
1
+ {% extends "layouts/ap-reader.njk" %}
2
2
 
3
3
  {% from "heading/macro.njk" import heading with context %}
4
4
  {% from "prose/macro.njk" import prose with context %}
5
5
 
6
- {% block content %}
6
+ {% block readercontent %}
7
7
  {{ heading({
8
8
  text: title,
9
9
  level: 1,
@@ -1,9 +1,9 @@
1
- {% extends "layouts/reader.njk" %}
1
+ {% extends "layouts/ap-reader.njk" %}
2
2
 
3
3
  {% from "heading/macro.njk" import heading with context %}
4
4
  {% from "prose/macro.njk" import prose with context %}
5
5
 
6
- {% block content %}
6
+ {% block readercontent %}
7
7
  {{ heading({
8
8
  text: __("activitypub.notifications.title"),
9
9
  level: 1,
@@ -1,9 +1,9 @@
1
- {% extends "layouts/reader.njk" %}
1
+ {% extends "layouts/ap-reader.njk" %}
2
2
 
3
3
  {% from "heading/macro.njk" import heading with context %}
4
4
  {% from "prose/macro.njk" import prose with context %}
5
5
 
6
- {% block content %}
6
+ {% block readercontent %}
7
7
  {{ heading({
8
8
  text: __("activitypub.reader.title"),
9
9
  level: 1,
@@ -1,9 +1,9 @@
1
- {% extends "layouts/reader.njk" %}
1
+ {% extends "layouts/ap-reader.njk" %}
2
2
 
3
3
  {% from "heading/macro.njk" import heading with context %}
4
4
  {% from "prose/macro.njk" import prose with context %}
5
5
 
6
- {% block content %}
6
+ {% block readercontent %}
7
7
  {{ heading({
8
8
  text: title,
9
9
  level: 1,
@@ -0,0 +1,12 @@
1
+ {% extends "document.njk" %}
2
+
3
+ {% block content %}
4
+ {# Alpine.js for client-side reactivity (CW toggles, interaction buttons) #}
5
+ <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js"></script>
6
+
7
+ {# Reader stylesheet — loaded in body is fine for modern browsers #}
8
+ <link rel="stylesheet" href="/assets/@rmdes-indiekit-endpoint-activitypub/reader.css">
9
+
10
+ {% block readercontent %}
11
+ {% endblock %}
12
+ {% endblock %}
@@ -4,7 +4,7 @@
4
4
  {# Boost header if this is a boosted post #}
5
5
  {% if item.type == "boost" and item.boostedBy %}
6
6
  <div class="ap-card__boost">
7
- 🔁 <a href="{{ item.boostedBy.url }}">{{ item.boostedBy.name }}</a> {{ __("activitypub.reader.boosted") }}
7
+ 🔁 {% if item.boostedBy.url %}<a href="{{ mountPath }}/admin/reader/profile?url={{ item.boostedBy.url | urlencode }}">{{ item.boostedBy.name or "Someone" }}</a>{% else %}{{ item.boostedBy.name or "Someone" }}{% endif %} {{ __("activitypub.reader.boosted") }}
8
8
  </div>
9
9
  {% endif %}
10
10
 
@@ -17,16 +17,28 @@
17
17
 
18
18
  {# Author header #}
19
19
  <header class="ap-card__author">
20
- <img src="{{ item.author.photo }}" alt="{{ item.author.name }}" class="ap-card__avatar">
20
+ {% if item.author.photo %}
21
+ <img src="{{ item.author.photo }}" alt="{{ item.author.name }}" class="ap-card__avatar" loading="lazy">
22
+ {% else %}
23
+ <span class="ap-card__avatar ap-card__avatar--default" aria-hidden="true">{{ item.author.name[0] | upper if item.author.name else "?" }}</span>
24
+ {% endif %}
21
25
  <div class="ap-card__author-info">
22
26
  <div class="ap-card__author-name">
23
- <a href="{{ item.author.url }}">{{ item.author.name }}</a>
27
+ {% if item.author.url %}
28
+ <a href="{{ mountPath }}/admin/reader/profile?url={{ item.author.url | urlencode }}">{{ item.author.name or "Unknown" }}</a>
29
+ {% else %}
30
+ <span>{{ item.author.name or "Unknown" }}</span>
31
+ {% endif %}
24
32
  </div>
25
- <div class="ap-card__author-handle">{{ item.author.handle }}</div>
33
+ {% if item.author.handle %}
34
+ <div class="ap-card__author-handle">{{ item.author.handle }}</div>
35
+ {% endif %}
26
36
  </div>
27
- <time datetime="{{ item.published }}" class="ap-card__timestamp">
28
- {{ item.published | date("PPp") }}
29
- </time>
37
+ {% if item.published %}
38
+ <time datetime="{{ item.published }}" class="ap-card__timestamp">
39
+ {{ item.published | date("PPp") }}
40
+ </time>
41
+ {% endif %}
30
42
  </header>
31
43
 
32
44
  {# Post title (articles only) #}
@@ -1,9 +0,0 @@
1
- {% extends "document.njk" %}
2
-
3
- {% block head %}
4
- {# Alpine.js for client-side reactivity #}
5
- <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14/dist/cdn.min.js"></script>
6
-
7
- {# Reader stylesheet #}
8
- <link rel="stylesheet" href="/assets/@rmdes-indiekit-endpoint-activitypub/reader.css">
9
- {% endblock %}