1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

Makefile: add rules for building html docs

Add rules for building and serving the html documentation inside a
container.
- 'make site-build' will build the html content unders docs/_site.
- 'make site-serve' builds the site content and serves it at
  http://localhost:4000/
This commit is contained in:
Markus Lehtonen 2020-09-07 19:56:05 +03:00
parent d8ed7a7131
commit 5ec91935df
2 changed files with 18 additions and 1 deletions

View file

@ -7,6 +7,16 @@ GO_FMT ?= gofmt
IMAGE_BUILD_CMD ?= docker build
IMAGE_BUILD_EXTRA_OPTS ?=
IMAGE_PUSH_CMD ?= docker push
CONTAINER_RUN_CMD ?= docker run
# Docker base command for working with html documentation.
# Use host networking because 'jekyll serve' is stupid enough to use the
# 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)
SITE_SUBDIR ?=
JEKYLL_OPTS := -d _site/$(SITE_SUBDIR) -b /node-feature-discovery/$(SITE_SUBDIR)
VERSION := $(shell git describe --tags --dirty --always)
@ -105,3 +115,11 @@ poll-image:
echo Image $$image not found; \
exit 1; \
fi;
site-build:
@mkdir -p docs/vendor/bundle
$(SITE_BUILD_CMD) sh -c "bundle install && jekyll build $(JEKYLL_OPTS)"
site-serve:
@mkdir -p docs/vendor/bundle
$(SITE_BUILD_CMD) sh -c "bundle install && jekyll serve $(JEKYLL_OPTS) -H 127.0.0.1 -b ''"

View file

@ -17,7 +17,6 @@ title: Node Feature Discovery
description: >- # this means to ignore newlines until "baseurl:"
Documentation of Node Feature Discovery - a Kubernetes add-on for discovering
and advertising hardware features and system configuration in the cluster.
baseurl: "/node-feature-discovery" # the subpath of your site, e.g. /blog
url: "https://kubernetes-sigs.github.com" # the base hostname & protocol for your site, e.g. http://example.com
repository: kubernetes-sigs/node-feature-discovery