Skip to content

Commit 0e98d41

Browse files
committed
Parrot
1 parent 8bb064d commit 0e98d41

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

hugo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ disableKinds = ["taxonomy", "term"]
3939
env = "production"
4040
google_analytics_id = "G-VM01Q3R43D"
4141
microsoft_clarity_id = "mxr4hxioh4"
42+
tawk_property_id = "65e349c48d261e1b5f67a15f"
43+
tawk_widget_id = "1hnvtgaht"
4244
# Add static/images/og-default.png (1200×630) for better social sharing; omit or leave empty to use logo
4345
default_og_image = "images/og-default.jpg"
4446

layouts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
{{ partial "cookie-consent.html" . }}
3939
{{ partial "home/search-palette.html" . }}
4040
<script src="/js/site.min.js" defer></script>
41+
{{ partial "tawk-to.html" . }}
4142
<script src="/js/home.min.js" defer></script>
4243
<script>
4344
(function () {

layouts/partials/home/modern-page-end.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
{{ partial "home/search-palette.html" $page }}
2121
{{- end -}}
2222
<script src="/js/site.min.js" defer></script>
23+
{{ partial "tawk-to.html" $page }}
2324
</body>
2425
</html>

layouts/partials/tawk-to.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- $propertyId := .Site.Params.tawk_property_id | default "65e349c48d261e1b5f67a15f" -}}
2+
{{- $widgetId := .Site.Params.tawk_widget_id | default "1hnvtgaht" -}}
3+
{{- if and $propertyId $widgetId -}}
4+
<script>
5+
(function () {
6+
var fired = false;
7+
function loadTawk() {
8+
if (fired) return;
9+
fired = true;
10+
window.Tawk_API = window.Tawk_API || {};
11+
window.Tawk_LoadStart = new Date();
12+
var s1 = document.createElement('script');
13+
var s0 = document.getElementsByTagName('script')[0];
14+
s1.async = true;
15+
s1.src = 'https://embed.tawk.to/{{ $propertyId }}/{{ $widgetId }}';
16+
s1.charset = 'UTF-8';
17+
s1.setAttribute('crossorigin', '*');
18+
s0.parentNode.insertBefore(s1, s0);
19+
}
20+
['scroll', 'click', 'keydown', 'touchstart'].forEach(function (ev) {
21+
window.addEventListener(ev, loadTawk, { once: true, passive: true });
22+
});
23+
})();
24+
</script>
25+
{{- end -}}

0 commit comments

Comments
 (0)