Skip to content

Commit

Permalink
Speed up site rendering for authors (docker#5241)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
johndmulhausen authored Dec 20, 2017
1 parent 48c139d commit d17340d
Show file tree
Hide file tree
Showing 20 changed files with 396 additions and 155 deletions.
36 changes: 34 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path_to_devkit>/dk.rb init
# ruby <path_to_devkit>/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?
26 changes: 2 additions & 24 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ collections:
samples:
output: true

gems:
plugins:
- jekyll-redirect-from
- jekyll-seo-tag
- jekyll-relative-links
- jekyll-sitemap

defaults:
-
Expand Down Expand Up @@ -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:
Expand All @@ -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
#
Expand Down
123 changes: 123 additions & 0 deletions _config_authoring.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 0 additions & 6 deletions _data/toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ guides:
- path: /release-notes/docker-ce/
title: Docker CE
nosync: true

- sectiontitle: Get started
section:
- sectiontitle: Get started with Docker
Expand All @@ -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
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -453,7 +449,6 @@ guides:
path: /engine/extend/config/
- path: /engine/extend/plugin_api/
title: Plugins API

- sectiontitle: Standards and compliance
section:
- path: /compliance/
Expand All @@ -464,7 +459,6 @@ guides:
title: FedRAMP
- path: /compliance/cis/
title: CIS

- sectiontitle: Open source at Docker
section:
- path: /opensource/
Expand Down
6 changes: 3 additions & 3 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
</div>
<div class="nav-container">
<div id="tabs">
<ul class="tabs">
{% include treebuilder.html %}
<ul class="tabs" id="jsTOCHorizontal">

</ul>
</div>
<div class="ctrl-right hidden-xs hidden-sm">
<a href="javascript:void(0)" id="menu-toggle"><i class="fa fa-indent" aria-hidden="true"></i></a>
{% include archive-list.html %}
</div>
</div>
</div>
3 changes: 1 addition & 2 deletions _includes/side-menu.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% if page.landing == true %}<div id="navbar" class="nav-sidebar">{%else%}<div id="navbar" class="nav-sidebar">{% endif %}
<ul class="nav">
{{ leftnav }}
<ul class="nav" id="jsTOCLeftNav">
</ul>
</div>
10 changes: 0 additions & 10 deletions _includes/tree.html

This file was deleted.

23 changes: 0 additions & 23 deletions _includes/treebuilder.html

This file was deleted.

31 changes: 23 additions & 8 deletions _layouts/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,18 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<!-- temp css will be removed -->
<link rel="stylesheet" href="/css/temp.css">
{% seo %}
<!-- SEO stuff -->
<title>{{ page.title }} | Docker Documentation</title>
<meta property="og:title" content="{{ page.title }}" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="{{ page.description }}" />
<meta property="og:description" content="{{ page.description }}" />
<link rel="canonical" href="{{ page.url }}" />
<meta property="og:url" content="https://docs.docker.com{{ page.url }}" />
<meta property="og:site_name" content="Docker Documentation" />
<script type="application/ld+json">
{"@context":"http://schema.org","@type":"WebPage","headline":"{{ page.title }}","description":"{{ page.description }}","url":"https://docs.docker.com{{ page.url }}"}</script>
<!-- END SEO STUFF -->
{% if page.hide_from_sitemap %}<meta name="robots" content="noindex" />{% endif %}
<script language="javascript">
// Default to assuming this is an archive and hiding some stuff
Expand Down Expand Up @@ -296,20 +307,24 @@ <h2>Next steps</h2>
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
<!-- Always include the archive.js, but it doesn't do much unless we are an archive -->
<script language="javascript">
// Default to assuming this is an archive and hiding some stuff
// See js/archive.js and js/docs.js for logic relating to this
var isArchive = true;
var dockerVersion = 'v{{ site.docker_ce_stable_version }}';
var pageURL = '{{ page.url }}';
</script>
<script src="/js/archive.js"></script>
<script src="/js/stickyfill.min.js"></script>
<script defer src="/js/metadata.js"></script>
<script src="/js/glossary.js"></script>
<script src="/js/collections_tocs.js"></script>
<script defer src="/js/docs.js"></script>
<script defer src="/js/toc.js"></script>
<script language="javascript">
jQuery(document).ready(function(){
$.getJSON( "/metadata.txt", function( data ) {
metadata = data;
hookupTOCEvents();
$.getJSON( "/glossary.txt", function( data ) {
glossary = data;
renderTagsPage();
});
});
});
</script>
</body>

Expand Down
Loading

0 comments on commit d17340d

Please sign in to comment.