Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

Commit

Permalink
Merge pull request #48 from pdavide/new-versioning
Browse files Browse the repository at this point in the history
Versioning + theme update
  • Loading branch information
pdavide authored Sep 29, 2017
2 parents 1ae8bd6 + 5772485 commit 238ff56
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.1
- image: circleci/python:2.7

working_directory: ~/design-doc

Expand All @@ -14,7 +14,7 @@ jobs:
- run:
name: install sphinx
command: |
python3 -m venv .venv
virtualenv .venv
source .venv/bin/activate
pip install -q sphinx
Expand Down
15 changes: 7 additions & 8 deletions _themes/sphinx_italia_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
<a href="https://teamdigitale.governo.it/" title="Team Digitale">Team Digitale</a>
</div><!--/sh__institutional-->
<div class="sh__tabs">
<ul class="sh__tabsul">
<ul class="sh__tabsul">
<li class="delimiter"><a href="https://pianotriennale-ict.italia.it">Piano Triennale</a></li>
<li class=""><a href="https://developers.italia.it/">Developers</a></li>
<li class="delimiter"><a href="https://designers.italia.it">Designers</a></li>
<li class=""><a href="https://forum.developers.italia.it/">Forum</a></li>
<li class=""><a href="https://developers.italia.it/">Developers</a></li>
<li class="delimiter"><a href="https://designers.italia.it">Designers</a></li>
<li class=""><a href="https://forum.italia.it/">Forum</a></li>
<li class="current"><a href="https://docs.developers.italia.it/">Docs</a></li>
<li class=""><a href="https://github.com/italia/">Github</a></li>
</ul>
Expand Down Expand Up @@ -96,10 +96,9 @@ <h2 class="branding--title">
{% if theme_logo_only %}
{% else %}
<h1 class="project-title"><a href="{{ pathto(master_doc) }}" > {{ project }} </a>
{% if theme_display_version %} {%- set nav_version = version %} {% if READTHEDOCS and current_version %} {%- set nav_version = current_version
%}{% endif %}
{% if nav_version %}
<span class="version">{{ nav_version }}</span>
{% if theme_display_version %} {%- set nav_version = version %} {% if READTHEDOCS and current_version != 'stable' %} {%- set nav_version = current_version %} {% endif %}
{% if nav_version %}
<br/><small>versione: </small><span class="version">{{ nav_version }}</span>
</h1>
{% endif %} {% endif %} {% endif %} {% include "searchbox.html" %} {% endblock %}
</div>
Expand Down
6 changes: 3 additions & 3 deletions _themes/sphinx_italia_theme/offcanvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</li>
<li class="pushy-link delimiter">
<span class="pushy_subtitle">GLI STRUMENTI</span>
<a href="https://forum.developers.italia.it/">Forum</a>
<a href="https://forum.italia.it/">Forum</a>
</li>
<li class="pushy-link delimiter current">
<a href="https://docs.developers.italia.it/">Docs</a>
Expand All @@ -39,5 +39,5 @@
<!-- Your Content -->
<div id="container">
<!-- Menu Button -->
</div>

</div>
12 changes: 7 additions & 5 deletions conf.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Empty file added versioning/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions versioning/github_releases.py
Original file line number Diff line number Diff line change
@@ -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'])
Binary file added versioning/github_releases.pyc
Binary file not shown.

0 comments on commit 238ff56

Please sign in to comment.