Skip to content

Commit

Permalink
Override analytics block instead of partial (#8656)
Browse files Browse the repository at this point in the history
This extends the default analytics block instead of replacing
the entire partial, so that we can use other mkdocs-material
behaviors.
  • Loading branch information
jawnsy authored Feb 27, 2023
1 parent cdf7876 commit dbb6b27
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
12 changes: 12 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "base.html" %}

{% block announce %}
<div style="color: white;">
<a href="https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md#release-283" style="color: #07e798;">
Expand All @@ -19,3 +20,14 @@
</a>
</div> -->
{% endblock %}

{% block analytics %}
{{ super() }}

<script>
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="xDLAoTXsNYpC4Y6JucKnJ8W1MYBuyAbD";;analytics.SNIPPET_VERSION="4.15.3";
analytics.load("xDLAoTXsNYpC4Y6JucKnJ8W1MYBuyAbD");
analytics.page();
}}();
</script>
{% endblock %}
16 changes: 0 additions & 16 deletions docs/overrides/partials/integrations/analytics/custom.html

This file was deleted.

4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ extra:
version:
provider: mike
analytics:
provider: custom
provider: google
property: G-3M31G9B0QJ
social:
- icon: fontawesome/brands/slack
Expand All @@ -294,4 +294,4 @@ extra:
- icon: fontawesome/brands/docker
link: https://hub.docker.com/r/prefecthq/prefect/
- icon: fontawesome/brands/python
link: https://pypi.org/project/prefect/
link: https://pypi.org/project/prefect/

0 comments on commit dbb6b27

Please sign in to comment.