From d17340d39473f0794d6faf89cb7095e6d4ea85e3 Mon Sep 17 00:00:00 2001 From: John Mulhausen Date: Tue, 19 Dec 2017 18:15:15 -0800 Subject: [PATCH] Speed up site rendering for authors (#5241) * rough pass at tabs, jsonification * GHPages 147, authoring YML, sitemap via plugin, working JS * Update Gemfile * Removing dk.rb artifact * Simplifying authoring YML even more * More YML simplification * Remove jekyll-seo -- even more perf gain * Glossary support * Collections support * Incremental off; GH Pages 172 gets build time to 50 seconds --- Gemfile | 36 +++++++- _config.yml | 26 +----- _config_authoring.yml | 123 ++++++++++++++++++++++++++ _data/toc.yaml | 6 -- _includes/navigation.html | 6 +- _includes/side-menu.html | 3 +- _includes/tree.html | 10 --- _includes/treebuilder.html | 23 ----- _layouts/docs.html | 31 +++++-- docsarchive.md | 4 +- get-started/part2.md | 5 +- index.md | 10 +-- js/collections_tocs.js | 12 +++ js/docs.js | 155 +++++++++++++++++++++++++++++++-- glossary.txt => js/glossary.js | 4 +- js/menu.js | 39 +++++---- metadata.txt => js/metadata.js | 6 +- js/toc.js | 5 ++ manuals.md | 24 ++--- sitemap.xml | 23 ----- 20 files changed, 396 insertions(+), 155 deletions(-) create mode 100644 _config_authoring.yml delete mode 100644 _includes/tree.html delete mode 100644 _includes/treebuilder.html create mode 100644 js/collections_tocs.js rename glossary.txt => js/glossary.js (93%) rename metadata.txt => js/metadata.js (65%) create mode 100644 js/toc.js delete mode 100644 sitemap.xml diff --git a/Gemfile b/Gemfile index b521bb46e7..1737264e06 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,37 @@ source "https://rubygems.org" # Update me once in a while: https://github.com/github/pages-gem/releases # Please ensure, before upgrading, that this version exists as a tag in starefossen/github-pages here: # https://hub.docker.com/r/starefossen/github-pages/tags/ -gem "github-pages", "137" -gem 'wdm', '>= 0.1.0' if Gem.win_platform? +# +# Fresh install? +# +# Windows: +# Install Ruby 2.3.3 x64 and download the Development Kit for 64-bit: +# https://rubyinstaller.org/downloads/ +# +# Run this to install devkit after extracting: +# ruby /dk.rb init +# ruby /dk.rb install +# +# then: +# gem install bundler +# bundle install +# +# Mac/Linux: +# Install Ruby 2.3.x and then: +# gem install bundler +# bundle install +# +# --------------------- +# Upgrading? Probably best to reset your environment: +# +# Remove all gems: +# gem uninstall -aIx +# +# (If Windows, do the dk.rb bits above, then go to the next step below) + +# Install anew: +# gem install bundler +# bundle install + +gem "github-pages", "172" +gem 'wdm' if Gem.win_platform? diff --git a/_config.yml b/_config.yml index c463c4a362..534c511497 100644 --- a/_config.yml +++ b/_config.yml @@ -61,10 +61,10 @@ collections: samples: output: true -gems: +plugins: - jekyll-redirect-from - - jekyll-seo-tag - jekyll-relative-links + - jekyll-sitemap defaults: - @@ -164,20 +164,17 @@ defaults: - scope: path: "datacenter/dtr/2.2" values: - hide_from_sitemap: true ucp_version: "2.1" dtr_version: "2.2" docker_image: "docker/dtr:2.2.10" - scope: path: "datacenter/dtr/2.1" values: - hide_from_sitemap: true ucp_version: "2.0" dtr_version: "2.1" - scope: path: "datacenter/dtr/2.0" values: - hide_from_sitemap: true ucp_version: "1.1" dtr_version: "2.0" - scope: @@ -189,39 +186,20 @@ defaults: - scope: path: "datacenter/ucp/2.1" values: - hide_from_sitemap: true ucp_version: "2.1" dtr_version: "2.2" docker_image: "docker/ucp:2.1.5" - scope: path: "datacenter/ucp/2.0" values: - hide_from_sitemap: true ucp_version: "2.0" dtr_version: "2.1" docker_image: "docker/ucp:2.0.3" - scope: path: "datacenter/ucp/1.1" values: - hide_from_sitemap: true ucp_version: "1.1" dtr_version: "2.0" - - scope: - path: "apidocs/v1.3.3" - values: - hide_from_sitemap: true - - scope: - path: "apidocs/v1.4.0" - values: - hide_from_sitemap: true - - scope: - path: "apidocs/v2.0.0" - values: - hide_from_sitemap: true - - scope: - path: "apidocs/v2.0.1" - values: - hide_from_sitemap: true # Assets # diff --git a/_config_authoring.yml b/_config_authoring.yml new file mode 100644 index 0000000000..fce5ccaa47 --- /dev/null +++ b/_config_authoring.yml @@ -0,0 +1,123 @@ +name: Docker Documentation +markdown: kramdown +kramdown: + input: GFM + html_to_native: true + hard_wrap: false + syntax_highlighter: rouge + toc_levels: 2..3 +permalink: pretty +safe: false +lsi: false +url: https://docs.docker.com +incremental: false + +# Component versions -- address like site.docker_ce_stable_version +# You can't have - characters in these for non-YAML reasons + +# TO USE ME: +# jekyll serve --incremental --config _config_authoring.yml + +docker_ce_stable_version: "17.09" +latest_stable_docker_engine_api_version: "1.32" +docker_ce_edge_version: "17.09" +docker_ee_version: "17.06" +compose_version: "1.16.1" +machine_version: "0.12.2" +distribution_version: "2.6" + +ucp_versions: + - version: "2.2" + latest: true + path: /datacenter/ucp/2.2/guides/ + - version: "2.1" + path: /datacenter/ucp/2.1/guides/ + - version: "2.0" + path: /datacenter/ucp/2.0/guides/ + - version: "1.1" + path: /datacenter/ucp/1.1/overview/ + +dtr_versions: + - version: "2.3" + latest: true + path: /datacenter/dtr/2.3/guides/ + - version: "2.2" + path: /datacenter/dtr/2.2/guides/ + - version: "2.1" + path: /datacenter/dtr/2.1/guides/ + - version: "2.0" + path: /datacenter/dtr/2.0/ + +defaults: + - + scope: + path: "" + type: "pages" + values: + layout: docs + defaultassignee: johndmulhausen + toc_min: 2 + toc_max: 3 + tree: true + - scope: + path: "engine" + values: + win_server_zip_url: "https://download.docker.com/components/engine/windows-server/17.06/docker-17.06.2-ee-4.zip" + - scope: + path: "datacenter" + values: + ucp_latest_image: "docker/ucp:2.2.3" + dtr_latest_image: "docker/dtr:2.3.4" + enterprise: true + - scope: + path: "datacenter/dtr/2.3" + values: + dtr_org: "docker" + dtr_repo: "dtr" + dtr_version: "2.3.4" + - scope: + path: "datacenter/dtr/2.2" + values: + ucp_version: "2.1" + dtr_version: "2.2" + docker_image: "docker/dtr:2.2.9" + - scope: + path: "datacenter/dtr/2.1" + values: + ucp_version: "2.0" + dtr_version: "2.1" + - scope: + path: "datacenter/dtr/2.0" + values: + ucp_version: "1.1" + dtr_version: "2.0" + - scope: + path: "datacenter/ucp/2.2" + values: + ucp_org: "docker" + ucp_repo: "ucp" + ucp_version: "2.2.3" + - scope: + path: "datacenter/ucp/2.1" + values: + ucp_version: "2.1" + dtr_version: "2.2" + docker_image: "docker/ucp:2.1.5" + - scope: + path: "datacenter/ucp/2.0" + values: + ucp_version: "2.0" + dtr_version: "2.1" + docker_image: "docker/ucp:2.0.3" + - scope: + path: "datacenter/ucp/1.1" + values: + ucp_version: "1.1" + dtr_version: "2.0" + +# Assets +# +# We specify the directory for Jekyll so we can use @imports. +sass: + sass_dir: _scss + style: :compressed diff --git a/_data/toc.yaml b/_data/toc.yaml index 8d9dfb3533..3c2b138010 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -153,7 +153,6 @@ guides: - path: /release-notes/docker-ce/ title: Docker CE nosync: true - - sectiontitle: Get started section: - sectiontitle: Get started with Docker @@ -176,7 +175,6 @@ guides: title: Network containers - path: /engine/docker-overview/ title: Docker overview - - sectiontitle: Develop with Docker section: - sectiontitle: Develop your apps on Docker @@ -240,7 +238,6 @@ guides: title: Understand container communication - path: /engine/userguide/networking/default_network/ipv6/ title: IPv6 with Docker - - sectiontitle: Manage application data section: - path: /engine/admin/volumes/ @@ -273,7 +270,6 @@ guides: title: Use the ZFS storage driver - path: /engine/userguide/storagedriver/vfs-driver/ title: Use the VFS storage driver - - sectiontitle: Run your app in production section: - sectiontitle: The basics @@ -453,7 +449,6 @@ guides: path: /engine/extend/config/ - path: /engine/extend/plugin_api/ title: Plugins API - - sectiontitle: Standards and compliance section: - path: /compliance/ @@ -464,7 +459,6 @@ guides: title: FedRAMP - path: /compliance/cis/ title: CIS - - sectiontitle: Open source at Docker section: - path: /opensource/ diff --git a/_includes/navigation.html b/_includes/navigation.html index d077198745..f83b06983d 100644 --- a/_includes/navigation.html +++ b/_includes/navigation.html @@ -17,12 +17,12 @@ \ No newline at end of file + diff --git a/_includes/side-menu.html b/_includes/side-menu.html index 8ebfbb054b..f800f927cb 100644 --- a/_includes/side-menu.html +++ b/_includes/side-menu.html @@ -1,5 +1,4 @@ {% if page.landing == true %}