Compare commits

..

1 commit

Author SHA1 Message Date
Johannes Marbach 9ad2cde1b4
Merge 1a813ff434 into d28e05af87 2025-12-01 17:44:36 +00:00
4 changed files with 4 additions and 41 deletions

View file

@ -14,27 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This oddity is an attempt at producing a readable Hugo template while avoiding
// JS syntax errors in your IDE
const currentVersion = `{{ if eq .Site.Params.version.status "unstable" }}
{{- /**/ -}}
unstable
{{- /**/ -}}
{{ else }}
{{- /**/ -}}
{{ printf "v%s.%s" .Site.Params.version.major .Site.Params.version.minor }}
{{- /**/ -}}
{{ end }}`;
function appendVersion(parent, name, url) {
// The list item
const li = document.createElement("li");
if (name === currentVersion) {
li.classList.add("selected")
}
if (name === "unstable") {
li.classList.add("unstable")
}
parent.appendChild(li);
// The link
@ -92,5 +74,5 @@ fetch("/versions.json")
}
// For historical versions, simply link to the changelog
appendVersion(ul, "historical", '{{ (site.GetPage "changelog/historical").RelPermalink }}');
appendVersion(ul, "historical", "/changelog/historical/");
});

View file

@ -50,20 +50,6 @@ Custom SCSS for the Matrix spec
a {
color: $black;
}
/* Make the version dropdown scroll if its too large */
ul#version-selector {
max-height: 80vh;
overflow-y: auto;
}
ul#version-selector li.selected a {
color: $secondary;
}
ul#version-selector li.unstable:not(.selected) a {
color: $warning;
}
}
/* Styles for the sidebar nav */

View file

@ -8,10 +8,5 @@
*/}}
{{ $toc := resources.Get "js/toc.js" -}}
<script defer src="{{ $toc.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 }}
{{ $versions := resources.Get "js/versions.js" -}}
<script defer src="{{ $versions.RelPermalink }}"></script>

View file

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