ソースを参照

docs: Add version sidebar

Jan Holthuis 5 年 前
コミット
afad67376e
2 ファイル変更30 行追加0 行削除
  1. 14 0
      docs/_templates/versioning.html
  2. 16 0
      docs/conf.py

+ 14 - 0
docs/_templates/versioning.html

@@ -0,0 +1,14 @@
+{% if versions %}
+<h3>{{ _('Branches') }}</h3>
+<ul>
+  {%- for item in versions.branches %}
+  <li><a href="{{ item.url }}">{{ item.name }}</a></li>
+  {%- endfor %}
+</ul>
+<h3>{{ _('Tags') }}</h3>
+<ul>
+  {%- for item in versions.tags %}
+  <li><a href="{{ item.url }}">{{ item.name }}</a></li>
+  {%- endfor %}
+</ul>
+{% endif %}

+ 16 - 0
docs/conf.py

@@ -15,3 +15,19 @@ templates_path = ["_templates"]
 extensions = [
     "sphinx_multiversion",
 ]
+
+templates_path = [
+    "_templates",
+]
+
+html_sidebars = {
+    "**": [
+        "about.html",
+        "navigation.html",
+        "relations.html",
+        "searchbox.html",
+        "versioning.html",
+    ],
+}
+
+mv_remote_whitelist = r"^origin$"