Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="/colony/apple-touch-icon.png" />
<link rel="canonical" href="__COLONY_CANONICAL_URL__" />
<link rel="manifest" href="__COLONY_MANIFEST_HREF__" />
<link rel="alternate" type="application/atom+xml" title="Colony Governance Feed" href="__COLONY_ATOM_FEED_URL__" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="__COLONY_META_DESCRIPTION__" />
<meta name="theme-color" content="#d97706" />
Expand Down
5 changes: 5 additions & 0 deletions web/scripts/__tests__/vite-colony-html-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('transformHtml', () => {
<head>
<link rel="canonical" href="__COLONY_CANONICAL_URL__" />
<link rel="manifest" href="__COLONY_MANIFEST_HREF__" />
<link rel="alternate" type="application/atom+xml" title="Colony Governance Feed" href="__COLONY_ATOM_FEED_URL__" />
<meta name="description" content="__COLONY_META_DESCRIPTION__" />
<meta property="og:url" content="__COLONY_OG_URL__" />
<meta property="og:title" content="__COLONY_OG_TITLE__" />
Expand Down Expand Up @@ -79,6 +80,9 @@ describe('transformHtml', () => {
expect(result).toContain('<title>Colony | Hivemoot</title>');
expect(result).toContain('<h1>Colony</h1>');
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', () => {
Expand All @@ -98,6 +102,7 @@ describe('transformHtml', () => {
expect(result).toContain('<title>Swarm | Acme</title>');
expect(result).toContain('<h1>Swarm</h1>');
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', () => {
Expand Down
11 changes: 11 additions & 0 deletions web/scripts/check-visibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,17 @@ async function runChecks(): Promise<CheckResult[]> {
ok: deployedJsonLd,
});

const homepageAtomPresent = hasAtomAutodiscoveryLink(deployedRootHtml);
results.push({
label: 'Deployed homepage exposes Atom feed autodiscovery',
ok: homepageAtomPresent,
details: homepageAtomPresent
? 'Found <link rel="alternate" type="application/atom+xml"> on homepage'
: rootRes?.status === 200
? 'Missing <link rel="alternate" type="application/atom+xml"> on homepage'
: `Could not fetch homepage: ${rootRes?.status ?? 'no response'}`,
});

const canonicalUrl = extractTagAttributeValue(
deployedRootHtml,
'link',
Expand Down
3 changes: 2 additions & 1 deletion web/scripts/vite-colony-html-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}

/**
Expand Down
Loading