From 1cb5e6e6ff53bf4e714991d023beebdaa5a701e0 Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Tue, 16 Jan 2024 20:28:46 -0500 Subject: [PATCH] Add version to the OpenSearch documentation section (#6162) * Add version to the OpenSearch documentation section Signed-off-by: Fanit Kolchina * List only major and minor version of documentation Signed-off-by: Fanit Kolchina --------- Signed-off-by: Fanit Kolchina --- _about/index.md | 2 ++ assets/js/_version-selector.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/_about/index.md b/_about/index.md index 25cbe8b6..d2cc011b 100644 --- a/_about/index.md +++ b/_about/index.md @@ -15,6 +15,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 37323443..e5efcaaf 100644 --- a/assets/js/_version-selector.js +++ b/assets/js/_version-selector.js @@ -189,15 +189,15 @@ 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 versionsDOMNodes = DOC_VERSIONS.map((v, idx) => `${PREFIX}${v}.x`); + 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}.x`) + ...DOC_VERSIONS_ARCHIVED.map((v, idx) => `${PREFIX}${v}`) ); }