Skip to content

Commit 7e0e9e7

Browse files
authored
Merge pull request #14050 from guardian/link-to-rss-feeds-from-head
Add a <link> to the RSS feeds on tag pages and fronts
2 parents b2c00c1 + f8e18e5 commit 7e0e9e7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

dotcom-rendering/src/server/htmlPageTemplate.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type BaseProps = {
2727
weAreHiring: boolean;
2828
onlyLightColourScheme?: boolean;
2929
isInteractive?: boolean;
30+
rssFeedUrl?: string;
3031
};
3132

3233
interface WebProps extends BaseProps {
@@ -76,6 +77,7 @@ export const htmlPageTemplate = (props: WebProps | AppProps): string => {
7677
weAreHiring,
7778
config,
7879
isInteractive = false,
80+
rssFeedUrl,
7981
} = props;
8082

8183
const doNotIndex = (): boolean => {
@@ -408,6 +410,12 @@ https://workforus.theguardian.com/careers/product-engineering/
408410
: ``
409411
}
410412
413+
${
414+
!isUndefined(rssFeedUrl)
415+
? `<link rel="alternate" type="application/rss+xml" href="${rssFeedUrl}">`
416+
: ''
417+
}
418+
411419
</head>
412420
413421
<body class="${hasPageSkin ? 'has-page-skin' : ''}">

dotcom-rendering/src/server/render.front.web.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export const renderFront = ({
162162
weAreHiring: !!front.config.switches.weAreHiring,
163163
canonicalUrl,
164164
config,
165+
rssFeedUrl: front.webURL + '/rss',
165166
});
166167

167168
return {
@@ -250,6 +251,7 @@ export const renderTagPage = ({
250251
weAreHiring: !!tagPage.config.switches.weAreHiring,
251252
canonicalUrl: tagPage.canonicalUrl,
252253
config,
254+
rssFeedUrl: tagPage.webURL + '/rss',
253255
});
254256
return {
255257
html: pageHtml,

0 commit comments

Comments
 (0)