feat(sw-187): Refactor footer output and fixed urls to include language
This commit is contained in:
@@ -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 []
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user