Skip to content

Commit 64af916

Browse files
jimmodpgeorge
authored andcommitted
docs/templates/layout.html: Indicate latest vs release docs.
When looking at latest (the default for docs.micropython.org), make it clear that this isn't the release version. - Changes the version in the top-left to "latest". - Adds a message to the top of each page to explain. For future release versions, add a short message to link to the latest version. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <[email protected]>
1 parent d75c7e8 commit 64af916

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

docs/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
'downloads':[
3434
('PDF', url_pattern % micropy_version + '/micropython-docs.pdf'),
3535
],
36+
'is_release': micropy_version != 'latest',
3637
}
3738

3839

@@ -74,7 +75,7 @@
7475
#
7576
# We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags"
7677
# breakdown, so use the same version identifier for both to avoid confusion.
77-
version = release = '1.19.1'
78+
version = release = micropy_version
7879

7980
# The language for content autogenerated by Sphinx. Refer to documentation
8081
# for a list of supported languages.

docs/templates/layout.html

+25
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,28 @@
44
{# we change the master_doc variable so that links to the index
55
page are to index.html instead of <port>_index.html #}
66
{% set master_doc = "index" %}
7+
8+
{% block document %}
9+
{% if is_release %}
10+
<div class="wy-alert wy-alert-danger">
11+
<p>
12+
This is the v{{ release }} version of the MicroPython
13+
documentation. The <a href="/en/latest/{{ pagename }}.html">latest
14+
development version</a> of this page may be more current.
15+
</p>
16+
</div>
17+
{% else %}
18+
<div class="wy-alert wy-alert-danger">
19+
<p>
20+
This is the documentation for the latest development branch of
21+
MicroPython and may refer to features that are not available in released
22+
versions.
23+
</p>
24+
<p>
25+
If you are looking for the documentation for a specific release, use
26+
the drop-down menu on the left and select the desired version.
27+
</p>
28+
</div>
29+
{% endif %}
30+
{{ super() }}
31+
{% endblock %}

docs/templates/topindex.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<h1>MicroPython documentation</h1>
66

77
<p>
8-
{{ _('Welcome! This is the documentation for MicroPython') }}
9-
v{{ release|e }}{% if last_updated %}, {{ _('last updated') }} {{ last_updated|e }}{% endif %}.
8+
{{ _('Welcome! This is the documentation for MicroPython') }}{% if last_updated %}, {{ _('last updated') }} {{ last_updated|e }}{% endif %}.
109
</p>
1110

1211
<p>

0 commit comments

Comments
 (0)