Version selector for EE docs (#4952)

* Version selector for EE docs

* site...

* endif

* Fixes

* html not md

* hash v string, oops

* Path overrides
This commit is contained in:
John Mulhausen 2017-10-13 15:45:52 -07:00 committed by GitHub
parent 3a3218dfbe
commit a8677b38af
3 changed files with 62 additions and 3 deletions

View File

@ -21,6 +21,28 @@ 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/
collections:
samples:
output: true
@ -111,6 +133,7 @@ defaults:
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:

View File

@ -0,0 +1,33 @@
{% if page.path contains "ucp" %}
{% capture currentDoc %}UCP version {{ page.ucp_version }}{% endcapture %}
{% capture dropdown %}
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{{ page.ucp_version }}
<span class="caret"></span></button>
<ul class="dropdown-menu">
{% for version in site.ucp_versions %}
{% if page.ucp_version contains version.version %}{% else %}<li><a href="{{ version.path }}">{{ version.version }}{% if version.latest %} (latest){% endif %}</a></li>{% endif %}
{% endfor %}
</ul>
</div>
{% endcapture %}
{% endif %}
{% if page.path contains "dtr" %}
{% capture currentDoc %}DTR version {{ page.dtr_version }}{% endcapture %}
{% capture dropdown %}
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{{ page.dtr_version }}
<span class="caret"></span></button>
<ul class="dropdown-menu">
{% for version in site.dtr_versions %}
{% if page.dtr_version contains version.version %}{% else %}<li><a href="{{ version.path }}">{{ version.version }}{% if version.latest %} (latest){% endif %}</a></li>{% endif %}
{% endfor %}
</ul>
</div>
{% endcapture %}
{% endif %}
<blockquote><p>These are the docs for {{ currentDoc }}</p>
<p>To select a different version, use the selector below.</p>
<p>{{ dropdown }}</p>
</blockquote>

View File

@ -96,8 +96,9 @@
<!-- Go get "Open Sans" font from Google -->
<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 %} {% if page.hide_from_sitemap %}
<meta name="robots" content="noindex" />{% endif %}
<link rel="stylesheet" href="/css/temp.css">
{% seo %}
{% if page.hide_from_sitemap %}<meta name="robots" content="noindex" />{% endif %}
</head>
<body ng-app="Docker" ng-controller="DockerController" class="colums">
<header>
@ -115,7 +116,9 @@
{% else %}
{% if page.title %}
<h1>{{ page.title }}</h1>{% endif %} {% if page.advisory %}
<blockquote>{{ site.data.advisories.texts[page.advisory] | markdownify }}</blockquote>{% endif %}{% endif %} {% unless page.tree == false %}{% include read_time.html %}{% endunless %}{{ content }}
<blockquote>{{ site.data.advisories.texts[page.advisory] | markdownify }}</blockquote>{% endif %}{% endif %} {% unless page.tree == false %}{% include read_time.html %}{% endunless %}
{% if page.enterprise %}{% include ee_dropdown.html %}{% endif %}
{{ content }}
<!-- tags -->
{% unless page.notags == true %}
{% assign keywords = page.keywords | split:"," %}