diff --git a/assets/reader.css b/assets/reader.css index 5558c99..4607c35 100644 --- a/assets/reader.css +++ b/assets/reader.css @@ -123,6 +123,16 @@ width: 40px; } +.ap-card__avatar--default { + align-items: center; + background: var(--color-offset); + color: var(--color-text-muted); + display: inline-flex; + font-size: 1.1em; + font-weight: 600; + justify-content: center; +} + .ap-card__author-info { display: flex; flex-direction: column; diff --git a/index.js b/index.js index 17d60f7..e138d40 100644 --- a/index.js +++ b/index.js @@ -95,11 +95,28 @@ export default class ActivityPubEndpoint { } get navigationItems() { - return { - href: `${this.options.mountPath}/admin/reader`, - text: "activitypub.reader.title", - requiresDatabase: true, - }; + return [ + { + href: this.options.mountPath, + text: "activitypub.title", + requiresDatabase: true, + }, + { + href: `${this.options.mountPath}/admin/reader`, + text: "activitypub.reader.title", + requiresDatabase: true, + }, + { + href: `${this.options.mountPath}/admin/reader/notifications`, + text: "activitypub.notifications.title", + requiresDatabase: true, + }, + { + href: `${this.options.mountPath}/admin/reader/moderation`, + text: "activitypub.moderation.title", + requiresDatabase: true, + }, + ]; } /** diff --git a/lib/inbox-listeners.js b/lib/inbox-listeners.js index f7bd179..94161dc 100644 --- a/lib/inbox-listeners.js +++ b/lib/inbox-listeners.js @@ -96,7 +96,7 @@ export function registerInboxListeners(inboxChain, options) { actorName: followerInfo.name, actorPhoto: followerInfo.photo, actorHandle: followerInfo.handle, - published: follow.published ? new Date(follow.published) : new Date(), + published: follow.published ? String(follow.published) : new Date().toISOString(), createdAt: new Date().toISOString(), }); }) @@ -258,7 +258,7 @@ export function registerInboxListeners(inboxChain, options) { actorHandle: actorInfo.handle, targetUrl: objectId, targetName: "", // Could fetch post title, but not critical - published: like.published ? new Date(like.published) : new Date(), + published: like.published ? String(like.published) : new Date().toISOString(), createdAt: new Date().toISOString(), }); }) @@ -306,7 +306,7 @@ export function registerInboxListeners(inboxChain, options) { actorHandle: actorInfo.handle, targetUrl: objectId, targetName: "", // Could fetch post title, but not critical - published: announce.published ? new Date(announce.published).toISOString() : new Date().toISOString(), + published: announce.published ? String(announce.published) : new Date().toISOString(), createdAt: new Date().toISOString(), }); @@ -328,7 +328,7 @@ export function registerInboxListeners(inboxChain, options) { // Extract and store with boost metadata const timelineItem = await extractObjectData(object, { boostedBy: boosterInfo, - boostedAt: announce.published ? new Date(announce.published).toISOString() : new Date().toISOString(), + boostedAt: announce.published ? String(announce.published) : new Date().toISOString(), }); await addTimelineItem(collections, timelineItem); @@ -404,7 +404,7 @@ export function registerInboxListeners(inboxChain, options) { text: contentText, html: contentHtml, }, - published: object.published ? new Date(object.published).toISOString() : new Date().toISOString(), + published: object.published ? String(object.published) : new Date().toISOString(), createdAt: new Date().toISOString(), }); } @@ -433,7 +433,7 @@ export function registerInboxListeners(inboxChain, options) { text: contentText, html: mentionHtml, }, - published: object.published ? new Date(object.published).toISOString() : new Date().toISOString(), + published: object.published ? String(object.published) : new Date().toISOString(), createdAt: new Date().toISOString(), }); diff --git a/lib/timeline-store.js b/lib/timeline-store.js index 91e9890..c16adc3 100644 --- a/lib/timeline-store.js +++ b/lib/timeline-store.js @@ -124,7 +124,7 @@ export async function extractObjectData(object, options = {}) { // Published date — store as ISO string per Indiekit convention const published = object.published - ? new Date(object.published).toISOString() + ? String(object.published) : new Date().toISOString(); // Extract author — use async getAttributedTo() for Fedify objects diff --git a/package.json b/package.json index 246745e..3d95672 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "1.1.1", + "version": "1.1.3", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit", diff --git a/views/activitypub-compose.njk b/views/activitypub-compose.njk index 8ae7f11..e0b778f 100644 --- a/views/activitypub-compose.njk +++ b/views/activitypub-compose.njk @@ -2,7 +2,7 @@ {% from "heading/macro.njk" import heading with context %} -{% block content %} +{% block readercontent %} {{ heading({ text: title, level: 1, diff --git a/views/activitypub-moderation.njk b/views/activitypub-moderation.njk index 18d1e2a..78ab662 100644 --- a/views/activitypub-moderation.njk +++ b/views/activitypub-moderation.njk @@ -3,7 +3,7 @@ {% from "heading/macro.njk" import heading with context %} {% from "prose/macro.njk" import prose with context %} -{% block content %} +{% block readercontent %} {{ heading({ text: title, level: 1, diff --git a/views/activitypub-notifications.njk b/views/activitypub-notifications.njk index 98efb55..7a6ac92 100644 --- a/views/activitypub-notifications.njk +++ b/views/activitypub-notifications.njk @@ -3,7 +3,7 @@ {% from "heading/macro.njk" import heading with context %} {% from "prose/macro.njk" import prose with context %} -{% block content %} +{% block readercontent %} {{ heading({ text: __("activitypub.notifications.title"), level: 1, diff --git a/views/activitypub-reader.njk b/views/activitypub-reader.njk index 2d7fd8e..5105f67 100644 --- a/views/activitypub-reader.njk +++ b/views/activitypub-reader.njk @@ -3,7 +3,7 @@ {% from "heading/macro.njk" import heading with context %} {% from "prose/macro.njk" import prose with context %} -{% block content %} +{% block readercontent %} {{ heading({ text: __("activitypub.reader.title"), level: 1, diff --git a/views/activitypub-remote-profile.njk b/views/activitypub-remote-profile.njk index f98aac2..91ba1e7 100644 --- a/views/activitypub-remote-profile.njk +++ b/views/activitypub-remote-profile.njk @@ -3,7 +3,7 @@ {% from "heading/macro.njk" import heading with context %} {% from "prose/macro.njk" import prose with context %} -{% block content %} +{% block readercontent %} {{ heading({ text: title, level: 1, diff --git a/views/layouts/reader.njk b/views/layouts/reader.njk index 3457a25..2ef8bd8 100644 --- a/views/layouts/reader.njk +++ b/views/layouts/reader.njk @@ -1,9 +1,12 @@ {% extends "document.njk" %} -{% block head %} - {# Alpine.js for client-side reactivity #} - +{% block content %} + {# Alpine.js for client-side reactivity (CW toggles, interaction buttons) #} + - {# Reader stylesheet #} + {# Reader stylesheet — loaded in body is fine for modern browsers #} + + {% block readercontent %} + {% endblock %} {% endblock %} diff --git a/views/partials/ap-item-card.njk b/views/partials/ap-item-card.njk index 898fd51..4d250c1 100644 --- a/views/partials/ap-item-card.njk +++ b/views/partials/ap-item-card.njk @@ -4,7 +4,7 @@ {# Boost header if this is a boosted post #} {% if item.type == "boost" and item.boostedBy %}