1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00

docs: polish the version menu

Only show the dynamic version menu in production environment where it's
available. Local (development) builds only show a stub version menu with
one item.

Also, fix the theme customization. Append version list items to the
correct element in html so that they are displayed correctly. Drop
unnecessary <div/>.

(cherry picked from commit 5295feb1ee)
This commit is contained in:
Markus Lehtonen 2020-10-30 07:51:38 +02:00
parent c3844a63c5
commit 777144d39b
4 changed files with 17 additions and 7 deletions

View file

@ -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)

View file

@ -12,10 +12,14 @@
</div>
<div class="addons d-flex flex-column height-full p-2 d-none">
{% if site.display_version_list %}
<div>
<dl>
<dt id="versions">Versions:</dt>
<dl id="versions">
<dt>Versions</dt>
{% if jekyll.environment == "development" %}
<dd>
<a href="{{ site.baseurl }}/">{{ site.version }}</a>
</dd>
{% 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);
}
</script>
</dl>
</div>
{% endif %}
</dl>
{% endif %}
{%- assign items = "github" | split: ", " -%}
{% for item in items -%}

View file

@ -102,6 +102,7 @@ fi
export SITE_SUBDIR=${site_subdir:-master}
echo "Updating site subdir: '$SITE_SUBDIR'"
export JEKYLL_ENV=production
make site-build
#

View file

@ -8,4 +8,4 @@ mkdir -p "$_outdir"
chmod a+rwx "$_outdir"
# Build docs
make site-build
JEKYLL_ENV=production make site-build