mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-27 17:00:54 +01:00
Added support for hiding versions from selector
This commit is contained in:
parent
babc9950db
commit
2f1b2e9500
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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 %}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user