summaryrefslogtreecommitdiffstats
path: root/docs/_templates/versions.html
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-10-29 12:05:29 +0200
committerDave Wallace <dwallacelf@gmail.com>2021-11-16 18:04:55 +0000
commitae5609721b5eaf245f3f0b797ef45459320088c6 (patch)
tree6fa5ef9a67e208ed2a808a89775c3c5dc3d35de0 /docs/_templates/versions.html
parentcbc81eae6ef62ea14bce06e8bdc2017139882e8b (diff)
docs: consume fd.io version list
Type: feature This adds a version snippet in the vpp docs, based on a json description fetched from fd.io/vpp_versions.json This relies on https://github.com/FDio/site/pull/108 being merged Change-Id: I6dd22f09927841aef96011ed57af2cbdc5d409f5 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'docs/_templates/versions.html')
-rw-r--r--docs/_templates/versions.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/_templates/versions.html b/docs/_templates/versions.html
new file mode 100644
index 00000000000..d466bf1b01b
--- /dev/null
+++ b/docs/_templates/versions.html
@@ -0,0 +1,33 @@
+{# This overrides ./sphinx_rtd_theme/versions.html #}
+{# from https://github.com/readthedocs/sphinx_rtd_theme.git #}
+<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"> VPP versions</span>
+ {% set version_split = version.split('-') %}
+ {{ version_split[0] }}
+ <span class="fa fa-caret-down"></span>
+ </span>
+ <div class="rst-other-versions">
+ <dl id="version-container">
+ <!-- versions will end up here -->
+ </dl>
+ <dl>
+ <dt>Other links</dt>
+ <dd>
+ <a href="https://fd.io">Project Home</a>
+ </dd>
+ </dl>
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function() {
+ $.getJSON( "https://fd.io/vpp_versions.json", function( data ) {
+ let cont = $("#version-container");
+ cont.empty();
+ cont.append('<dt>Versions</dt>');
+ $.each( data, function( key, val ) {
+ cont.append('<dd><a href="' + val.link + '">' + val.name + '</a></dd>');
+ });
+ });
+});
+</script>