Skip to content
Merged
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
5 changes: 5 additions & 0 deletions docs/src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Header from "@/partials/Header.astro";
import "@/styles/main.css";
import { ClientRouter } from "astro:transitions";
import PlausibleAnalytics from "@/components/PlausibleAnalytics.astro";
import Intercom from "@/components/Intercom.astro";

// types for frontmatters
export interface Props {
Expand Down Expand Up @@ -122,6 +123,10 @@ const { seo, structuredData } = Astro.props;
})();
</script>
<!-- SegMetrics END -->

<!-- Intercom -->
<Intercom />
<!-- Intercom END -->
</head>
<body class="antialiased">
<!-- Google Tag Manager (noscript) -->
Expand Down
41 changes: 41 additions & 0 deletions docs/src/layouts/components/Intercom.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script is:inline>
window.intercomSettings = {
api_base: "https://api-iam.intercom.io",
app_id: "wbadhzkf",
};
</script>
<script is:inline>
(function () {
var w = window;
var ic = w.Intercom;
if (typeof ic === "function") {
ic("reattach_activator");
ic("update", w.intercomSettings);
} else {
var d = document;
var i = function () {
i.c(arguments);
};
i.q = [];
i.c = function (args) {
i.q.push(args);
};
w.Intercom = i;
var l = function () {
var s = d.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "https://widget.intercom.io/widget/wbadhzkf";
var x = d.getElementsByTagName("script")[0];
x.parentNode.insertBefore(s, x);
};
if (document.readyState === "complete") {
l();
} else if (w.attachEvent) {
w.attachEvent("onload", l);
} else {
w.addEventListener("load", l, false);
}
}
})();
</script>
Loading