We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb820e8 commit 360ab51Copy full SHA for 360ab51
ui/templates/partials/cookbook/header.html
@@ -38,8 +38,11 @@ <h1 class="cookbook-headline">
38
);
39
40
function changeUrl(v) {
41
- const searchTerm = window.location.pathname.includes("/_latest/") ? "/_latest/" : '/{{.cookbook.Metadata.Version}}/'
42
- window.location.href = window.location.pathname.replace(searchTerm, '/' + v + '/');
+ const latestPath = '/{{.cookbook.Metadata.Name}}/_latest';
+ const versionedPath = '/{{.cookbook.Metadata.Name}}/{{.cookbook.Metadata.Version}}';
43
+ const currentPath = window.location.pathname;
44
+ const searchTerm = currentPath.includes(latestPath) ? latestPath : versionedPath;
45
+ window.location.href = currentPath.replace(searchTerm, '/{{.cookbook.Metadata.Name}}/'+v);
46
}
47
</script>
48
<div class="col">
0 commit comments