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
This commit is contained in:
John Mulhausen 2017-12-19 18:15:15 -08:00 committed by GitHub
parent 48c139d98c
commit d17340d394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 396 additions and 155 deletions

36
Gemfile
View File

@ -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?

View File

@ -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
#

123
_config_authoring.yml Normal file
View File

@ -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

View File

@ -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/

View File

@ -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>

View File

@ -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>

View File

@ -1,10 +0,0 @@
{% assign foundBranch="false" %}
{% for item in tree %}
{% if item.generateTOC %}{% include generateTOC.html tocToGenerate=item.generateTOC %}{% else %}
{% if item.sectiontitle %}{% if foundBranch=="false" %}{% capture treeString %}{{ item.section | downcase }}{% endcapture %}{% capture pageURLString %}"{{ page.url }}"{% endcapture %}{% else %}{% assign treeString="" %}{% endif %}
<li><a data-target="#item{{ forloop.index }}" data-toggle="collapse" data-parent="#stacked-menu"{% if treeString contains pageURLString %}{% assign foundBranch="true"%} aria-expanded="true"{% else %} class="collapsed" aria-expanded="false"{% endif %}>{{ item.sectiontitle }}<span class="caret arrow"></span></a>
<ul class="nav collapse{% if foundBranch == "true" %} in{% endif %}" id="#item{{ forloop.index }}" aria-expanded="{% if foundBranch == "true" %}true{% else %}false{% endif %}">{% assign tree = item.section %}{% include tree.html %}</ul>
</li>
{% else %}
<li><a href="{{ item.path }}"{% if item.path == page.url and item.nosync != true %} class="active currentPage"{% endif %}>{{ item.title }}</a></li>
{% endif %}{% endif %}{% endfor %}

View File

@ -1,23 +0,0 @@
{% assign topicFound="false" %}
{% for section in site.data.toc.horizontalnav %}
{% assign activeCSS = "" %}
{% if topicFound=="false" %}
{% if section.node == "glossary" %}
{% capture leftnav %}{% for entry in site.data.glossary %}
<li><a href="/glossary/?term={{ entry[0] }}">{{ entry[0] }}</a></li>{% endfor %}{% endcapture %}
{% if page.url == "/glossary/" %}
{% assign topicFound = "true" %}
{% capture leftnav %}<li><a href="/glossary/" class="active currentPage">Glossary Home</a></li>{{ leftnav }}{% endcapture %}
{% endif %}
{% else %}
{% assign tree = site.data.toc[section.node] %}
{% capture thisSection %}{% include tree.html %}{% endcapture %}
{% if section.path == page.url or thisSection contains "active currentPage" %}
{% capture leftnav %}{{ thisSection }}{% endcapture %}
{% capture activeCSS %} class="active"{% endcapture %}
{% assign topicFound="true" %}
{% endif %}
{% endif %}
{% endif %}
<li id="{{ section.node }}"{{ activeCSS }}><a href="{{ section.path }}">{{ section.title }}</a></li>
{% endfor %}

View File

@ -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
@ -296,20 +307,24 @@
<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>

View File

