From 87179879d761efd60a92b82c272a274e33bde30f Mon Sep 17 00:00:00 2001 From: lucperkins Date: Thu, 4 Apr 2019 13:48:05 -0700 Subject: [PATCH] Update preview build to show latest instead of all versions Signed-off-by: lucperkins --- docs/Makefile | 14 +++++++++++--- docs/README.md | 20 +------------------- docs/layouts/partials/docs/sidenav.html | 2 +- docs/layouts/partials/home/banner.html | 8 ++++---- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 6aabec3f4d..9abfb2e29f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,10 +8,19 @@ setup: npm install serve: - hugo server \ + ENV=local hugo server \ --buildDrafts \ --buildFuture +docker-serve: + docker run --rm -it \ + -v $(PWD):/src \ + -p 1313:1313 \ + -e ENV=local \ + klakegg/hugo:0.53-ext server \ + --buildDrafts \ + --buildFuture + production-build: clean load-docs hugo \ --contentDir generated \ @@ -19,11 +28,10 @@ production-build: clean load-docs --minify preview-build: clean load-docs - hugo \ + ENV=local hugo \ --baseURL $(DEPLOY_PRIME_URL) \ --buildDrafts \ --buildFuture \ - --contentDir generated \ --ignoreCache \ --minify diff --git a/docs/README.md b/docs/README.md index 00cfd1bea3..7823374da5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,12 +29,7 @@ npm install Then, if [Docker is running](https://docs.docker.com/get-started/): ```bash -docker run --rm -it \ - -v $(PWD):/src \ - -p 1313:1313 \ - klakegg/hugo:0.53-ext server \ - --buildDrafts \ - --buildFuture +make docker-server ``` Open your browser to http://localhost:1313 to see the site running locally. The docs @@ -98,19 +93,6 @@ The OPA site is automatically published using [Netlify](https://netlify.com). Wh changes in this directory are pushed to `master`, the site will be re-built and re-deployed. -### OPA version changes - -The current OPA version displayed in the documentation is set in the -[`config.toml`](./config.toml) configuration file. Look for this in the file: - -```toml -[params.versions] -latest = "..." -``` - -Change the value of `latest` and commit that change to `master` to change the displayed -version in the docs. - ## Checking links To check the site's links, first install the [`htmlproofer`](https://github.com/gjtorikian/html-proofer) Ruby gem: diff --git a/docs/layouts/partials/docs/sidenav.html b/docs/layouts/partials/docs/sidenav.html index 63c52ee266..b2523b667c 100644 --- a/docs/layouts/partials/docs/sidenav.html +++ b/docs/layouts/partials/docs/sidenav.html @@ -1,4 +1,4 @@ -{{ $localMode := site.IsServer }} +{{ $localMode := eq (getenv "ENV") "local" }} {{ $docsHome := .CurrentSection }} {{ $allDocs := where site.RegularPages "Section" "docs" }} {{ $docs := where $allDocs ".Params.kind" "eq" "documentation" }} diff --git a/docs/layouts/partials/home/banner.html b/docs/layouts/partials/home/banner.html index 8998286f53..72ab66d43a 100644 --- a/docs/layouts/partials/home/banner.html +++ b/docs/layouts/partials/home/banner.html @@ -1,4 +1,4 @@ -{{ $localMode := site.IsServer }} +{{ $localMode := eq (getenv "ENV") "local" }} {{ $title := site.Title }} {{ $description := site.Params.description }} {{ $tagline := site.Params.tagline }} @@ -41,7 +41,7 @@ {{ .Name }} - + @@ -64,7 +64,7 @@ - Learn more + Learn more

@@ -72,4 +72,4 @@ - + \ No newline at end of file