diff --git a/.circleci/config.yml b/.circleci/config.yml
index 4ccf42f..6cc6f48 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- - image: circleci/python:3.6.1
+ - image: circleci/python:2.7
working_directory: ~/design-doc
@@ -14,7 +14,7 @@ jobs:
- run:
name: install sphinx
command: |
- python3 -m venv .venv
+ virtualenv .venv
source .venv/bin/activate
pip install -q sphinx
diff --git a/_themes/sphinx_italia_theme/layout.html b/_themes/sphinx_italia_theme/layout.html
index 6963b7f..19e4a6d 100644
--- a/_themes/sphinx_italia_theme/layout.html
+++ b/_themes/sphinx_italia_theme/layout.html
@@ -44,11 +44,11 @@
Team Digitale
-
+
@@ -96,10 +96,9 @@
{% if theme_logo_only %}
{% else %}
{{ project }}
- {% if theme_display_version %} {%- set nav_version = version %} {% if READTHEDOCS and current_version %} {%- set nav_version = current_version
- %}{% endif %}
- {% if nav_version %}
- {{ nav_version }}
+ {% if theme_display_version %} {%- set nav_version = version %} {% if READTHEDOCS and current_version != 'stable' %} {%- set nav_version = current_version %} {% endif %}
+ {% if nav_version %}
+
versione: {{ nav_version }}
{% endif %} {% endif %} {% endif %} {% include "searchbox.html" %} {% endblock %}
diff --git a/_themes/sphinx_italia_theme/offcanvas.html b/_themes/sphinx_italia_theme/offcanvas.html
index 8caa7e5..0adfbed 100644
--- a/_themes/sphinx_italia_theme/offcanvas.html
+++ b/_themes/sphinx_italia_theme/offcanvas.html
@@ -21,7 +21,7 @@
GLI STRUMENTI
- Forum
+ Forum
Docs
@@ -39,5 +39,5 @@
-
-
\ No newline at end of file
+
+
diff --git a/conf.py b/conf.py
old mode 100755
new mode 100644
index ceb2812..8f3584d
--- a/conf.py
+++ b/conf.py
@@ -1,18 +1,20 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
+import sys
+import os
+sys.path.append('./versioning')
+from github_releases import get_latest_release
+
# -- PROJECT Variables ----------------------------------------------------
settings_project_name = 'Linee guida di design per i servizi web della PA'
settings_copyright_copyleft = 'CC-BY 3.0 - Agenzia per l\'Italia Digitale'
settings_editor_name = 'AgID - Agenzia per l\'Italia Digitale'
-settings_doc_version = '1'
-settings_doc_release = '1.0'
+settings_doc_version = get_latest_release('italia', 'design-doc')
+settings_doc_release = settings_doc_version
settings_basename = 'LineeGuidaWebPA'
settings_file_name = 'Linee-Guida-Web-PA'
-import sys
-import os
-
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
diff --git a/versioning/__init__.py b/versioning/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/versioning/github_releases.py b/versioning/github_releases.py
new file mode 100644
index 0000000..d55a069
--- /dev/null
+++ b/versioning/github_releases.py
@@ -0,0 +1,9 @@
+from urllib2 import urlopen
+import json
+
+def get_latest_release(owner, repo):
+ url = "https://api.github.com/repos/%s/%s/releases/latest" % (owner, repo)
+ response = urlopen(url)
+ string = response.read().decode('utf-8')
+ json_obj = json.loads(string)
+ return (json_obj['tag_name'])
diff --git a/versioning/github_releases.pyc b/versioning/github_releases.pyc
new file mode 100644
index 0000000..929df4e
Binary files /dev/null and b/versioning/github_releases.pyc differ