diff --git a/assets/js/versions.template.js b/assets/js/versions.template.js index ab66309e..0083a7fd 100644 --- a/assets/js/versions.template.js +++ b/assets/js/versions.template.js @@ -14,9 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. */ +// This oddity is an attempt at producing a readable Hugo template while avoiding +// JS syntax errors in your IDE +const currentVersion = `{{ if eq .Site.Params.version.status "unstable" }} + {{- /**/ -}} + unstable + {{- /**/ -}} +{{ else }} + {{- /**/ -}} + {{ printf "v%s.%s" .Site.Params.version.major .Site.Params.version.minor }} + {{- /**/ -}} +{{ end }}`; + function appendVersion(parent, name, url) { // The list item const li = document.createElement("li"); + if (name === currentVersion) { + li.classList.add("selected") + } parent.appendChild(li); // The link diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index 9739f239..62952bd3 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -50,6 +50,10 @@ Custom SCSS for the Matrix spec a { color: $black; } + + ul#version-selector li.selected a { + color: $secondary; + } } /* Styles for the sidebar nav */