app: announcements, devotionals and events' screens; @crosscode/seo 1.1.0 (APP-1.0-PLAN §5-§7)

Public pages: Home with today's devotional, the latest announcements (pinned
first) and what's on; Announcements and each one's page (markdown without
HTML, a button, Article JSON-LD; members-only ones ask for a sign-in and are
noindex); Devotional (the passage in full with its copyright line, Read in
YouVersion, the prayer), each day's page, the archive by month and the
Acknowledgements; Events and each one's page (Register on the Events site for
Cross Events', a canonical to the origin, Event JSON-LD on the App's own).
A sitemap of the public pages, named in robots.txt.

Admin: Announcements (schedule, end, pin, campus, who sees it, also send it),
Events (simple events, Linked products: publish and show events from), and
Devotionals (Cross Code's or our own, Sync now, a month's days, writing, the
CSV import with its preview, keep or replace days already filled).

@crosscode/seo 1.1.0: articleJsonLd. The backend gives the App's own address
and the sitemap's list, and a simple event's crosscode.event/1 for its page.

Checked in a browser on a throwaway PostgreSQL: the pages for a visitor, the
JSON-LD, a members-only announcement asking for a sign-in, the sitemap, a
Content admin publishing an announcement and a Devotional writer saving one;
no page errors. 94 backend tests, 19 seo tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 11:36:41 +02:00
co-authored by Claude Opus 5.5
parent a9079f1195
commit 0ac6827ddd
43 changed files with 1482 additions and 30 deletions
+17
View File
@@ -261,3 +261,20 @@ describe('events', () => {
assert.deepEqual((await visitor.get('/api/v1/events')).body.events, []);
});
});
describe('the sitemap', () => {
it('lists public announcements, devotionals and the App\'s own events; never members-only ones', async () => {
const { editor, writer, visitor } = await setup();
await editor.post('/api/v1/admin/announcements', announcement());
await editor.post('/api/v1/admin/announcements', announcement({ title: 'Members only', audience: 'members' }));
await editor.post('/api/v1/admin/events', event());
await writer.put('/api/v1/admin/devotionals/settings', { source: 'church' });
await writer.post('/api/v1/admin/devotionals', { date: '2026-12-01', title: 'A', reference: 'John 3:16', translation: 'BSB', passageText: 'x', body: 'y' });
await writer.post('/api/v1/admin/devotionals', { date: '2026-11-30', title: 'B', reference: 'John 3:17', translation: 'BSB', passageText: 'x', body: 'y', membersOnly: true });
const map = (await visitor.get('/api/v1/sitemap')).body;
assert.deepEqual(map.announcements.map((a: { slug: string }) => a.slug), ['family-camp-registrations-open']);
assert.deepEqual(map.devotionals.map((d: { date: string }) => d.date), ['2026-12-01']);
assert.deepEqual(map.events.map((e: { key: string }) => e.key), ['family-camp-2026-12-12']);
assert.equal((await visitor.get('/api/v1/app')).body.url, 'https://app.hope.test');
});
});