Support for building docs for next major release

This commit is contained in:
Jacob Hammons 2016-02-16 15:25:28 -07:00
parent 52a3c9b0c9
commit 52d7b854d7
2 changed files with 26 additions and 3 deletions

View file

@ -156,7 +156,7 @@
{% if build_type == "develop" and on_saltstack %}
<div id="dev-notification">
<div class="alert alert-warning dev-notification-text" role="alert"><i class="glyphicon glyphicon-cog"></i> You are viewing docs from the develop branch, some of these features are not yet released.</div>
<div class="alert alert-warning dev-notification-text" role="alert"><i class="glyphicon glyphicon-warning-sign"></i> You are viewing docs from the develop branch, some of these features are not yet released.</div>
</div>
{% endif %}
@ -166,6 +166,12 @@
</div>
{% endif %}
{% if build_type == "next" and on_saltstack %}
<div id="dev-notification">
<div class="alert alert-warning dev-notification-text" role="alert"><i class="glyphicon glyphicon-warning-sign"></i> You are viewing preview docs for the next major release, <a target="_blank" data-container="body" data-toggle="tooltip" data-placement="bottom" title="View this branch on GitHub" href="https://github.com/saltstack/salt/tree/{{ next_release_dir }}"> {{ next_release }}.</a></div>
</div>
{% endif %}
{%- block document %}
<div class="body-content">
{% block body %} {% endblock %}
@ -203,8 +209,10 @@
{% elif build_type == "develop" %}
<p>You are viewing docs built from a recent snapshot of the develop branch. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>.</p>
{% endif %}
{% elif build_type == "next" %}
<p>You are viewing preview docs for the next major release, {{ next_release }}. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>.</p>
{% endif %}
<br>
<p><a href="http://saltstack.com">saltstack.com</a></p>
@ -237,6 +245,15 @@
<a href="http://saltstack.com/support" target="_blank"><img class="nolightbox sidebar-banner center" src="{{ pathto('_static/images/banner-support.png', 1) }}"/></a>
{% endif %}
{% if build_type=="next" %}
<div class="versions">
<p><b>{{ next_release }}</b> (Not Released)</p>
</div>
{% else %}
<div class="releaselinks versions {{ build_type }}">
<a class="btn btn-secondary{% if build_type == "previous" or build_type == "inactive" %} active{% endif %}" id="previous"{% if build_type == "previous" or build_type == "inactive" %} title="View release notes"{% else %} title="Switch to docs for the previous stable release"{% endif %} data-container="body" data-toggle="tooltip" data-placement="bottom" href="/en/{{ previous_release_dir }}/">{{ previous_release }}{% if build_type == "previous" or build_type == "inactive" %} <i class="glyphicon glyphicon-ok"></i>{%- endif %}</a>
@ -247,6 +264,8 @@
</div>
{% endif %}
{% else %}
<div class="versions">
<p>Version {{ version }}</p>

View file

@ -170,7 +170,9 @@ version = salt.version.__version__
latest_release = '2015.8.5' # latest release
previous_release = '2015.5.9' # latest release from previous branch
previous_release_dir = '2015.5' # path on web server for previous branch
build_type = 'develop' # latest, previous, develop
next_release = '2016.3.0' # latest release from previous branch
next_release_dir = '2016.3' # path on web server for previous branch
build_type = 'next' # latest, previous, develop, next
# set release to 'version' for develop so sha is used
# - otherwise -
@ -311,6 +313,8 @@ html_context = {
'latest_release': latest_release,
'previous_release': previous_release,
'previous_release_dir': previous_release_dir,
'next_release': next_release,
'next_release_dir': next_release_dir,
'search_cx': search_cx,
'build_type': build_type,
}