From 6a9e58391ca218e1a0deec10352454d2213d889f Mon Sep 17 00:00:00 2001 From: Martin Weise <martin.weise@tuwien.ac.at> Date: Wed, 6 Mar 2024 17:16:01 +0000 Subject: [PATCH] Need extra JS defined --- .docs/overrides/main.html | 15 --------------- .docs/scripts/extra.js | 13 +++++++++++++ mkdocs.yml | 2 ++ 3 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 .docs/scripts/extra.js diff --git a/.docs/overrides/main.html b/.docs/overrides/main.html index 033bce3aa3..9f9a6daf6f 100644 --- a/.docs/overrides/main.html +++ b/.docs/overrides/main.html @@ -2,21 +2,6 @@ {% block announce %} <label for="version">Version</label> -<script type="javascript"> - function getVersion() { - const segments = location.pathname.split('/'); - if (segments.length >= 4) { - return segments[3]; - } else { - return '__APPVERSION__'; - } - } - function switchVersion(value) { - if (!value) { return } - this.location.href = location.protocol + '//' + location.host + '/infrastructures/dbrepo/' + value + '/'; - } - document.getElementById("version").value = getVersion(); -</script> <select style="margin-left:8px;" id="version" name="version" onchange="switchVersion(this.options[this.selectedIndex].value)"> <option value="latest">latest</option> <option value="1.4.1">1.4.1</option> diff --git a/.docs/scripts/extra.js b/.docs/scripts/extra.js new file mode 100644 index 0000000000..4768615e22 --- /dev/null +++ b/.docs/scripts/extra.js @@ -0,0 +1,13 @@ +function getVersion() { + const segments = location.pathname.split('/'); + if (segments.length >= 4) { + return segments[3]; + } else { + return '__APPVERSION__'; + } +} +function switchVersion(value) { + if (!value) { return } + this.location.href = location.protocol + '//' + location.host + '/infrastructures/dbrepo/' + value + '/'; +} +document.getElementById("version").value = getVersion(); \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 14affa17a9..60f1c85e88 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -43,6 +43,8 @@ nav: - contact.md extra_css: - stylesheets/extra.css +extra_javascript: + - scripts/extra.js theme: favicon: images/signet_white.png custom_dir: .docs/overrides -- GitLab