1
0
mirror of synced 2025-12-21 19:06:49 -05:00

unbreak categories.json on more complex Liquid (#34125)

This commit is contained in:
Peter Bengtsson
2023-01-23 15:15:55 -05:00
committed by GitHub
parent 237843a058
commit 13841ddb39
2 changed files with 16 additions and 3 deletions

View File

@@ -36,8 +36,9 @@ export function getPathWithoutVersion(href) {
export function getVersionStringFromPath(href, supportedOnly = false) {
href = getPathWithoutLanguage(href)
// Return immediately if this is a link to the homepage
if (href === '/') {
// Some URLs don't ever have a version in the URL and it won't be found
// if you continue digging deeper. So exit early with the default on these.
if (['/', '/categories.json'].includes(href)) {
return nonEnterpriseDefaultVersion
}