diff --git a/godoc/static/godoc.html b/godoc/static/godoc.html
index e4ea6e1a..a7009827 100644
--- a/godoc/static/godoc.html
+++ b/godoc/static/godoc.html
@@ -100,6 +100,7 @@ and code is licensed under a BSD license.
{{if .Playground}}
{{end}}
+{{with .Version}}{{end}}
diff --git a/godoc/static/godocs.js b/godoc/static/godocs.js index ec9f37a9..10183cba 100644 --- a/godoc/static/godocs.js +++ b/godoc/static/godocs.js @@ -297,6 +297,14 @@ function personalizeInstallInstructions() { window.location = download; } +function updateVersionTags() { + var v = window.goVersion; + if (/^go[0-9.]+$/.test(v)) { + $(".versionTag").empty().text(v); + $(".whereTag").hide(); + } +} + $(document).ready(function() { bindSearchEvents(); generateTOC(); @@ -313,6 +321,7 @@ $(document).ready(function() { setupCallgraphs(); toggleHash(); personalizeInstallInstructions(); + updateVersionTags(); // godoc.html defines window.initFuncs in the
tag, and root.html and
// codewalk.js push their on-page-ready functions to the list.
diff --git a/godoc/static/static.go b/godoc/static/static.go
index 985243d8..a29eaed1 100644
--- a/godoc/static/static.go
+++ b/godoc/static/static.go
@@ -560,6 +560,7 @@ and code is licensed under a BSD license.
{{if .Playground}}
{{end}}
+{{with .Version}}{{end}}
@@ -866,6 +867,14 @@ function personalizeInstallInstructions() {
window.location = download;
}
+function updateVersionTags() {
+ var v = window.goVersion;
+ if (/^go[0-9.]+$/.test(v)) {
+ $(".versionTag").empty().text(v);
+ $(".whereTag").hide();
+ }
+}
+
$(document).ready(function() {
bindSearchEvents();
generateTOC();
@@ -882,6 +891,7 @@ $(document).ready(function() {
setupCallgraphs();
toggleHash();
personalizeInstallInstructions();
+ updateVersionTags();
// godoc.html defines window.initFuncs in the
tag, and root.html and // codewalk.js push their on-page-ready functions to the list.