Convert versions.js to a template to resolve the correct path of /changelog/historical

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
pull/2256/head
Johannes Marbach 20 hours ago
parent 1a813ff434
commit 5fe78ced53

@ -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 }}');
});

@ -8,5 +8,10 @@
*/}}
{{ $toc := resources.Get "js/toc.js" -}}
<script defer src="{{ $toc.RelPermalink }}"></script>
{{ $versions := resources.Get "js/versions.js" -}}
<script defer src="{{ $versions.RelPermalink }}"></script>
{{- /* Load the versions script template, run and publish it */ -}}
{{ with resources.Get "js/versions.template.js" }}
{{ with resources.ExecuteAsTemplate "js/versions.js" $ . }}
<script defer src="{{ .RelPermalink }}"></script>
{{ end }}
{{ end }}

@ -13,6 +13,6 @@
All Versions
</a>
<ul class="dropdown-menu" id="version-selector">
{{- /* The menu is built by version.js */ -}}
{{- /* The menu is built by versions.template.js */ -}}
</ul>
</div>

Loading…
Cancel
Save