Skip to content

Commit

Permalink
Merge pull request #688 from dopplershift/fix-doc-versions
Browse files Browse the repository at this point in the history
Fix versioned doc handling
  • Loading branch information
dopplershift committed Dec 14, 2017
2 parents e9c9ccd + 3dd7324 commit 26e99ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/_static/pop_ver.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ $(document).ready(function() {
var mylist = $("#version-list");
mylist.empty();
mylist.append($("<option>", {value: "../" + cur_ver, text: name}));
$.getJSON("../versions.json", function(obj) {
$.getJSON(version_json_loc, function(obj) {
$.each(obj.versions, function() {
if (this != cur_ver) {
name = this.startsWith('v') ? this.substring(1) : this;
mylist.append($("<option>", {value: "../" + this, text: name}));
mylist.append($("<option>", {value: DOCUMENTATION_OPTIONS.URL_ROOT + '../' + this, text: name}));
}
});
});
Expand Down
5 changes: 2 additions & 3 deletions docs/_templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
ga('create', 'UA-92978945-1', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/pop_ver.js"></script>
<script>var version_json_loc = "{{ pathto('../versions.json', 1) }}";</script>
<p>Do you enjoy using MetPy?
<a href="https://saythanks.io/to/unidata" class="btn btn-neutral" title="Installation Guide" accesskey="n">Say Thanks!</a>
<a href="https://saythanks.io/to/unidata" class="btn btn-neutral" title="Say Thanks!" accesskey="n">Say Thanks!</a>
</p>
{% endblock %}
3 changes: 3 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% extends "!layout.html" %}

{% set script_files = script_files + ["_static/pop_ver.js"] %}

0 comments on commit 26e99ad

Please sign in to comment.