Skip to content

Commit d17340d

Browse files
Speed up site rendering for authors (docker#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
1 parent 48c139d commit d17340d

20 files changed

+396
-155
lines changed

Gemfile

+34-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,37 @@ source "https://rubygems.org"
33
# Update me once in a while: https://github.com/github/pages-gem/releases
44
# Please ensure, before upgrading, that this version exists as a tag in starefossen/github-pages here:
55
# https://hub.docker.com/r/starefossen/github-pages/tags/
6-
gem "github-pages", "137"
7-
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
6+
#
7+
# Fresh install?
8+
#
9+
# Windows:
10+
# Install Ruby 2.3.3 x64 and download the Development Kit for 64-bit:
11+
# https://rubyinstaller.org/downloads/
12+
#
13+
# Run this to install devkit after extracting:
14+
# ruby <path_to_devkit>/dk.rb init
15+
# ruby <path_to_devkit>/dk.rb install
16+
#
17+
# then:
18+
# gem install bundler
19+
# bundle install
20+
#
21+
# Mac/Linux:
22+
# Install Ruby 2.3.x and then:
23+
# gem install bundler
24+
# bundle install
25+
#
26+
# ---------------------
27+
# Upgrading? Probably best to reset your environment:
28+
#
29+
# Remove all gems:
30+
# gem uninstall -aIx
31+
#
32+
# (If Windows, do the dk.rb bits above, then go to the next step below)
33+
34+
# Install anew:
35+
# gem install bundler
36+
# bundle install
37+
38+
gem "github-pages", "172"
39+
gem 'wdm' if Gem.win_platform?

_config.yml

+2-24
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ collections:
6161
samples:
6262
output: true
6363

64-
gems:
64+
plugins:
6565
- jekyll-redirect-from
66-
- jekyll-seo-tag
6766
- jekyll-relative-links
67+
- jekyll-sitemap
6868

6969
defaults:
7070
-
@@ -164,20 +164,17 @@ defaults:
164164
- scope:
165165
path: "datacenter/dtr/2.2"
166166
values:
167-
hide_from_sitemap: true
168167
ucp_version: "2.1"
169168
dtr_version: "2.2"
170169
docker_image: "docker/dtr:2.2.10"
171170
- scope:
172171
path: "datacenter/dtr/2.1"
173172
values:
174-
hide_from_sitemap: true
175173
ucp_version: "2.0"
176174
dtr_version: "2.1"
177175
- scope:
178176
path: "datacenter/dtr/2.0"
179177
values:
180-
hide_from_sitemap: true
181178
ucp_version: "1.1"
182179
dtr_version: "2.0"
183180
- scope:
@@ -189,39 +186,20 @@ defaults:
189186
- scope:
190187
path: "datacenter/ucp/2.1"
191188
values:
192-
hide_from_sitemap: true
193189
ucp_version: "2.1"
194190
dtr_version: "2.2"
195191
docker_image: "docker/ucp:2.1.5"
196192
- scope:
197193
path: "datacenter/ucp/2.0"
198194
values:
199-
hide_from_sitemap: true
200195
ucp_version: "2.0"
201196
dtr_version: "2.1"
202197
docker_image: "docker/ucp:2.0.3"
203198
- scope:
204199
path: "datacenter/ucp/1.1"
205200
values:
206-
hide_from_sitemap: true
207201
ucp_version: "1.1"
208202
dtr_version: "2.0"
209-
- scope:
210-
path: "apidocs/v1.3.3"
211-
values:
212-
hide_from_sitemap: true
213-
- scope:
214-
path: "apidocs/v1.4.0"
215-
values:
216-
hide_from_sitemap: true
217-
- scope:
218-
path: "apidocs/v2.0.0"
219-
values:
220-
hide_from_sitemap: true
221-
- scope:
222-
path: "apidocs/v2.0.1"
223-
values:
224-
hide_from_sitemap: true
225203

226204
# Assets
227205
#

_config_authoring.yml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Docker Documentation
2+
markdown: kramdown
3+
kramdown:
4+
input: GFM
5+
html_to_native: true
6+
hard_wrap: false
7+
syntax_highlighter: rouge
8+
toc_levels: 2..3
9+
permalink: pretty
10+
safe: false
11+
lsi: false
12+
url: https://docs.docker.com
13+
incremental: false
14+
15+
# Component versions -- address like site.docker_ce_stable_version
16+
# You can't have - characters in these for non-YAML reasons
17+
18+
# TO USE ME:
19+
# jekyll serve --incremental --config _config_authoring.yml
20+
21+
docker_ce_stable_version: "17.09"
22+
latest_stable_docker_engine_api_version: "1.32"
23+
docker_ce_edge_version: "17.09"
24+
docker_ee_version: "17.06"
25+
compose_version: "1.16.1"
26+
machine_version: "0.12.2"
27+
distribution_version: "2.6"
28+
29+
ucp_versions:
30+
- version: "2.2"
31+
latest: true
32+
path: /datacenter/ucp/2.2/guides/
33+
- version: "2.1"
34+
path: /datacenter/ucp/2.1/guides/
35+
- version: "2.0"
36+
path: /datacenter/ucp/2.0/guides/
37+
- version: "1.1"
38+
path: /datacenter/ucp/1.1/overview/
39+
40+
dtr_versions:
41+
- version: "2.3"
42+
latest: true
43+
path: /datacenter/dtr/2.3/guides/
44+
- version: "2.2"
45+
path: /datacenter/dtr/2.2/guides/
46+
- version: "2.1"
47+
path: /datacenter/dtr/2.1/guides/
48+
- version: "2.0"
49+
path: /datacenter/dtr/2.0/
50+
51+
defaults:
52+
-
53+
scope:
54+
path: ""
55+
type: "pages"
56+
values:
57+
layout: docs
58+
defaultassignee: johndmulhausen
59+
toc_min: 2
60+
toc_max: 3
61+
tree: true
62+
- scope:
63+
path: "engine"
64+
values:
65+
win_server_zip_url: "https://download.docker.com/components/engine/windows-server/17.06/docker-17.06.2-ee-4.zip"
66+
- scope:
67+
path: "datacenter"
68+
values:
69+
ucp_latest_image: "docker/ucp:2.2.3"
70+
dtr_latest_image: "docker/dtr:2.3.4"
71+
enterprise: true
72+
- scope:
73+
path: "datacenter/dtr/2.3"
74+
values:
75+
dtr_org: "docker"
76+
dtr_repo: "dtr"
77+
dtr_version: "2.3.4"
78+
- scope:
79+
path: "datacenter/dtr/2.2"
80+
values:
81+
ucp_version: "2.1"
82+
dtr_version: "2.2"
83+
docker_image: "docker/dtr:2.2.9"
84+
- scope:
85+
path: "datacenter/dtr/2.1"
86+
values:
87+
ucp_version: "2.0"
88+
dtr_version: "2.1"
89+
- scope:
90+
path: "datacenter/dtr/2.0"
91+
values:
92+
ucp_version: "1.1"
93+
dtr_version: "2.0"
94+
- scope:
95+
path: "datacenter/ucp/2.2"
96+
values:
97+
ucp_org: "docker"
98+
ucp_repo: "ucp"
99+
ucp_version: "2.2.3"
100+
- scope:
101+
path: "datacenter/ucp/2.1"
102+
values:
103+
ucp_version: "2.1"
104+
dtr_version: "2.2"
105+
docker_image: "docker/ucp:2.1.5"
106+
- scope:
107+
path: "datacenter/ucp/2.0"
108+
values:
109+
ucp_version: "2.0"
110+
dtr_version: "2.1"
111+
docker_image: "docker/ucp:2.0.3"
112+
- scope:
113+
path: "datacenter/ucp/1.1"
114+
values:
115+
ucp_version: "1.1"
116+
dtr_version: "2.0"
117+
118+
# Assets
119+
#
120+
# We specify the directory for Jekyll so we can use @imports.
121+
sass:
122+
sass_dir: _scss
123+
style: :compressed

_data/toc.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ guides:
153153
- path: /release-notes/docker-ce/
154154
title: Docker CE
155155
nosync: true
156-
157156
- sectiontitle: Get started
158157
section:
159158
- sectiontitle: Get started with Docker
@@ -176,7 +175,6 @@ guides:
176175
title: Network containers
177176
- path: /engine/docker-overview/
178177
title: Docker overview
179-
180178
- sectiontitle: Develop with Docker
181179
section:
182180
- sectiontitle: Develop your apps on Docker
@@ -240,7 +238,6 @@ guides:
240238
title: Understand container communication
241239
- path: /engine/userguide/networking/default_network/ipv6/
242240
title: IPv6 with Docker
243-
244241
- sectiontitle: Manage application data
245242
section:
246243
- path: /engine/admin/volumes/
@@ -273,7 +270,6 @@ guides:
273270
title: Use the ZFS storage driver
274271
- path: /engine/userguide/storagedriver/vfs-driver/
275272
title: Use the VFS storage driver
276-
277273
- sectiontitle: Run your app in production
278274
section:
279275
- sectiontitle: The basics
@@ -453,7 +449,6 @@ guides:
453449
path: /engine/extend/config/
454450
- path: /engine/extend/plugin_api/
455451
title: Plugins API
456-
457452
- sectiontitle: Standards and compliance
458453
section:
459454
- path: /compliance/
@@ -464,7 +459,6 @@ guides:
464459
title: FedRAMP
465460
- path: /compliance/cis/
466461
title: CIS
467-
468462
- sectiontitle: Open source at Docker
469463
section:
470464
- path: /opensource/

_includes/navigation.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
</div>
1818
<div class="nav-container">
1919
<div id="tabs">
20-
<ul class="tabs">
21-
{% include treebuilder.html %}
20+
<ul class="tabs" id="jsTOCHorizontal">
21+
2222
</ul>
2323
</div>
2424
<div class="ctrl-right hidden-xs hidden-sm">
2525
<a href="javascript:void(0)" id="menu-toggle"><i class="fa fa-indent" aria-hidden="true"></i></a>
2626
{% include archive-list.html %}
2727
</div>
28-
</div>
28+
</div>

_includes/side-menu.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{% if page.landing == true %}<div id="navbar" class="nav-sidebar">{%else%}<div id="navbar" class="nav-sidebar">{% endif %}
2-
<ul class="nav">
3-
{{ leftnav }}
2+
<ul class="nav" id="jsTOCLeftNav">
43
</ul>
54
</div>

_includes/tree.html

-10
This file was deleted.

_includes/treebuilder.html

-23
This file was deleted.

_layouts/docs.html

+23-8
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,18 @@
9797
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
9898
<!-- temp css will be removed -->
9999
<link rel="stylesheet" href="/css/temp.css">
100-
{% seo %}
100+
<!-- SEO stuff -->
101+
<title>{{ page.title }} | Docker Documentation</title>
102+
<meta property="og:title" content="{{ page.title }}" />
103+
<meta property="og:locale" content="en_US" />
104+
<meta name="description" content="{{ page.description }}" />
105+
<meta property="og:description" content="{{ page.description }}" />
106+
<link rel="canonical" href="{{ page.url }}" />
107+
<meta property="og:url" content="https://docs.docker.com{{ page.url }}" />
108+
<meta property="og:site_name" content="Docker Documentation" />
109+
<script type="application/ld+json">
110+
{"@context":"http://schema.org","@type":"WebPage","headline":"{{ page.title }}","description":"{{ page.description }}","url":"https://docs.docker.com{{ page.url }}"}</script>
111+
<!-- END SEO STUFF -->
101112
{% if page.hide_from_sitemap %}<meta name="robots" content="noindex" />{% endif %}
102113
<script language="javascript">
103114
// Default to assuming this is an archive and hiding some stuff
@@ -296,20 +307,24 @@ <h2>Next steps</h2>
296307
<script src="/js/jquery.js"></script>
297308
<script src="/js/bootstrap.min.js"></script>
298309
<!-- Always include the archive.js, but it doesn't do much unless we are an archive -->
310+
<script language="javascript">
311+
// Default to assuming this is an archive and hiding some stuff
312+
// See js/archive.js and js/docs.js for logic relating to this
313+
var isArchive = true;
314+
var dockerVersion = 'v{{ site.docker_ce_stable_version }}';
315+
var pageURL = '{{ page.url }}';
316+
</script>
299317
<script src="/js/archive.js"></script>
300318
<script src="/js/stickyfill.min.js"></script>
319+
<script defer src="/js/metadata.js"></script>
320+
<script src="/js/glossary.js"></script>
321+
<script src="/js/collections_tocs.js"></script>
301322
<script defer src="/js/docs.js"></script>
323+
<script defer src="/js/toc.js"></script>
302324
<script language="javascript">
303325
jQuery(document).ready(function(){
304-
$.getJSON( "/metadata.txt", function( data ) {
305-
metadata = data;
306326
hookupTOCEvents();
307-
$.getJSON( "/glossary.txt", function( data ) {
308-
glossary = data;
309-
renderTagsPage();
310-
});
311327
});
312-
});
313328
</script>
314329
</body>
315330

0 commit comments

Comments
 (0)