Color the currently selected version in the picker

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
pull/2256/head
Johannes Marbach 12 hours ago
parent 5fe78ced53
commit eea13b0ff2

@ -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

@ -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 */

Loading…
Cancel
Save