瀏覽代碼

make the non-release doc warning conditional and add version info

use the beta-warning area to tell the user what VERSION of docker, git
branch, and links to the official release version docs are.

requires / extends PR #5272

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
Sven Dowideit 11 年之前
父節點
當前提交
dc982d3053
共有 4 個文件被更改,包括 16 次插入3 次删除
  1. 3 0
      Makefile
  2. 5 0
      docs/Dockerfile
  3. 1 1
      docs/theme/mkdocs/base.html
  4. 7 2
      docs/theme/mkdocs/beta_warning.html

+ 3 - 0
Makefile

@@ -53,6 +53,9 @@ build: bundles
 	docker build -t "$(DOCKER_IMAGE)" .
 	docker build -t "$(DOCKER_IMAGE)" .
 
 
 docs-build:
 docs-build:
+	cp ./VERSION docs/VERSION
+	echo "$(GIT_BRANCH)" > docs/GIT_BRANCH
+	echo "$(AWS_S3_BUCKET)" > docs/AWS_S3_BUCKET
 	docker build -t "$(DOCKER_DOCS_IMAGE)" docs
 	docker build -t "$(DOCKER_DOCS_IMAGE)" docs
 
 
 bundles:
 bundles:

+ 5 - 0
docs/Dockerfile

@@ -39,6 +39,11 @@ WORKDIR	/docs
 #convert to markdown
 #convert to markdown
 #RUN	./convert.sh
 #RUN	./convert.sh
 
 
+RUN	VERSION=$(cat /docs/VERSION)								&&\
+	GIT_BRANCH=$(cat /docs/GIT_BRANCH)							&&\
+	AWS_S3_BUCKET=$(cat /docs/AWS_S3_BUCKET)						&&\
+	echo "{% set docker_version = \"${VERSION}\" %}{% set docker_branch = \"${GIT_BRANCH}\" %}{% set aws_bucket = \"${AWS_S3_BUCKET}\" %}{% include \"beta_warning.html\" %}" > /docs/theme/mkdocs/version.html
+
 # note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
 # note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
 EXPOSE	8000
 EXPOSE	8000
 
 

+ 1 - 1
docs/theme/mkdocs/base.html

@@ -48,7 +48,7 @@
             <div class="col-sm-8" role="main">
             <div class="col-sm-8" role="main">
               {% include "breadcrumbs.html" %}
               {% include "breadcrumbs.html" %}
               <main id="content" role="main">
               <main id="content" role="main">
-                {% include "beta_warning.html" %}
+		{% include "version.html" %}
                 {{ content }}
                 {{ content }}
               </main>
               </main>
             </div>
             </div>

+ 7 - 2
docs/theme/mkdocs/beta_warning.html

@@ -1,3 +1,4 @@
+{% if aws_bucket != "docs.docker.io" %}
 <style>
 <style>
 .bs-callout {
 .bs-callout {
   padding: 20px;
   padding: 20px;
@@ -22,6 +23,10 @@
 }
 }
 </style>
 </style>
 <div class="bs-callout bs-callout-danger">
 <div class="bs-callout bs-callout-danger">
-<h4>You are looking at the <span>beta</span> docs for the development version of Docker.</h4>
-There is a chance of them being different from the prior versions.
+	<h4>This is the
+		<span>{% if docker_version != docker_version|replace("-dev", "bingo") %}{{ docker_branch }} development branch{% else %}beta{% endif %}</span>
+		documentation for Docker version {{ docker_version }}.</h4>
+	Please go to <a href="http://docs.docker.io">http://docs.docker.io</a> for the current Docker release documentation.
+	{{ aws_bucket }}
 </div>
 </div>
+{% endif %}