Skip to content

Commit

Permalink
Merge pull request #299 from autocrypt/distinct-staging
Browse files Browse the repository at this point in the history
Display "THIS IS A DRAFT" on everything but the master branch
  • Loading branch information
dkg committed Dec 21, 2017
2 parents 9cf6dc2 + 36884d3 commit 16a4f7c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ addons:

install:
- pip install sphinx
- pip install gitpython

script:
- cd doc
Expand Down
19 changes: 19 additions & 0 deletions doc/_static/staging.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
body:before {
content: "THIS IS A DRAFT! please refer to https://autocrypt.org/ for the current Autocrypt website";
display: block;
position: fixed;
top: 0px;
left: 0px;
padding: 1em;
color: black;
font-weight: bold;
font-size: 150%;
min-height: 2em;
z-index: 10;
background-color: rgba(255,0,0,0.1);
text-shadow: 5px 5px 2px rgba(0,0,0,0.2);
text-align: center;
}
.document {
padding-top: 4em;
}
10 changes: 10 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,13 @@

def setup(app):
app.add_stylesheet('custom.css')
staging = True
try:
import git
with git.Repo(search_parent_directories=True) as repo:
if str(repo.active_branch) == 'master':
staging = False
except:
pass
if staging:
app.add_stylesheet('staging.css')

0 comments on commit 16a4f7c

Please sign in to comment.