From 2519330bde16901c5380add6263be5aab3476767 Mon Sep 17 00:00:00 2001 From: lucperkins Date: Sat, 30 Mar 2019 18:53:23 -0700 Subject: [PATCH 1/3] Rework versioning system Signed-off-by: lucperkins --- docs/.gitignore | 2 +- docs/Makefile | 19 +++++++++++----- docs/config.toml | 23 ------------------- docs/generated/docs/.gitkeep | 0 docs/layouts/partials/home/banner.html | 31 +++++++++++++++++--------- docs/scripts/load-docs.sh | 6 +++-- 6 files changed, 40 insertions(+), 41 deletions(-) create mode 100644 docs/generated/docs/.gitkeep diff --git a/docs/.gitignore b/docs/.gitignore index 01d466af6f..b4f728858f 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -3,7 +3,7 @@ public/ resources/ # Documentation versions -content/docs/v* +generated/docs/v* data/releases.yaml # Node.js assets diff --git a/docs/Makefile b/docs/Makefile index 4df0d381ac..7a3a1fe19b 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,20 +1,29 @@ +clean: + rm -rf public + load-docs: scripts/load-docs.sh setup: npm install -serve: load-docs +serve: clean load-docs hugo server \ --buildDrafts \ - --buildFuture + --buildFuture \ + --contentDir generated -production-build: load-docs - hugo --minify +production-build: clean load-docs + hugo \ + --contentDir generated \ + --ignoreCache \ + --minify -preview-build: load-docs +preview-build: clean load-docs hugo \ --baseURL $(DEPLOY_PRIME_URL) \ --buildDrafts \ --buildFuture \ + --contentDir generated \ + --ignoreCache \ --minify diff --git a/docs/config.toml b/docs/config.toml index a764f72b29..1e02f09702 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -23,30 +23,7 @@ github = "https://github.com/open-policy-agent/opa" sidebar = "/img/logos/opa-stacked-color.png" navbar = "/img/logos/opa-icon-white.png" -[[params.home.buttons]] -url = "/docs/get-started" -title = "Get started" - -[[params.home.buttons]] -url = "/docs" -title = "Learn more" - [menu] -[[menu.main]] -name = "Documentation" -url = "/docs" -weight = 1 - -[[menu.main]] -name = "Tutorials" -url = "/docs/get-started" -weight = 2 - -[[menu.main]] -name = "Playground" -url = "https://play.openpolicyagent.org" -weight = 3 - [[menu.social]] name = "Medium" url = "https://twitter.com/openpolicyagent" diff --git a/docs/generated/docs/.gitkeep b/docs/generated/docs/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/layouts/partials/home/banner.html b/docs/layouts/partials/home/banner.html index f327f328fb..54cb2e47db 100644 --- a/docs/layouts/partials/home/banner.html +++ b/docs/layouts/partials/home/banner.html @@ -1,9 +1,8 @@ {{ $title := site.Title }} {{ $description := site.Params.description }} {{ $tagline := site.Params.tagline }} -{{ $buttons := site.Params.home.buttons }} -{{ $mainMenu := site.Menus.main }} {{ $socialMenu := site.Menus.social }} +{{ $latest := index site.Data.releases 0 }}