From 6b16a0d9ba5b8340a255c5fe829b9e1936d525d2 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 12 Apr 2021 13:02:38 +0100 Subject: [PATCH 1/3] Add GA support --- pytorch_sphinx_theme/layout.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pytorch_sphinx_theme/layout.html b/pytorch_sphinx_theme/layout.html index 839cc3dc..75d31a2d 100644 --- a/pytorch_sphinx_theme/layout.html +++ b/pytorch_sphinx_theme/layout.html @@ -74,7 +74,20 @@ {%- endif %} {%- endblock %} - {%- block extrahead %} {% endblock %} + + {%- block extrahead %} + + {% endblock %} {# Keep modernizr in head - http://modernizr.com/docs/#installing #} From 9e030c030f44c3ab9f8cb38074e8e708310af676 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 12 Apr 2021 13:10:19 +0100 Subject: [PATCH 2/3] use more modern script --- pytorch_sphinx_theme/layout.html | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pytorch_sphinx_theme/layout.html b/pytorch_sphinx_theme/layout.html index 75d31a2d..f57765a3 100644 --- a/pytorch_sphinx_theme/layout.html +++ b/pytorch_sphinx_theme/layout.html @@ -76,17 +76,14 @@ {%- endblock %} {%- block extrahead %} - + + {% endblock %} {# Keep modernizr in head - http://modernizr.com/docs/#installing #} From 5613a4b526ba4f0b8020f75cbf9a5d88698b05d2 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 12 Apr 2021 13:18:06 +0100 Subject: [PATCH 3/3] check if variable exists first --- pytorch_sphinx_theme/layout.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pytorch_sphinx_theme/layout.html b/pytorch_sphinx_theme/layout.html index f57765a3..4a5cf913 100644 --- a/pytorch_sphinx_theme/layout.html +++ b/pytorch_sphinx_theme/layout.html @@ -77,12 +77,14 @@ {%- block extrahead %} - - + {% if theme_analytics_id %} + + + {% endif %} {% endblock %}