Skip to content

Commit 78305d2

Browse files
authored
Merge pull request #6867 from YuriSizov/web-display-godot-version
Display Godot version more clearly
2 parents 514956a + d14d924 commit 78305d2

File tree

6 files changed

+57
-37
lines changed

6 files changed

+57
-37
lines changed

_static/css/custom.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,7 @@ p + .classref-constant {
16011601
overflow-y: auto;
16021602
overflow-x: hidden;
16031603
max-height: calc(100% - 348px);
1604+
padding-bottom: 24px;
16041605
}
16051606
@media screen and (max-width: 768px) {
16061607
.wy-nav-side {

_static/js/custom.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ const registerOnScrollEvent = (function(){
1313
// The number of pixels the user must scroll by before the logo is completely hidden.
1414
const scrollTopPixels = 84;
1515
// The target margin to be applied to the navigation bar when the logo is hidden.
16-
const menuTopMargin = 88;
16+
const menuTopMargin = 70;
1717
// The max-height offset when the logo is completely visible.
18-
const menuHeightOffset_default = 180;
18+
const menuHeightOffset_default = 162;
1919
// The max-height offset when the logo is completely hidden.
20-
const menuHeightOffset_fixed = 98;
20+
const menuHeightOffset_fixed = 80;
2121
// The distance between the two max-height offset values above; used for intermediate values.
2222
const menuHeightOffset_diff = (menuHeightOffset_default - menuHeightOffset_fixed);
2323

_templates/breadcrumbs.html

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
11
{%- extends "sphinx_rtd_theme/breadcrumbs.html" %}
22

3+
{% block breadcrumbs %}
4+
<li>
5+
<div style="font-size: 105%;font-weight: 600;">
6+
{{ godot_docs_title | replace("%s", godot_version) }}
7+
</div>
8+
<ul class="wy-breadcrumbs">
9+
{{ super() }}
10+
</ul>
11+
</li>
12+
{% endblock %}
13+
314
{% block breadcrumbs_aside %}
415
{% if not meta or meta.get('github_url') != 'hide' %}
5-
{{ super() }}
6-
7-
<style>
8-
.godot-edit-guidelines {
9-
font-size: 14px;
10-
float: right;
11-
clear: both;
12-
padding-top: 4px;
13-
}
16+
<li style="float: right; text-align: right;">
17+
<ul>
18+
{{ super() }}
19+
</ul>
1420

15-
@media screen and (max-width: 480px) {
21+
<style>
1622
.godot-edit-guidelines {
17-
display: none;
23+
font-size: 14px;
24+
float: right;
25+
clear: both;
26+
padding-top: 4px;
27+
}
28+
29+
@media screen and (max-width: 480px) {
30+
.godot-edit-guidelines {
31+
display: none;
32+
}
1833
}
19-
}
20-
</style>
21-
<a class="godot-edit-guidelines" href="https://docs.godotengine.org/en/latest/contributing/documentation/index.html#writing-documentation">
22-
Learn how to contribute!
23-
</a>
34+
</style>
35+
<a class="godot-edit-guidelines" href="https://docs.godotengine.org/en/latest/contributing/documentation/index.html#writing-documentation">
36+
Learn how to contribute!
37+
</a>
38+
</li>
2439
{% endif %}
2540
{% endblock %}

_templates/layout.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends "!layout.html" -%}
2+
{# Refer to https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html #}
23

34
{% block htmltitle -%}
45
<title>{{ godot_title_prefix }}{{ title|striptags|e }}{{ titlesuffix }}</title>

_templates/versions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
1414
<span class="rst-current-version" data-toggle="rst-current-version">
1515
<span class="fa fa-book"> Read the Docs</span>
16-
v: {{ display_version }}
16+
v: {{ display_version }}{% if display_version != godot_version %} ({{ godot_version }}){% endif %}
1717
<span class="fa fa-caret-down"></span>
1818
</span>
1919
<div class="rst-other-versions">

conf.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,20 @@
9797
# Language / i18n
9898

9999
supported_languages = {
100-
"en": "Godot Engine (%s) documentation in English",
101-
"de": "Godot Engine (%s) Dokumentation auf Deutsch",
102-
"es": "Documentación de Godot Engine (%s) en español",
103-
"fr": "Documentation de Godot Engine (%s) en français",
104-
"fi": "Godot Engine (%s) dokumentaatio suomeksi",
105-
"it": "Godot Engine (%s) documentazione in italiano",
106-
"ja": "Godot Engine (%s)の日本語のドキュメント",
107-
"ko": "Godot Engine (%s) 문서 (한국어)",
108-
"pl": "Dokumentacja Godot Engine (%s) w języku polskim",
109-
"pt_BR": "Documentação da Godot Engine (%s) em Português Brasileiro",
110-
"ru": "Документация Godot Engine (%s) на русском языке",
111-
"uk": "Документація до Godot Engine (%s) українською мовою",
112-
"zh_CN": "Godot Engine (%s) 简体中文文档",
113-
"zh_TW": "Godot Engine (%s) 正體中文 (台灣) 文件",
100+
"en": "Godot Engine %s documentation in English",
101+
"de": "Godot Engine %s Dokumentation auf Deutsch",
102+
"es": "Documentación de Godot Engine %s en español",
103+
"fr": "Documentation de Godot Engine %s en français",
104+
"fi": "Godot Engine %s dokumentaatio suomeksi",
105+
"it": "Godot Engine %s documentazione in italiano",
106+
"ja": "Godot Engine %sの日本語のドキュメント",
107+
"ko": "Godot Engine %s 문서 (한국어)",
108+
"pl": "Dokumentacja Godot Engine %s w języku polskim",
109+
"pt_BR": "Documentação da Godot Engine %s em Português Brasileiro",
110+
"ru": "Документация Godot Engine %s на русском языке",
111+
"uk": "Документація до Godot Engine %s українською мовою",
112+
"zh_CN": "Godot Engine %s 简体中文文档",
113+
"zh_TW": "Godot Engine %s 正體中文 (台灣) 文件",
114114
}
115115

116116
language = os.getenv("READTHEDOCS_LANGUAGE", "en")
@@ -155,9 +155,11 @@
155155
"logo_only": True,
156156
# Collapse navigation (False makes it tree-like)
157157
"collapse_navigation": False,
158+
# Hide the documentation version name/number under the logo
159+
"display_version": False,
158160
}
159161

160-
html_title = supported_languages[language] % version
162+
html_title = supported_languages[language] % ( "(" + version + ")" )
161163

162164
# VCS options: https://docs.readthedocs.io/en/latest/vcs.html#github
163165
html_context = {
@@ -168,6 +170,7 @@
168170
"conf_py_path": "/", # Path in the checkout to the docs root
169171
"godot_inject_language_links": True,
170172
"godot_docs_supported_languages": list(supported_languages.keys()),
173+
"godot_docs_title": supported_languages[language],
171174
"godot_docs_basepath": "https://docs.godotengine.org/",
172175
"godot_docs_suffix": ".html",
173176
"godot_default_lang": "en",
@@ -195,14 +198,14 @@
195198
html_css_files = [
196199
'css/algolia.css',
197200
'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css',
198-
"css/custom.css?9", # Increment the number at the end when the file changes to bust the cache.
201+
"css/custom.css?10", # Increment the number at the end when the file changes to bust the cache.
199202
]
200203

201204
if not on_rtd:
202205
html_css_files.append("css/dev.css")
203206

204207
html_js_files = [
205-
"js/custom.js?5", # Increment the number at the end when the file changes to bust the cache.
208+
"js/custom.js?6", # Increment the number at the end when the file changes to bust the cache.
206209
('https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js', {'defer': 'defer'}),
207210
('js/algolia.js', {'defer': 'defer'})
208211
]

0 commit comments

Comments
 (0)