chore: only gather analytics on hexdocs

This commit is contained in:
Zach Daniel 2023-10-02 10:56:05 -04:00
parent d0e901b759
commit 07fd9920ab

10
mix.exs
View file

@ -118,7 +118,15 @@ defmodule AshPostgres.MixProject do
before_closing_head_tag: fn type ->
if type == :html do
"""
<script defer data-domain="ashhexdocs" src="https://plausible.io/js/script.js"></script>
<script>
if (location.hostname === "hexdocs.pm") {
var script = document.createElement("script");
script.src = "https://plausible.io/js/script.js";
script.setAttribute("defer", "defer")
script.setAttribute("data-domain", "ashhexdocs")
document.head.appendChild(script);
}
</script>
"""
end
end,