add GA to generated docs

This commit is contained in:
Tobias Oberstein
2014-03-18 15:00:40 +01:00
parent 914ea8f750
commit a348e13eba
3 changed files with 27 additions and 1 deletions

View File

@@ -19,6 +19,10 @@ This will create the documentation under
_html
## Custom Page Content
To add custom page content to the generated pages, modify `templates/layout.html`.
## Publishing
> Note: this section is only relevant for administrators of the [Autobahn web site](http://autobahn.ws/).

View File

@@ -50,7 +50,8 @@ if spelling is not None:
extensions.append('sphinxcontrib.spelling')
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
#templates_path = ['_templates']
templates_path = ['templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -131,6 +132,7 @@ else:
#html_theme_options = {}
html_theme_options = {
'analytics_id': 'sdfsfsdf'
# 'footertextcolor': '#ccc',
# 'sidebarbgcolor': '#111',
# 'sidebartextcolor': '#ccc',

20
doc/templates/layout.html vendored Normal file
View File

@@ -0,0 +1,20 @@
{% extends "!layout.html" %}
{%- block extrahead %}
{{ super() }}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-23019220-3', 'autobahn.ws');
ga('send', 'pageview');
</script>
{% endblock %}
{% block footer %}
{{ super() }}
{% endblock %}