feat(sw-187): Refactor footer output and fixed urls to include language

This commit is contained in:
Pontus Dreij
2024-09-09 13:59:36 +02:00
parent 093ea1a99a
commit ef33d082d8
15 changed files with 253 additions and 282 deletions

View File

@@ -69,27 +69,3 @@ export function getFooterConnections(refs: FooterRefDataRaw) {
return connections
}
export function transformPageConnectionLinks(links: FooterLinkItem[]) {
if (!links) return []
return links.flatMap((link) => {
if (link.pageConnection?.edges.length) {
return link.pageConnection.edges.map((edge) => ({
title: edge.node.title || "",
url: edge.node.url || "",
openInNewTab: link.open_in_new_tab,
isExternal: false,
}))
} else if (link.link) {
return [
{
title: link.link.title,
url: link.link.href,
openInNewTab: link.open_in_new_tab,
isExternal: true,
},
]
}
return []
})
}