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

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Nicolas MASSART 6 years ago committed by GitHub
parent 27c3ad5f78
commit deaaf0328a
  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 %} {% 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"> <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>. Questions or feedback? You can discuss issues and obtain free support on <a href="{{config.extra.support.gitter}}">Pegasys Pantheon Gitter room</a>.
<br/> <br/>
@ -139,8 +103,3 @@
</div> </div>
</div> </div>
</footer> </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 # Project information
site_name: Pantheon site_name: Pantheon
site_url: https://pantheon.readthedocs.io/ site_url: https://doc.pantheon.pegasys.tech/
site_description: Pantheon Java Ethereum client documentation. site_description: Pantheon Java Ethereum client documentation.
site_author: Pantheon community site_author: Pantheon community
copyright: Pantheon and its documentation are licensed under Apache 2.0 license / 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>. 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 project info and template customisation
extra: extra:

Loading…
Cancel
Save