mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03: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>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% 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 %}
|
{% for script in config.extra_javascript %}
|
||||||
{{ script | script_tag }}
|
{{ script | script_tag }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -27,6 +27,13 @@ import { h } from "~/utilities"
|
|||||||
* Types
|
* Types
|
||||||
* ------------------------------------------------------------------------- */
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version properties
|
||||||
|
*/
|
||||||
|
export interface VersionProperties {
|
||||||
|
hidden?: boolean /* Version is hidden */
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version
|
* Version
|
||||||
*/
|
*/
|
||||||
@ -34,6 +41,7 @@ export interface Version {
|
|||||||
version: string /* Version identifier */
|
version: string /* Version identifier */
|
||||||
title: string /* Version title */
|
title: string /* Version title */
|
||||||
aliases: string[] /* Version aliases */
|
aliases: string[] /* Version aliases */
|
||||||
|
properties?: VersionProperties /* Version properties */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
@ -76,6 +84,7 @@ function renderVersion(version: Version): HTMLElement {
|
|||||||
export function renderVersionSelector(
|
export function renderVersionSelector(
|
||||||
versions: Version[], active: Version
|
versions: Version[], active: Version
|
||||||
): HTMLElement {
|
): HTMLElement {
|
||||||
|
versions = versions.filter(version => !version.properties?.hidden)
|
||||||
return (
|
return (
|
||||||
<div class="md-version">
|
<div class="md-version">
|
||||||
<button
|
<button
|
||||||
|
Loading…
Reference in New Issue
Block a user