@ -12,7 +12,7 @@ prior version of Docker was shipped.
## {{ archive.name }} (current)
Docs for {{ archive.name }} _(current)_ are accessible at [**https://docs.docker.com/**](/), or
run:
to view the docs offline on your local machine, run:
```
docker run -ti -p 4000:4000 {{ archive.image }}
@ -24,7 +24,7 @@ docker run -ti -p 4000:4000 {{ archive.image }}
## {{ archive.name }}
Docs for {{ archive.name }} are accessible at [**https://docs.docker.com/{{ archive.name }}/**](/{{ archive.name }}/), or
Docs for {{ archive.name }} are accessible at [**https://docs.docker.com/{{ archive.name }}/**](/{{ archive.name }}/), or to view the docs offline on your local machine,
run:
```

View File

@ -44,7 +44,7 @@ runtime, all travel together.
These portable images are defined by something called a `Dockerfile`.
## Define a container with a `Dockerfile`
## Define a container with `Dockerfile`
`Dockerfile` will define what goes on in the environment inside your
container. Access to resources like networking interfaces and disk drives is
@ -202,8 +202,7 @@ mapped port 80 of that container to 4000, making the correct URL
`http://localhost:4000`.
Go to that URL in a web browser to see the display content served up on a
web page, including "Hello World" text, the container ID, and the Redis error
message.
web page.
![Hello World in browser](images/app-in-browser.png)

View File

@ -13,9 +13,9 @@ notags: true
## Get started with Docker
Try our new multi-part walkthrough that goes from writing your first app,
data storage, networking, and swarms, ending with your app running on
production servers in the cloud. Total reading time is less than an hour!
Try our new multi-part walkthrough that covers writing your first app,
data storage, networking, and swarms, and ends with your app running on
production servers in the cloud. Total reading time is less than an hour.
[Get started with Docker](/get-started/){: class="button outline-btn"}
@ -26,8 +26,8 @@ production servers in the cloud. Total reading time is less than an hour!
Run your solution in production with Docker Enterprise Edition and you'll get a
management dashboard, security scanning, LDAP integration, content signing,
multi-cloud support, and more. Click below to test
drive a running instance of Docker EE, without installing anything.
multi-cloud support, and more. Click below to test-drive a running instance of
Docker EE without installing anything.
[Try Docker Enterprise Edition](https://dockertrial.com){: class="button outline-btn" onclick="ga('send', 'event', 'EE Trial Referral', 'Front Page', 'Click');"}

12
js/collections_tocs.js Normal file
View File

@ -0,0 +1,12 @@
---
layout: null
---
var collectionsTOC = new Array()
collectionsTOC["library"] = [
{% for page in site.samples %}
{
"path":{{ page.url | jsonify }},
"title":{{ page.title | jsonify }}
}{% unless forloop.last%},{% endunless %}
{% endfor %}
]

View File

@ -18,10 +18,151 @@ if (current[0]) {
}
}
function addMyClass(classToAdd) {
var classString = this.className; // returns the string of all the classes for myDiv
// Adds the class "main__section" to the string (notice the leading space)
this.className = newClass; // sets className to the new string
}
function navClicked(sourceLink)
{
var classString = document.getElementById('#item' + sourceLink).className;
if (classString.indexOf(' in') > -1)
{
//collapse
var newClass = classString.replace(' in','');
document.getElementById('#item' + sourceLink).className = newClass;
} else {
//expand
var newClass = classString.concat(' in');
document.getElementById('#item' + sourceLink).className = newClass;
}
}
var outputHorzTabs = new Array();
var outputLetNav = new Array();
var totalTopics = 0;
var currentSection;
var sectionToHighlight;
function findMyTopic(tree)
{
function processBranch(branch)
{
for (var k=0;k<branch.length;k++)
{
if (branch[k].section) {
processBranch(branch[k].section);
} else {
if (branch[k].path == pageURL && !branch[k].nosync)
{
console.log(branch[k].path + ' was == ' + pageURL)
thisIsIt = true;
break;
} else {
console.log(branch[k].path + ' was != ' + pageURL)
}
}
}
}
var thisIsIt = false;
processBranch(tree)
return thisIsIt;
}
function walkTree(tree)
{
for (var j=0;j<tree.length;j++)
{
totalTopics++;
if (tree[j].section)
{
var sectionHasPath = findMyTopic(tree[j].section);
outputLetNav.push('<li><a onclick="navClicked(' + totalTopics +')" data-target="#item' + totalTopics +'" data-toggle="collapse" data-parent="#stacked-menu"')
if (sectionHasPath)
{
outputLetNav.push('aria-expanded="true"')
} else {
outputLetNav.push('class="collapsed" aria-expanded="false"')
}
outputLetNav.push('>' + tree[j].sectiontitle + '<span class="caret arrow"></span></a>');
outputLetNav.push('<ul class="nav collapse');
if (sectionHasPath) outputLetNav.push(' in');
outputLetNav.push('" id="#item' + totalTopics + '" aria-expanded="');
if (sectionHasPath)
{
outputLetNav.push('true');
} else {
outputLetNav.push('false');
}
outputLetNav.push('">');
var subTree = tree[j].section;
walkTree(subTree);
outputLetNav.push('</ul></li>');
} else if (tree[j].generateTOC) {
// auto-generate a TOC from a collection
walkTree(collectionsTOC[tree[j].generateTOC])
} else {
// just a regular old topic; this is a leaf, not a branch; render a link!
outputLetNav.push('<li><a href="' + tree[j].path + '"')
if (tree[j].path == pageURL && !tree[j].nosync)
{
sectionToHighlight = currentSection;
outputLetNav.push('class="active currentPage"')
}
outputLetNav.push('>'+tree[j].title+'</a></li>')
}
}
}
function renderNav(docstoc) {
for (i=0;i<docstoc.horizontalnav.length;i++)
{
if (docstoc.horizontalnav[i].node != "glossary")
{
currentSection = docstoc.horizontalnav[i].node;
// build vertical nav
var itsHere = findMyTopic(docstoc[docstoc.horizontalnav[i].node]);
if (itsHere || docstoc.horizontalnav[i].path == pageURL)
{
walkTree(docstoc[docstoc.horizontalnav[i].node]);
}
}
// build horizontal nav
outputHorzTabs.push('<li id="' + docstoc.horizontalnav[i].node + '"');
if (docstoc.horizontalnav[i].path==pageURL || docstoc.horizontalnav[i].node==sectionToHighlight)
{
outputHorzTabs.push(' class="active"');
}
outputHorzTabs.push('><a href="'+docstoc.horizontalnav[i].path+'">'+docstoc.horizontalnav[i].title+'</a></li>\n');
}
if (outputLetNav.length==0)
{
// didn't find the current topic in the standard TOC; maybe it's a collection;
for (var key in collectionsTOC)
{
var itsHere = findMyTopic(collectionsTOC[key]);
if (itsHere) {
walkTree(collectionsTOC[key]);
break;
}
}
// either glossary was true or no left nav has been built; default to glossary
// show pages tagged with term and highlight term in left nav if applicable
renderTagsPage()
for (var i=0;i<glossary.length;i++)
{
var highlightGloss = '';
if (tagToLookup) highlightGloss = (glossary[i].term.toLowerCase()==tagToLookup.toLowerCase()) ? ' class="active currentPage"' : '';
outputLetNav.push('<li><a'+highlightGloss+' href="/glossary/?term=' + glossary[i].term + '">'+glossary[i].term+'</a></li>');
}
}
document.getElementById('jsTOCHorizontal').innerHTML = outputHorzTabs.join('');
document.getElementById('jsTOCLeftNav').innerHTML = outputLetNav.join('');
}
function highlightRightNav(heading)
{
if (document.location.pathname.indexOf("/glossary/")<0){
console.log("highlightRightNav called on",document.location.pathname)
//console.log("highlightRightNav called on",document.location.pathname)
if (heading == "title")
{
history.replaceState({},"Top of page on " + document.location.pathname,document.location.protocol +"//"+ document.location.hostname + (location.port ? ':'+location.port: '') + document.location.pathname);
@ -295,22 +436,22 @@ window.onload = function() {
// isArchive is set by logic in archive.js
if ( isArchive == false ) {
console.log("Showing content that should only be in the current version.");
//console.log("Showing content that should only be in the current version.");
// Hide elements that are not appropriate for archives
// PollDaddy
$('#ratings-div').css("visibility","visible");
console.log("Ratings widget shown.");
//console.log("Ratings widget shown.");
// Archive drop-down
$('.ctrl-right .btn-group').css("visibility","visible");
console.log("Archive widget shown.");
//console.log("Archive widget shown.");
// Swarch
$('.search-form').css("visibility","visible");
console.log("Search widget shown.");
//console.log("Search widget shown.");
// Page edit link
$('.feedback-links li').first().css("visibility","visible");
console.log("Page edit link shown.");
//console.log("Page edit link shown.");
} else {
console.log("Keeping non-applicable elements hidden.");
//console.log("Keeping non-applicable elements hidden.");
}
};

View File

@ -1,8 +1,7 @@
---
layout: null
---
{
"terms":[
var glossary = [
{% for entry in site.data.glossary %}
{
"term": {{ entry[0] | jsonify }},
@ -10,4 +9,3 @@ layout: null
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}

View File

@ -101,10 +101,10 @@ function hookupTOCEvents()
loadPage("/search/?q=" + $("#st-search-input").val());
} else {
// an autocomplete result is selected
loadPage(metadata.pages[displayingAutcompleteResults[autoCompleteShowingID]].url);
loadPage(pages[displayingAutcompleteResults[autoCompleteShowingID]].url);
}
}
//console.log('autoCompleteShowingID:',autoCompleteShowingID,'displayingAutcompleteResults[id]:',displayingAutcompleteResults[autoCompleteShowingID],'metadata.pages[id].url:',metadata.pages[displayingAutcompleteResults[autoCompleteShowingID]].url);
//console.log('autoCompleteShowingID:',autoCompleteShowingID,'displayingAutcompleteResults[id]:',displayingAutcompleteResults[autoCompleteShowingID],'pages[id].url:',pages[displayingAutcompleteResults[autoCompleteShowingID]].url);
}
var searchVal = $("#st-search-input").val();
if (lastSearch != searchVal)
@ -115,10 +115,10 @@ function hookupTOCEvents()
//console.log("input changed: ",$("#st-search-input").val());
if (searchVal.length > 2) {
for (i=0;i<metadata.pages.length;i++)
for (i=0;i<pages.length;i++)
{
// search url, description, title, and keywords for search input
var thisPage = metadata.pages[i];
var thisPage = pages[i];
var matchesTitle=0, matchesDescription=0, matchesURL=0, matchesKeywords=0;
var matchesTitle = matches(String(thisPage.title).toUpperCase(),uppercaseSearchVal);
//if (titleMatches > 0) console.log(uppercaseSearchVal,'matches',thisPage.title,titleMatches,'times');
@ -148,29 +148,29 @@ function hookupTOCEvents()
{
//console.log(i, "of", autoCompleteResultLimit, "is underway");
displayingAutcompleteResults.push(results[i].topic); //log results to global array
resultsOutput.push("<div class='autoCompleteResult' id='autoCompleteResult" + i + "' onclick='loadPage(\"" + metadata.pages[results[i].topic].url + "\")'>");
resultsOutput.push("<div class='autoCompleteResult' id='autoCompleteResult" + i + "' onclick='loadPage(\"" + pages[results[i].topic].url + "\")'>");
resultsOutput.push("<ul class='autocompleteList'>");
resultsOutput.push("<li id='autoTitle" + i + "' class='autocompleteTitle'>")
resultsOutput.push("<a href=" + metadata.pages[results[i].topic].url + ">" + highlightMe(metadata.pages[results[i].topic].title,searchVal) + "</a>");
resultsOutput.push("<a href=" + pages[results[i].topic].url + ">" + highlightMe(pages[results[i].topic].title,searchVal) + "</a>");
resultsOutput.push("</li>");
resultsOutput.push("<li id='autoUrl" + i + "' class='autocompleteUrl'>")
resultsOutput.push(highlightMe(metadata.pages[results[i].topic].url,searchVal));
resultsOutput.push(highlightMe(pages[results[i].topic].url,searchVal));
resultsOutput.push("</li>");
/*
resultsOutput.push("<li id='autoBreadcrumb" + i + "' class='autocompleteBreadcrumb'>")
resultsOutput.push("Breadcrumb: " + breadcrumbString(metadata.pages[results[i]].url));
resultsOutput.push("Breadcrumb: " + breadcrumbString(pages[results[i]].url));
resultsOutput.push("</li>");
*/
if (metadata.pages[results[i].topic].keywords)
if (pages[results[i].topic].keywords)
{
resultsOutput.push("<li id='autoKeywords" + i + "' class='autocompleteKeywords'>")
resultsOutput.push("<b>Keywords</b>: <i>" + highlightMe(metadata.pages[results[i].topic].keywords,searchVal) + "</i>");
resultsOutput.push("<b>Keywords</b>: <i>" + highlightMe(pages[results[i].topic].keywords,searchVal) + "</i>");
resultsOutput.push("</li>");
}
if (metadata.pages[results[i].topic].description)
if (pages[results[i].topic].description)
{
resultsOutput.push("<li id='autoDescription" + i + "' class='autocompleteDescription'>")
resultsOutput.push("<b>Description</b>: " + highlightMe(metadata.pages[results[i].topic].description,searchVal));
resultsOutput.push("<b>Description</b>: " + highlightMe(pages[results[i].topic].description,searchVal));
resultsOutput.push("</li>");
}
resultsOutput.push("</ul>");
@ -209,9 +209,9 @@ function queryString()
function renderTopicsByTagTable(tagToLookup,divID)
{
var matchingPages = new Array();
for (i=0;i<metadata.pages.length;i++)
for (i=0;i<pages.length;i++)
{
thisPage = metadata.pages[i];
thisPage = pages[i];
if (thisPage.keywords)
{
var keywordArray = thisPage.keywords.toString().split(",");
@ -230,18 +230,19 @@ function renderTopicsByTagTable(tagToLookup,divID)
pagesOutput.push("<h2>Pages tagged with: " + tagToLookup + "</h2>");
pagesOutput.push("<table><thead><tr><td>Page</td><td>Description</td></tr></thead><tbody>");
for(i=0;i<matchingPages.length;i++) {
thisPage = metadata.pages[matchingPages[i]];
thisPage = pages[matchingPages[i]];
pagesOutput.push("<tr><td><a href='" + thisPage.url + "'>" + thisPage.title + "</a></td><td>" + thisPage.description + "</td></tr>");
}
pagesOutput.push("</tbody></table>");
}
$("#" + divID).html(pagesOutput.join(""));
}
var tagToLookup;
function renderTagsPage()
{
if(window.location.pathname.indexOf("/glossary/")>-1 || window.location.pathname.indexOf("/search/")>-1)
{
var tagToLookup;
if (window.location.pathname.indexOf("/glossary/")>-1)
{
// Get ?term=<value>
@ -254,11 +255,11 @@ function renderTagsPage()
tagToLookup = decodeURI(queryString().q);
}
// Get the term and definition
for (i=0;i<glossary.terms.length;i++)
for (i=0;i<glossary.length;i++)
{
if (glossary.terms[i].term.toLowerCase()==tagToLookup.toLowerCase())
if (glossary[i].term.toLowerCase()==tagToLookup.toLowerCase())
{
var glossaryOutput = glossary.terms[i].def;
var glossaryOutput = glossary[i].def;
}
}
if (glossaryOutput) {

View File

@ -1,8 +1,8 @@
---
layout: null
---
{% assign firstPage = "yes" %}{
"pages":[{% for page in site.pages %}{% if page.title and page.hide_from_sitemap != true %}{% if firstPage == "no" %},{% else %}{% assign firstPage = "no" %}{% endif %}
var pages = [{% assign firstPage = "yes" %}
{% for page in site.pages %}{% if page.title and page.hide_from_sitemap != true %}{% if firstPage == "no" %},{% else %}{% assign firstPage = "no" %}{% endif %}
{
"url":{{ page.url | jsonify }},
"title":{{ page.title | jsonify }},
@ -17,4 +17,4 @@ layout: null
"description":{{ page.description | strip | jsonify }},
"keywords":{{ page.keywords | jsonify }}
}
{% endfor %}]}
{% endfor %}]

5
js/toc.js Normal file
View File

@ -0,0 +1,5 @@
---
layout: null
---
var docstoc = {{ site.data.toc | jsonify }}
renderNav(docstoc);

View File

@ -31,24 +31,24 @@ Digital Ocean, Packet, SoftLayer, or Bring Your Own Cloud.
Free downloadables that help your device use Docker containers.
| Tool | Description |
| ---- | ----------- |
| [Docker Compose](/compose/overview/) | Enables you to define, build, and run multi-container applications |
| [Docker Machine](/machine/overview/) | Enables you to provision and manage Dockerized hosts |
| [Docker Notary](/notary/getting_started/) | Allows the signing of container images to enable Docker Content Trust |
| [Docker Registry](/registry/) | The software that powers Docker Hub and Docker Store, Registry stores and distributes container images |
| Tool | Description |
|:------------------------------------------|:-------------------------------------------------------------------------------------------------------|
| [Docker Compose](/compose/overview/) | Enables you to define, build, and run multi-container applications |
| [Docker Machine](/machine/overview/) | Enables you to provision and manage Dockerized hosts |
| [Docker Notary](/notary/getting_started/) | Allows the signing of container images to enable Docker Content Trust |
| [Docker Registry](/registry/) | The software that powers Docker Hub and Docker Store, Registry stores and distributes container images |
## Products
Commercial Docker products that turn your container-based solution into a
production-ready application.
| Product | Description |
| ------- | ----------- |
| [Docker Cloud](/docker-cloud/) | Manages multi-container applications and host resources running on a cloud provider (such as Amazon Web Services) |
| [Universal Control Plane (UCP)](/datacenter/ucp/2.2/guides/) | Manages your Docker swarm on-premise, or on the cloud |
| [Docker Trusted Registry (DTR)](/datacenter/dtr/2.3/guides/) | Securely stores and scans your Docker images |
| [Docker Store](/docker-store/) | Public, Docker-hosted registry that distributes free and paid images from various publishers |
| Product | Description |
|:-------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------|
| [Docker Cloud](/docker-cloud/) | Manages multi-container applications and host resources running on a cloud provider (such as Amazon Web Services) |
| [Universal Control Plane (UCP)](/datacenter/ucp/2.2/guides/) | Manages your Docker swarm on-premise, or on the cloud |
| [Docker Trusted Registry (DTR)](/datacenter/dtr/2.3/guides/) | Securely stores and scans your Docker images |
| [Docker Store](/docker-store/) | Public, Docker-hosted registry that distributes free and paid images from various publishers |
## Superseded products and tools

View File

@ -1,23 +0,0 @@
---
layout: null
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://docs.docker.com/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
{% for page in site.samples %}<url>
<loc>https://docs.docker.com{{ page.url }}</loc>
<lastmod>{% if page.date %}{{ page.date | date_to_xmlschema }}{% else %}{{ site.time | date_to_xmlschema }}{% endif %}</lastmod>
</url>{% endfor %}
{% for page in site.pages %}{% unless page.hide_from_sitemap %}<url>
<loc>https://docs.docker.com{{ page.url }}</loc>
<lastmod>{% if page.date %}{{ page.date | date_to_xmlschema }}{% else %}{{ site.time | date_to_xmlschema }}{% endif %}</lastmod>
</url>{% endunless %}{% endfor %}
</urlset>