Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ jobs:

sudo rm -rf temp

- name: Use latest template overrides from main
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
run: |
git show origin/main:docs/overrides/main.html > docs/overrides/main.html

- name: Enable Reo and Scarf tracking for versioned docs
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && github.event.action == 'published')
run: |
sed -i 's/enable_scarf_pixel: false/enable_scarf_pixel: true/' mkdocs.yml
sed -i 's/enable_reo_flag: false/enable_reo_flag: true/' mkdocs.yml
echo "Tracking flags status:"
grep -E 'enable_scarf_pixel|enable_reo_flag' mkdocs.yml

- name: mike deploy ${{ github.event.inputs.version }}
if: >-
github.event_name == 'workflow_dispatch'
Expand Down
3 changes: 3 additions & 0 deletions docs/assets/js/reo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Start of Reo Javascript
!function(){var e,t,n;e="d879136bc2a2e75",t=function(){Reo.init({clientID:"d879136bc2a2e75"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.defer=!0,n.onload=t,document.head.appendChild(n)}();
// End of Reo Javascript
19 changes: 19 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "base.html" %}

{% block content %}
{{ super() }}
{% endblock %}

{% block scripts %}
{{ super() }}

{% if config.extra.enable_scarf_pixel | default(false) %}
<img referrerpolicy="no-referrer-when-downgrade"
src="https://static.scarf.sh/a.png?x-pxid=2c347abc-a9b4-4c4b-bdc9-2682edbcc0c9"
width="0" height="0"/>
{% endif %}
{% if config.extra.enable_reo_flag | default(false) %}
<script src="{{ base_url }}/assets/js/reo.js" defer></script>
{% endif %}

{% endblock %}
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins:
# Configuration
theme:
name: material
custom_dir: docs/overrides
highlightjs: true
hljs_languages:
- yaml
Expand Down Expand Up @@ -98,6 +99,8 @@ markdown_extensions:
emoji_index: !!python/name:material.extensions.emoji.twemoji

extra:
enable_scarf_pixel: false
enable_reo_flag: false
generator: false
social:
- icon: fontawesome/brands/github
Expand Down