Skip to content

Commit

Permalink
Added support for hiding versions from selector
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Mar 13, 2024
1 parent babc995 commit 2f1b2e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Expand Up @@ -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 %}
Expand Down
9 changes: 9 additions & 0 deletions src/templates/assets/javascripts/templates/version/index.tsx
Expand Up @@ -27,13 +27,21 @@ import { h } from "~/utilities"
* Types
* ------------------------------------------------------------------------- */

/**
* Version properties
*/
export interface VersionProperties {
hidden?: boolean /* Version is hidden */
}

/**
* Version
*/
export interface Version {
version: string /* Version identifier */
title: string /* Version title */
aliases: string[] /* Version aliases */
properties?: VersionProperties /* Version properties */
}

/* ----------------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2f1b2e9

Please sign in to comment.