diff --git a/Makefile b/Makefile index be9b8b7a0..8104c42d0 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,12 @@ CONTAINER_RUN_CMD ?= docker run # same site url than the "host" it binds to. Thus, all the links will be # broken if we'd bind to 0.0.0.0 JEKYLL_VERSION := 3.8 -SITE_BUILD_CMD := $(CONTAINER_RUN_CMD) --rm -i -u "`id -u`:`id -g`" --volume="$$PWD/docs:/srv/jekyll" --volume="$$PWD/docs/vendor/bundle:/usr/local/bundle" --network=host jekyll/jekyll:$(JEKYLL_VERSION) +JEKYLL_ENV ?= development +SITE_BUILD_CMD := $(CONTAINER_RUN_CMD) --rm -i -u "`id -u`:`id -g`" \ + -e JEKYLL_ENV=$(JEKYLL_ENV) \ + --volume="$$PWD/docs:/srv/jekyll" \ + --volume="$$PWD/docs/vendor/bundle:/usr/local/bundle" \ + --network=host jekyll/jekyll:$(JEKYLL_VERSION) SITE_SUBDIR ?= JEKYLL_OPTS := -d _site/$(SITE_SUBDIR) -b /node-feature-discovery/$(SITE_SUBDIR) diff --git a/docs/_includes/class/addons-wrap.liquid b/docs/_includes/class/addons-wrap.liquid index 17aa88750..993d4cb52 100644 --- a/docs/_includes/class/addons-wrap.liquid +++ b/docs/_includes/class/addons-wrap.liquid @@ -12,10 +12,14 @@
{% if site.display_version_list %} -
-
-
Versions:
+
+
Versions
+ {% if jekyll.environment == "development" %} +
+ {{ site.version }} +
+ {% else %} {% comment %} Drop the last component from site.baseurl which is supposed to be pointing to a subdirectory of the true site baseurl. @@ -36,8 +40,8 @@ dt.appendChild(dd); } -
-
+ {% endif %} + {% endif %} {%- assign items = "github" | split: ", " -%} {% for item in items -%} diff --git a/scripts/github/update-gh-pages.sh b/scripts/github/update-gh-pages.sh index 5c62bd2b7..f505d5335 100755 --- a/scripts/github/update-gh-pages.sh +++ b/scripts/github/update-gh-pages.sh @@ -102,6 +102,7 @@ fi export SITE_SUBDIR=${site_subdir:-master} echo "Updating site subdir: '$SITE_SUBDIR'" +export JEKYLL_ENV=production make site-build # diff --git a/scripts/test-infra/build-gh-pages.sh b/scripts/test-infra/build-gh-pages.sh index c62571c8c..942ff45f8 100755 --- a/scripts/test-infra/build-gh-pages.sh +++ b/scripts/test-infra/build-gh-pages.sh @@ -8,4 +8,4 @@ mkdir -p "$_outdir" chmod a+rwx "$_outdir" # Build docs -make site-build +JEKYLL_ENV=production make site-build