Fixes the GA scripts place to move them to headers and add site verif tag (#479)

Fixes #440 as RTD rewrites the GA scripts, was not expected, and we missed the
site verification meta tag to enable GA search console link
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Nicolas MASSART 6 years ago committed by GitHub
parent 4dd4cb1249
commit 26ea7f9ff6
  1. 27
      docs/custom_theme/main.html
  2. 4
      mkdocs.yml

@ -7,18 +7,25 @@
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 %}
{% if config.extra.google.analytics_id %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config.google_analytics[0] }}"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{config.extra.google.analytics_id}}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{config.extra.google.analytics_id}}');
</script>
{% endif %}
gtag('config', '{{ config.google_analytics[0] }}');
</script>
{% if config.extra.google.site_verification %}
<!-- Google site verification for search console -->
<meta name="google-site-verification" content="{{config.extra.google.site_verification}}" />
{% endif %}
{% endblock %}
{% endblock %}
{% block analytics %}
<!--Empty the footer analytics bloc as we need it the headers -->
{% endblock %}

@ -16,7 +16,6 @@ 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-117921923-2', 'doc.pantheon.pegasys.tech']
#extra project info and template customisation
extra:
@ -26,6 +25,9 @@ extra:
footer_layout:
background_color: lightseagreen
links_color: white
google:
analytics_id: 'UA-117921923-2'
site_verification: 'za1cLzyS6LXDGO-pMzvfQdYTZ0Zc67uZtY0asA4YXZ0'
# Repository

Loading…
Cancel
Save