Skip to content

Commit

Permalink
Update docs-nav.html (#3258)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9a67d08)

Co-authored-by: DjP-iX <[email protected]>
  • Loading branch information
bugclerk and DjP-iX authored Nov 18, 2024
1 parent aaef296 commit da7ee97
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions layouts/partials/docs-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,28 @@
}

function constructFallbackUrl(path, version) {
// Determine the product based on the current path
var product = getProductFromPath(path).toLowerCase().replace(/\s+/g, '');

// Add logic to determine product based on version
if (version === '13.0' || version === '13.3') {
product = 'truenascore';
} else if (parseFloat(version) > 20) {
product = 'truenasscale';
}

// Return the appropriate URL based on the determined product
if (product === 'truenascore') {
return `${base_url}/docs/core/${version}/`;
} else if (product === 'truenasscale') {
return `${base_url}/docs/scale/${version}/`;
} else if (product === 'truecommand') {
return `${base_url}/docs/truecommand/${version}/`;
} else {
// Default fallback, though this case should ideally be handled by specific product checks
// Default fallback
return `${base_url}/docs/${version}/`;
}
}
}

if (selectedProduct === currentProduct.toLowerCase()) {
var newPath;
Expand Down

0 comments on commit da7ee97

Please sign in to comment.