Skip to content

Commit 86bd21e

Browse files
author
Misty Stanley-Jones
authored
Dynamically display latest Docker EE version (docker#5335)
1 parent 47fc9b5 commit 86bd21e

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

_layouts/docs.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
<link rel="stylesheet" href="/css/temp.css">
100100
{% seo %}
101101
{% if page.hide_from_sitemap %}<meta name="robots" content="noindex" />{% endif %}
102+
<script language="javascript">
103+
// Default to assuming this is an archive and hiding some stuff
104+
// See js/archive.js and js/docs.js for logic relating to this
105+
var isArchive = true;
106+
var dockerVersion = 'v{{ site.docker_ce_stable_version }}';
107+
</script>
102108
</head>
103109
<body ng-app="Docker" ng-controller="DockerController" class="colums">
104110
<header>
@@ -290,12 +296,6 @@ <h2>Next steps</h2>
290296
<script src="/js/jquery.js"></script>
291297
<script src="/js/bootstrap.min.js"></script>
292298
<!-- Always include the archive.js, but it doesn't do much unless we are an archive -->
293-
<script language="javascript">
294-
// Default to assuming this is an archive and hiding some stuff
295-
// See js/archive.js and js/docs.js for logic relating to this
296-
var isArchive = true;
297-
var dockerVersion = 'v{{ site.docker_ce_stable_version }}';
298-
</script>
299299
<script src="/js/archive.js"></script>
300300
<script src="/js/stickyfill.min.js"></script>
301301
<script defer src="/js/docs.js"></script>

enterprise/index.md

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and supported to provide enterprises with the most secure container platform
1111
in the industry. For more info about Docker EE, including purchasing
1212
options, see [Docker Enterprise Edition](https://www.docker.com/enterprise-edition/).
1313

14+
<!-- This is populated by logic in js/archive.js -->
15+
<p id="ee-version-div"></p>
16+
1417
The free Docker products continue to be available as the Docker Community
1518
Edition (*Docker CE*).
1619

js/archive.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ if (window.navigator.onLine) {
3838
if ( suppressButterBar == false ) {
3939
$( 'body' ).prepend(outerDivStart + buttonCode + listStart + listItems.join("") + listEnd + outerDivEnd);
4040
isArchive = true;
41-
console.log("Detected that this is an archive.");
4241
} else {
4342
isArchive = false;
44-
console.log("This is not an archive. Suppressing the archive versions bar");
43+
/* This is only relevant to /enterprise/index.md */
44+
if (document.getElementById('ee-version-div')) {
45+
document.getElementById('ee-version-div').textContent += "The latest version of Docker EE is {{ site.docker_ee_version }}.";
46+
}
4547
}
4648
});
4749
}

0 commit comments

Comments
 (0)