Skip to content

Commit 899082d

Browse files
authored
Merge pull request #549 from python-openapi/fix/sphinx-immaterial-itegration-fix
sphinx-immaterial integration fix
2 parents f6dd268 + 9cc1f3b commit 899082d

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--
2+
Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to
6+
deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8+
sell copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20+
IN THE SOFTWARE.
21+
-->
22+
23+
<!-- Determine analytics provider -->
24+
{% if config.extra.analytics %}
25+
{% set provider = config.extra.analytics.provider %}
26+
{% endif %}
27+
28+
<!-- Set up analytics provider -->
29+
{% if provider %}
30+
{% include "partials/integrations/analytics/" ~ provider ~ ".html" %}
31+
{% endif %}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Determine analytics property -->
2+
{% if config.extra.analytics %}
3+
{% set property = config.extra.analytics.property | d("", true) %}
4+
{% endif %}
5+
6+
<!-- Google Analytics 4 (G-XXXXXXXXXX) -->
7+
{% if property.startswith("G-") %}
8+
<!-- Google tag (gtag.js) -->
9+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ property }}"></script>
10+
<script>
11+
window.dataLayer = window.dataLayer || [];
12+
function gtag(){dataLayer.push(arguments);}
13+
gtag('js', new Date());
14+
15+
gtag('config', '{{ property }}');
16+
</script>
17+
{% endif %}

0 commit comments

Comments
 (0)