1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-09-23 19:08:25 +02:00

Added support for hiding versions from selector

This commit is contained in:
squidfunk 2024-03-13 17:42:16 +07:00
parent babc9950db
commit 2f1b2e9500
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
4 changed files with 15 additions and 6 deletions

View File

@ -249,7 +249,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.c8d2eff1.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.bd41221c.min.js' | url }}"></script>
{% for script in config.extra_javascript %}
{{ script | script_tag }}
{% endfor %}

View File

@ -27,6 +27,13 @@ import { h } from "~/utilities"
* Types
* ------------------------------------------------------------------------- */
/**
* Version properties
*/
export interface VersionProperties {
hidden?: boolean /* Version is hidden */
}
/**
* Version
*/
@ -34,6 +41,7 @@ export interface Version {
version: string /* Version identifier */
title: string /* Version title */
aliases: string[] /* Version aliases */
properties?: VersionProperties /* Version properties */
}
/* ----------------------------------------------------------------------------
@ -76,6 +84,7 @@ function renderVersion(version: Version): HTMLElement {
export function renderVersionSelector(
versions: Version[], active: Version
): HTMLElement {
versions = versions.filter(version => !version.properties?.hidden)
return (
<div class="md-version">
<button