mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 05:30:24 +00:00
doc: update breadcrumb to include release version
As a DX improvement in the documentation, include the release version (or Latest) in the breadcrumb header on every page. This can help readers know which release version documentation they're using. Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This commit is contained in:
parent
87bab944e6
commit
f300d1ff77
14
doc/_templates/breadcrumbs.html
vendored
Normal file
14
doc/_templates/breadcrumbs.html
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{% extends "!breadcrumbs.html" %}
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
<!-- {{ docs_title }} -->
|
||||||
|
{# parameterize default name "Docs" in breadcrumb via docs_title in conf.py #}
|
||||||
|
{% if not docs_title %}
|
||||||
|
{% set docs_title = "Docs" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<li><a href="{{ pathto(master_doc) }}">{{ docs_title }}</a> »</li>
|
||||||
|
{% for doc in parents %}
|
||||||
|
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> »</li>
|
||||||
|
{% endfor %}
|
||||||
|
<li>{{ title }}</li>
|
||||||
|
{% endblock %}
|
9
doc/_templates/layout.html
vendored
9
doc/_templates/layout.html
vendored
@ -1,13 +1,4 @@
|
|||||||
{% extends "!layout.html" %}
|
{% extends "!layout.html" %}
|
||||||
{% block document %}
|
|
||||||
{% if is_release %}
|
|
||||||
<div class="wy-alert wy-alert-danger">
|
|
||||||
The <a href="/{{ pagename }}.html">latest development version</a>
|
|
||||||
of this page may be more current than this released {{ version }} version.
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{{ super() }}
|
|
||||||
{% endblock %}
|
|
||||||
{% block menu %}
|
{% block menu %}
|
||||||
{% include "aversions.html" %}
|
{% include "aversions.html" %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
16
doc/conf.py
16
doc/conf.py
@ -76,7 +76,7 @@ master_doc = 'index'
|
|||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Project ACRN™'
|
project = u'Project ACRN™'
|
||||||
copyright = u'2020, Project ACRN'
|
copyright = u'2020, Project ACRN'
|
||||||
author = u'Project ARCN developers'
|
author = u'Project ACRN developers'
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
@ -109,7 +109,7 @@ try:
|
|||||||
break
|
break
|
||||||
finally:
|
finally:
|
||||||
if version_major and version_minor :
|
if version_major and version_minor :
|
||||||
version = release = "v " + str(version_major) + '.' + str(version_minor)
|
version = release = str(version_major) + '.' + str(version_minor)
|
||||||
if version_rc :
|
if version_rc :
|
||||||
version = release = version + version_rc
|
version = release = version + version_rc
|
||||||
else:
|
else:
|
||||||
@ -177,17 +177,25 @@ else:
|
|||||||
# Here's where we (manually) list the document versions maintained on
|
# Here's where we (manually) list the document versions maintained on
|
||||||
# the published doc website. On a daily basis we publish to the
|
# the published doc website. On a daily basis we publish to the
|
||||||
# /latest folder but when releases are made, we publish to a /<relnum>
|
# /latest folder but when releases are made, we publish to a /<relnum>
|
||||||
# folder (specified via RELEASE=name on the make command).
|
# folder (specified via the VERSION file as processed earlier or
|
||||||
|
# overridden on the make command line with RELEASE=name.
|
||||||
|
|
||||||
if tags.has('release'):
|
if tags.has('release'):
|
||||||
|
is_release = True
|
||||||
|
docs_title = '%s' %(version)
|
||||||
current_version = version
|
current_version = version
|
||||||
if RELEASE:
|
if RELEASE:
|
||||||
version = current_version = RELEASE
|
version = release = current_version = RELEASE
|
||||||
|
docs_title = '%s' %(version)
|
||||||
else:
|
else:
|
||||||
version = current_version = "latest"
|
version = current_version = "latest"
|
||||||
|
is_release = False
|
||||||
|
docs_title = 'Latest'
|
||||||
|
|
||||||
html_context = {
|
html_context = {
|
||||||
'current_version': current_version,
|
'current_version': current_version,
|
||||||
|
'docs_title': docs_title,
|
||||||
|
'is_release': is_release,
|
||||||
'versions': ( ("latest", "/latest/"),
|
'versions': ( ("latest", "/latest/"),
|
||||||
("2.2", "/2.2/"),
|
("2.2", "/2.2/"),
|
||||||
("2.1", "/2.1/"),
|
("2.1", "/2.1/"),
|
||||||
|
Loading…
Reference in New Issue
Block a user