Try to fix JS TOC logic (#5666)

This commit is contained in:
Misty Stanley-Jones 2018-01-04 14:48:38 -08:00 committed by GitHub
parent f57b348089
commit d85e0d09c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -312,7 +312,13 @@
// See js/archive.js and js/docs.js for logic relating to this
var isArchive = true;
var dockerVersion = 'v{{ site.docker_ce_stable_version }}';
var pageURL = '{{ page.url }}';
// In archives, we need to know the page root and we get it from JEKYLL_ENV in the jekyll build command
var jekyllEnv = '{{ jekyll.environment }}';
// If unset (in non-archive branches), defaults to "development". In that case, reset it to empty
if (jekyllEnv == 'development') {
jekyllEnv = '';
}
var pageURL = jekyllEnv + '{{ page.url }}';
</script>
<script src="/js/archive.js"></script>
<script src="/js/stickyfill.min.js"></script>