Skip to content

Commit 97672b1

Browse files
fix: RSS alternate link tag does not expose release/vuln feeds (#6562)
* fix: RSS alternate link tag does not expose release/vuln feeds * chore: Replace with baseUrlAndPath instead * chore: Update regex to match blog and use local to get url
1 parent 3f4e4f9 commit 97672b1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

next.dynamic.mjs

+19
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,25 @@ const getDynamicRouter = async () => {
212212
path
213213
);
214214

215+
const blogMatch = path.match(/^blog\/(release|vulnerability)(\/|$)/);
216+
if (blogMatch) {
217+
const category = blogMatch[1];
218+
const currentFile = siteConfig.rssFeeds.find(
219+
item => item.category === category
220+
)?.file;
221+
// Use getUrlForPathname to dynamically construct the XML path for blog/release and blog/vulnerability
222+
pageMetadata.alternates.types['application/rss+xml'] = getUrlForPathname(
223+
locale,
224+
`feed/${currentFile}`
225+
);
226+
} else {
227+
// Use getUrlForPathname for the default blog XML feed path
228+
pageMetadata.alternates.types['application/rss+xml'] = getUrlForPathname(
229+
locale,
230+
'feed/blog.xml'
231+
);
232+
}
233+
215234
availableLocaleCodes.forEach(currentLocale => {
216235
pageMetadata.alternates.languages[currentLocale] = getUrlForPathname(
217236
currentLocale,

0 commit comments

Comments
 (0)