From af0e6d1050ba621d230c09eeae15f9961118a33d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 17 Jan 2024 17:26:19 +0000 Subject: [PATCH] Resolved merge conflicts (#6194) Signed-off-by: Fanit Kolchina (cherry picked from commit f441f132d88bd567fa023a1d8877345cbd2b652b) Signed-off-by: github-actions[bot] --- _about/index.md | 2 ++ assets/js/_version-selector.js | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/_about/index.md b/_about/index.md index a05387a15a..3fc350eb31 100644 --- a/_about/index.md +++ b/_about/index.md @@ -14,6 +14,8 @@ redirect_from: {%- comment -%}The `/docs/opensearch/` redirect is specifically to support the UI links in OpenSearch Dashboards 1.0.0.{%- endcomment -%} # OpenSearch and OpenSearch Dashboards +**Version {{site.opensearch_major_minor_version}}** +{: .label .label-blue } This section contains documentation for OpenSearch and OpenSearch Dashboards. diff --git a/assets/js/_version-selector.js b/assets/js/_version-selector.js index dc438e04fa..1f46c9c0cc 100644 --- a/assets/js/_version-selector.js +++ b/assets/js/_version-selector.js @@ -155,11 +155,19 @@ class VersionSelector extends HTMLElement { const {shadowRoot} = this; const frag = this._makeFragment(tpl); - frag.querySelector('#selected').textContent = `${PREFIX}${this.getAttribute('selected')}.x`; + frag.querySelector('#selected').textContent = `${PREFIX}${this.getAttribute('selected')}`; const pathName = location.pathname.replace(/\/docs(\/((latest|\d+\.\d+)\/?)?)?/, ''); - const versionsDOMText = DOC_VERSIONS.map((v, idx) => `${PREFIX}${v}.x`) - .join(''); + const versionsDOMNodes = DOC_VERSIONS.map((v, idx) => `${PREFIX}${v}`); + if (Array.isArray(DOC_VERSIONS_ARCHIVED) && DOC_VERSIONS_ARCHIVED.length) { + versionsDOMNodes.push( + `Show archived`, + `Archived`, + ...DOC_VERSIONS_ARCHIVED.map((v, idx) => `${PREFIX}${v}`) + ); + } + + const versionsDOMText = versionsDOMNodes.join(''); frag.querySelector('#dropdown').appendChild(this._makeFragment(versionsDOMText)); frag.querySelector('#spacer').appendChild(this._makeFragment(versionsDOMText));