-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4613 from ESMCI/fix_docs_version
Updates documentation versioning
- Loading branch information
Showing
6 changed files
with
91 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
sphinx | ||
sphinxcontrib-programoutput | ||
sphinx-rtd-theme | ||
# git+https://github.com/esmci/sphinx_rtd_theme.git@version-dropdown-with-fixes | ||
evv4esm |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{% if READTHEDOCS or display_lower_left %} | ||
{# Add rst-badge after rst-versions for small badge style. #} | ||
<script type="text/javascript"> | ||
let baseUriRegex = /(.*\/cime)\/.*/g; | ||
let parsedUri = baseUriRegex.exec(document.baseURI); | ||
|
||
if (parsedUri != null && parsedUri.length == 2) { | ||
let baseUri = parsedUri[1]; | ||
|
||
$.get(`${baseUri}/versions/versions.json`, function(data) { | ||
let versionElement = $("#versions"); | ||
|
||
Object.keys(data).forEach(function(key) { | ||
let value = data[key]; | ||
|
||
let item = `<dd><a href="${baseUri}/versions/${key}/html/">${value}</a></dd>` | ||
|
||
versionElement.append(item); | ||
}); | ||
}); | ||
} | ||
</script> | ||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> | ||
<span class="rst-current-version" data-toggle="rst-current-version"> | ||
<span class="fa fa-book"> Read the Docs</span> | ||
v: {{ current_version }} | ||
<span class="fa fa-caret-down"></span> | ||
</span> | ||
<div class="rst-other-versions"> | ||
{% if languages|length >= 1 %} | ||
<dl> | ||
<dt>{{ _('Languages') }}</dt> | ||
{% for slug, url in languages %} | ||
{% if slug == current_language %} <strong> {% endif %} | ||
<dd><a href="{{ url }}">{{ slug }}</a></dd> | ||
{% if slug == current_language %} </strong> {% endif %} | ||
{% endfor %} | ||
</dl> | ||
{% endif %} | ||
<dl id="versions"> | ||
<dt>Versions</dt> | ||
</dl> | ||
{% if downloads|length >= 1 %} | ||
<dl> | ||
<dt>{{ _('Downloads') }}</dt> | ||
{% for type, url in downloads %} | ||
<dd><a href="{{ url }}">{{ type }}</a></dd> | ||
{% endfor %} | ||
</dl> | ||
{% endif %} | ||
{% if READTHEDOCS %} | ||
<dl> | ||
<dt>{{ _('On Read the Docs') }}</dt> | ||
<dd> | ||
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/?fromdocs={{ slug }}">{{ _('Project Home') }}</a> | ||
</dd> | ||
<dd> | ||
<a href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}">{{ _('Builds') }}</a> | ||
</dd> | ||
</dl> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters