Add Google analytics to doc site (#471)

* Fixes #440 add analytics

and move scripts and css to header by overriding blocks in main

* Fixes domain namenow that we have doc.pantheon.pegasys.tech
Nicolas MASSART 6 years ago committed by GitHub
parent 6b60370a35
commit 4735fd488e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      docs/custom_theme/assets/stylesheets/pantheon_custom.css
  2. 24
      docs/custom_theme/main.html
  3. 41
      docs/custom_theme/partials/footer.html
  4. 4
      mkdocs.yml

@ -0,0 +1,31 @@
.feedback{
padding: 1em;
text-align: center;
background-color: {{config.extra.support.footer_layout.background_color}};
}
.feedback a {
color: {{config.extra.support.footer_layout.links_color}} !important;
}
.md-nav--secondary .md-nav__item .md-nav__item a.md-nav__link {
font-weight: normal;
font-size: inherit;
}
.md-nav--secondary a.md-nav__link {
font-weight: bolder;
<!--font-size: larger;-->
}
.rst-versions {
border-color: lightseagreen !important;
border-style: solid !important;
font-size: large;
}
.rst-versions .rst-current-version {
background-color: #475c64 !important;
}
.headerlink {
font-family: "Font Awesome 5 Free";
font-weight: 900;
font-size: small;
}

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block extrahead %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/pantheon_custom.css' | url }}">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous">
<script
src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>
{% endblock %}
{% block analytics %}
{% if config.google_analytics %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config.google_analytics[0] }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ config.google_analytics[0] }}');
</script>
{% endif %}
{% endblock %}

@ -22,42 +22,6 @@
{% import "partials/language.html" as lang with context %}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous">
<style>
.feedback{
padding: 1em;
text-align: center;
background-color: {{config.extra.support.footer_layout.background_color}};
}
.feedback a {
color: {{config.extra.support.footer_layout.links_color}} !important;
}
.md-nav--secondary .md-nav__item .md-nav__item a.md-nav__link {
font-weight: normal;
font-size: inherit;
}
.md-nav--secondary a.md-nav__link {
font-weight: bolder;
<!--font-size: larger;-->
}
.rst-versions {
border-color: lightseagreen !important;
border-style: solid !important;
font-size: large;
}
.rst-versions .rst-current-version {
background-color: #475c64 !important;
}
.headerlink {
font-family: "Font Awesome 5 Free";
font-weight: 900;
font-size: small;
}
</style>
<div class="feedback md-typeset">
Questions or feedback? You can discuss issues and obtain free support on <a href="{{config.extra.support.gitter}}">Pegasys Pantheon Gitter room</a>.
<br/>
@ -139,8 +103,3 @@
</div>
</div>
</footer>
<script
src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>

@ -11,12 +11,12 @@
# Project information
site_name: Pantheon
site_url: https://pantheon.readthedocs.io/
site_url: https://doc.pantheon.pegasys.tech/
site_description: Pantheon Java Ethereum client documentation.
site_author: Pantheon community
copyright: Pantheon and its documentation are licensed under Apache 2.0 license /
This <a href="https://readthedocs.org/">Readthedocs.org</a> documentation is maintained with love by <a href="https://pegasys.tech/">PegaSys</a>.
#google_analytics: ['UA-36723568-3', 'pantheon.readthedocs.io']
google_analytics: ['UA-117921923-2', 'doc.pantheon.pegasys.tech']
#extra project info and template customisation
extra:

Loading…
Cancel
Save