From cc7a33edc8e8f420f1d1cf34f37771f31f4cc070 Mon Sep 17 00:00:00 2001 From: hivemoot-forager Date: Sun, 12 Apr 2026 05:38:03 +0000 Subject: [PATCH] fix: advertise live Atom feed from homepage head The root homepage never emitted the Atom autodiscovery tag, even though feed.xml is live and /proposals/ already exposes the tag. Feed readers and browser extensions look for autodiscovery on the page the user actually lands on, so this left the feed hidden from standard clients. - Add with a __COLONY_ATOM_FEED_URL__ placeholder to web/index.html, consistent with the existing __COLONY_*__ template pattern. - Replace the placeholder in transformHtml() using config.siteUrl so template deployers get their own feed URL automatically. - Add a check-visibility.ts check for homepage Atom autodiscovery to catch future regressions on main. - Extend the vite-colony-html-plugin tests to cover the feed URL replacement for both default and custom configs, and verify no __COLONY_*__ tokens remain unreplaced. Closes #761 --- web/index.html | 1 + web/scripts/__tests__/vite-colony-html-plugin.test.ts | 5 +++++ web/scripts/check-visibility.ts | 11 +++++++++++ web/scripts/vite-colony-html-plugin.ts | 3 ++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index 7ece632e..abaee44d 100644 --- a/web/index.html +++ b/web/index.html @@ -7,6 +7,7 @@ + diff --git a/web/scripts/__tests__/vite-colony-html-plugin.test.ts b/web/scripts/__tests__/vite-colony-html-plugin.test.ts index 55ac04cc..4d36b5b7 100644 --- a/web/scripts/__tests__/vite-colony-html-plugin.test.ts +++ b/web/scripts/__tests__/vite-colony-html-plugin.test.ts @@ -31,6 +31,7 @@ describe('transformHtml', () => { + @@ -79,6 +80,9 @@ describe('transformHtml', () => { expect(result).toContain('Colony | Hivemoot'); expect(result).toContain('

Colony

'); expect(result).toContain('href="https://github.com/hivemoot/colony"'); + expect(result).toContain( + 'href="https://hivemoot.github.io/colony/feed.xml"' + ); }); it('replaces all placeholders with custom config values', () => { @@ -98,6 +102,7 @@ describe('transformHtml', () => { expect(result).toContain('Swarm | Acme'); expect(result).toContain('

Swarm

'); expect(result).toContain('href="https://github.com/acme/swarm"'); + expect(result).toContain('href="https://acme.github.io/swarm/feed.xml"'); }); it('leaves no unreplaced placeholder tokens', () => { diff --git a/web/scripts/check-visibility.ts b/web/scripts/check-visibility.ts index 373899c0..e535809f 100644 --- a/web/scripts/check-visibility.ts +++ b/web/scripts/check-visibility.ts @@ -441,6 +441,17 @@ async function runChecks(): Promise { ok: deployedJsonLd, }); + const homepageAtomPresent = hasAtomAutodiscoveryLink(deployedRootHtml); + results.push({ + label: 'Deployed homepage exposes Atom feed autodiscovery', + ok: homepageAtomPresent, + details: homepageAtomPresent + ? 'Found on homepage' + : rootRes?.status === 200 + ? 'Missing on homepage' + : `Could not fetch homepage: ${rootRes?.status ?? 'no response'}`, + }); + const canonicalUrl = extractTagAttributeValue( deployedRootHtml, 'link', diff --git a/web/scripts/vite-colony-html-plugin.ts b/web/scripts/vite-colony-html-plugin.ts index cde2665e..822f051c 100644 --- a/web/scripts/vite-colony-html-plugin.ts +++ b/web/scripts/vite-colony-html-plugin.ts @@ -75,7 +75,8 @@ export function transformHtml(html: string, config: ColonyConfig): string { .replace(/__COLONY_JSONLD_PUBLISHER_URL__/g, config.githubUrl) .replace(/__COLONY_PAGE_TITLE__/g, pageTitle) .replace(/__COLONY_SITE_TITLE__/g, config.siteTitle) - .replace(/__COLONY_NOSCRIPT_GITHUB_URL__/g, config.githubUrl); + .replace(/__COLONY_NOSCRIPT_GITHUB_URL__/g, config.githubUrl) + .replace(/__COLONY_ATOM_FEED_URL__/g, `${config.siteUrl}/feed.xml`); } /**