Add `.x` suffix to versions selector

Signed-off-by: Miki <mehranb@amazon.com>
This commit is contained in:
Miki 2021-10-06 09:09:49 -07:00
parent 510a101e07
commit 03e3fce37f
1 changed files with 2 additions and 2 deletions

View File

@ -143,10 +143,10 @@ class VersionSelector extends HTMLElement {
const {shadowRoot} = this;
const frag = this._makeFragment(tpl);
frag.querySelector('#selected').textContent = `${PREFIX}${this.getAttribute('selected')}`;
frag.querySelector('#selected').textContent = `${PREFIX}${this.getAttribute('selected')}.x`;
const pathName = location.pathname.replace(/\/docs(\/((latest|\d+\.\d+)\/?)?)?/, '');
const versionsDOMText = DOC_VERSIONS.map((v, idx) => `<a href="/docs/${v}/${pathName}"${idx === 0 ? ' class="latest"' : ''}>${PREFIX}${v}</a>`)
const versionsDOMText = DOC_VERSIONS.map((v, idx) => `<a href="/docs/${v}/${pathName}"${idx === 0 ? ' class="latest"' : ''}>${PREFIX}${v}.x</a>`)
.join('');
frag.querySelector('#dropdown').appendChild(this._makeFragment(versionsDOMText));