From 63953ab3d497bf26f18b5b9d3ea667ca700598a9 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 2 Jun 2019 23:19:57 +0100 Subject: [PATCH] style: improve consistency if Hugo `--minify` used --- assets/js/academic.js | 9 +++++---- layouts/partials/navbar.html | 16 ++++------------ layouts/partials/widgets/hero.html | 2 +- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/assets/js/academic.js b/assets/js/academic.js index 5d52c286..cb4acb83 100644 --- a/assets/js/academic.js +++ b/assets/js/academic.js @@ -280,7 +280,7 @@ function printLatestRelease(selector, repo) { $.getJSON('https://api.github.com/repos/' + repo + '/tags').done(function (json) { let release = json[0]; - $(selector).append(release.name); + $(selector).append(' '+release.name); }).fail(function( jqxhr, textStatus, error ) { let err = textStatus + ", " + error; console.log( "Request Failed: " + err ); @@ -520,9 +520,10 @@ // Initialise Google Maps if necessary. initMap(); - // Print latest Academic version if necessary. - if ($('#academic-release').length > 0) - printLatestRelease('#academic-release', $('#academic-release').data('repo')); + // Print latest version of GitHub projects. + let githubReleaseSelector = '.js-github-release'; + if ($(githubReleaseSelector).length > 0) + printLatestRelease(githubReleaseSelector, $(githubReleaseSelector).data('repo')); // On search icon click toggle search dialog. $('.js-search').click(function(e) { diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 2f6cd766..7e2ee6ae 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -28,18 +28,14 @@ {{ if .HasChildren }}