Optimize configuration to reduce build-times

- remove wildcard match for defaults (this caused a ripple effect
  and slowed down total build time with 60 seconds?)
- skip generating metadata.json (which took 25+ seconds)
- skip generating sitemap.xml (10+ seconds)

Build-times before/after:

Production before:  132 seconds
Production after:    62 seconds
Development before: 121 seconds
Development after:   35 seconds

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-10-23 01:04:16 +02:00
parent 9b79a27ab4
commit 2fe7e6106a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 132 additions and 79 deletions

View File

@ -1,3 +1,8 @@
##
# Default configuration file
#
# This file overrides options set in _config.yml for production / deploy
##
name: Docker Documentation
markdown: kramdown
kramdown:
@ -11,11 +16,10 @@ incremental: true
permalink: pretty
safe: false
lsi: false
exclude: ["_samples", "_scripts", "404.html", "datacenter", "ee", "index.html"]
exclude: ["_samples", "_scripts", "404.html", "datacenter", "ee", "index.html", "js/metadata.json"]
# Component versions -- address like site.docker_ce_version
# You can't have - characters in these for non-YAML reasons
latest_engine_api_version: "1.40"
docker_ce_version: "19.03"
compose_version: "1.27.4"
@ -24,15 +28,34 @@ compose_file_v2: "2.4"
machine_version: "0.16.0"
distribution_version: "2.7"
collections:
samples:
output: true
# List of plugins to enable for local development builds. Mostly the same as
# for production, but without the "jekyll-sitemap" plugin, which is not needed
# for previewing, and excluding saves some time to build
plugins:
- jekyll-redirect-from
- jekyll-relative-links
- jekyll-sitemap
# Assets
#
# We specify the directory for Jekyll so we can use @imports.
#
# For local development, we build css with the "expanded" format to produce
# human-readable output for easier debugging.
sass:
sass_dir: _scss
style: expanded
# Set default options / metadata for some paths.
#
# Setting options here prevents having to repeat the same option in front-matter
# on every page. Avoid using wildcards, such as "path: engine/api/v1.*", as
# limitations in Jekyll cause those to introduce a _severe_ impact on build-time,
# affecting generation of (e.g.) sitemap.xml and metadata.json, resulting in the
# total build to take 60 seconds longer to build (!).
#
# The list below is for "development" (local builds, and PR previews) builds only,
# and should be kept minimal to allow for fast builds. Other options should go
# into _config_production.yml, which is used for production deploys.
defaults:
- scope:
path: ""
@ -42,78 +65,7 @@ defaults:
toc_min: 2
toc_max: 3
# Set the correct edit-URL for upstream resources. We usually don't create a direct
# edit link for these, and instead point to the directory that contains the file.
- scope:
path: engine/api/v1.*
values:
edit_url: "https://github.com/docker/docker/tree/master/docs/api"
- scope:
path: engine/deprecated
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/"
- scope:
path: engine/extend
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/extend"
- scope:
path: engine/reference
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/reference"
- scope:
path: engine/reference/commandline
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/reference/commandline"
skip_read_time: true
- scope:
path: glossary
values:
edit_url: "https://github.com/docker/docker.github.io/blob/master/_data/glossary.yaml"
- scope:
path: notary/reference
values:
edit_url: "https://github.com/theupdateframework/notary/tree/master/docs/reference"
- scope:
path: registry/configuration
values:
edit_url: "https://github.com/docker/distribution/tree/master/docs"
- scope:
path: registry/spec
values:
edit_url: "https://github.com/docker/distribution/tree/master/docs/spec"
- scope:
path: compliance
values:
edit_url: "https://github.com/mirantis/compliance/tree/master/docs/compliance"
# Hide Enterprise content from sitemap. These directories still contains stubs
# that are needed to redirect old URLs
- scope:
path: "datacenter"
values:
sitemap: false
title: Docker Enterprise moved to Mirantis
- scope:
path: "desktop/enterprise"
values:
sitemap: false
- scope:
path: "ee"
values:
sitemap: false
title: Docker Enterprise moved to Mirantis
- scope:
path: "machine"
values:
sitemap: false
- scope:
path: "samples/library"
values:
sitemap: false
# Assets
#
# We specify the directory for Jekyll so we can use @imports.
sass:
sass_dir: _scss
style: expanded

View File

@ -1,11 +1,112 @@
##
# This file overrides options set in _config.yml for production / deploy
##
# Include files that are excluded in "development" ("enterprise" stubs) for production
# Override the exclusion list to include files that are excluded in "development",
# such as the "enterprise" stubs, which are in place to facilitate redirects
# to Mirantis.
exclude: ["_scripts", "404.html", "index.html"]
# Google Analytics, etc.
google_analytics: GTM-WL2QLG5
polldaddy_id: 8453675
plugins:
- jekyll-redirect-from
- jekyll-relative-links
- jekyll-sitemap
# Assets
#
# For production/deploy, we build css with the "compressed" format, to produce
# smaller files.
sass:
style: compressed
collections:
samples:
output: true
# Set default options / metadata for some paths.
#
# Setting options here prevents having to repeat the same option in front-matter
# on every page. Avoid using wildcards, such as "path: engine/api/v1.*", as
# limitations in Jekyll cause those to introduce a _severe_ impact on build-time,
# affecting generation of (e.g.) sitemap.xml and metadata.json, resulting in the
# total build to take 60 seconds longer to build (!).
#
# The list below is used for *production* deploys, and overrides the one defined
# in "_config.yml", which is used for local builds and pull-request previews.
defaults:
- scope:
path: ""
type: "pages"
values:
layout: docs
toc_min: 2
toc_max: 3
# Set the correct edit-URL for upstream resources. We usually don't create a direct
# edit link for these, and instead point to the directory that contains the file.
- scope:
path: engine/deprecated.md
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/"
- scope:
path: engine/extend.md
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/extend"
- scope:
path: engine/reference
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/reference"
- scope:
path: engine/reference/commandline
values:
edit_url: "https://github.com/docker/cli/tree/master/docs/reference/commandline"
skip_read_time: true
- scope:
path: glossary.md
values:
edit_url: "https://github.com/docker/docker.github.io/blob/master/_data/glossary.yaml"
- scope:
path: notary/reference
values:
edit_url: "https://github.com/theupdateframework/notary/tree/master/docs/reference"
- scope:
path: registry/configuration
values:
edit_url: "https://github.com/docker/distribution/tree/master/docs"
- scope:
path: registry/spec
values:
edit_url: "https://github.com/docker/distribution/tree/master/docs/spec"
- scope:
path: compliance
values:
edit_url: "https://github.com/mirantis/compliance/tree/master/docs/compliance"
# Hide Enterprise content from sitemap. These directories still contains stubs
# that are needed to redirect old URLs
- scope:
path: "datacenter"
values:
sitemap: false
title: Docker Enterprise moved to Mirantis
- scope:
path: "desktop/enterprise"
values:
sitemap: false
- scope:
path: "ee"
values:
sitemap: false
title: Docker Enterprise moved to Mirantis
- scope:
path: "machine"
values:
sitemap: false
- scope:
path: "samples/library"
values:
sitemap: false