Skip to content

Commit

Permalink
Merge pull request #52 from scality/docs-ga
Browse files Browse the repository at this point in the history
docs: Add Google Analytics tag when rendered on RTD
  • Loading branch information
NicolasT committed May 4, 2018
2 parents 4227134 + 01d7ea3 commit c7ee51c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
13 changes: 13 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os

ON_RTD = os.environ.get('READTHEDOCS') == 'True'

# -- Project information -----------------------------------------------------

Expand Down Expand Up @@ -45,6 +48,11 @@
'sphinxcontrib.spelling',
]

if ON_RTD:
extensions.extend([
'sphinxcontrib.googleanalytics',
])

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -171,3 +179,8 @@
# -- Options for sphinxcontrib-spelling --------------------------------------
# See http://sphinxcontrib-spelling.readthedocs.io/en/latest/customize.html
spelling_word_list_filename='spelling-wordlist.txt'

# -- Options for sphinxcontrib-googleanalytics -------------------------------
# See https://pypi.org/project/sphinxcontrib-googleanalytics/
googleanalytics_id = 'UA-78443762-1'
googleanalytics_enabled = ON_RTD
1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Sphinx >= 1.7
sphinx_rtd_theme >= 0.3
sphinxcontrib-spelling >= 4.1
sphinxcontrib-googleanalytics >= 0.1
8 changes: 5 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ snowballstemmer==1.2.1 \
--hash=sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128 \
--hash=sha256:9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89 \
# via sphinx
sphinx-rtd-theme==0.3.0 \
--hash=sha256:220dbf14814001c6475f0c6c25ac4129a18fb5e3681251a7c6ffb1646da5cc30 \
--hash=sha256:665135dfbdf8f1d218442458a18cf266444354b8c98eed93d1543f7e701cfdba
sphinx-rtd-theme==0.3.1 \
--hash=sha256:32424dac2779f0840b4788fbccb032ba2496c1ca47a439ad2510c8b1e55dfd33 \
--hash=sha256:6d0481532b5f441b075127a2d755f430f1f8410a50112b1af6b069518548381d
sphinx==1.7.4 \
--hash=sha256:2e7ad92e96eff1b2006cf9f0cdb2743dacbae63755458594e9e8238b0c3dc60b \
--hash=sha256:e9b1a75a3eae05dded19c80eb17325be675e0698975baae976df603b6ed1eb10
sphinxcontrib-googleanalytics==0.1 \
--hash=sha256:92b7d74a45defb01e7d29e86fd8206eba42c896b2272cbd1b4b4f6a7d178d5a8
sphinxcontrib-spelling==4.1.0 \
--hash=sha256:769381eb5c791b7ff671457feeae5702142d231ba091a415e0eda695f221358b \
--hash=sha256:9aa05a7b5ad6a9884b01c9823467fab77ea34317697120073158ff365c20711f
Expand Down

0 comments on commit c7ee51c

Please sign in to comment.