Skip to content

Commit

Permalink
Doc: setup CI to build the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
autra committed Jul 3, 2020
1 parent 9f20a26 commit e80a146
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@ ENV/
# Rope project settings
.ropeproject
.pytest
public
19 changes: 19 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,22 @@ test:python-latest:
test:python-stretch:
<<: *job_definition
image: python:3.7-stretch

#########
# PAGES #
#########
pages:
stage: deploy
image: python:latest
script:
- pip install .
- pip install .[doc]
- sphinx-multiversion docs public
- cp -rv docs/index_redirect.html public/index.html
- current_version="$(git describe --tags --abbrev=0)"
- sed -i "s/VERSION/$current_version/g" public/index.html
artifacts:
paths:
- public
only:
- master
27 changes: 27 additions & 0 deletions docs/_templates/versions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{%- if current_version %}
<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"> Other Versions</span>
v: {{ current_version.name }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
{%- if versions.tags %}
<dl>
<dt>Tags</dt>
{%- for item in versions.tags %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
{%- if versions.branches %}
<dl>
<dt>Branches</dt>
{%- for item in versions.branches %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
</div>
</div>
{%- endif %}
9 changes: 9 additions & 0 deletions docs/index_redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to VERSION/</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=VERSION">
<link rel="canonical" href="VERSION/index.html">
</head>
</html>

0 comments on commit e80a146

Please sign in to comment.