diff --git a/assets/js/versions.js b/assets/js/versions.template.js similarity index 96% rename from assets/js/versions.js rename to assets/js/versions.template.js index 5e39342b..ab66309e 100644 --- a/assets/js/versions.js +++ b/assets/js/versions.template.js @@ -74,5 +74,5 @@ fetch("/versions.json") } // For historical versions, simply link to the changelog - appendVersion(ul, "historical", "/changelog/historical/"); + appendVersion(ul, "historical", '{{ (site.GetPage "changelog/historical").RelPermalink }}'); }); diff --git a/layouts/_partials/hooks/body-end.html b/layouts/_partials/hooks/body-end.html index c1324c0a..3abfe9b4 100644 --- a/layouts/_partials/hooks/body-end.html +++ b/layouts/_partials/hooks/body-end.html @@ -8,5 +8,10 @@ */}} {{ $toc := resources.Get "js/toc.js" -}} -{{ $versions := resources.Get "js/versions.js" -}} - + +{{- /* Load the versions script template, run and publish it */ -}} +{{ with resources.Get "js/versions.template.js" }} + {{ with resources.ExecuteAsTemplate "js/versions.js" $ . }} + + {{ end }} +{{ end }} diff --git a/layouts/_partials/navbar-version-selector.html b/layouts/_partials/navbar-version-selector.html index 215bca62..0a2fb136 100644 --- a/layouts/_partials/navbar-version-selector.html +++ b/layouts/_partials/navbar-version-selector.html @@ -13,6 +13,6 @@ All Versions