Switch to umami for analytics

This commit is contained in:
Michał 2024-11-06 22:14:15 +00:00
parent 91769fa9c4
commit ffd85198ef
4 changed files with 967 additions and 761 deletions

View file

@ -1,3 +1,2 @@
PUBLIC_PLAUSIBLE="false"
PUBLIC_ADDRESS="https://gay.leggy.dev" PUBLIC_ADDRESS="https://gay.leggy.dev"
PUBLIC_COMMENTS="false" PUBLIC_COMMENTS="false"

1672
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -10,12 +10,12 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.9.3", "@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^3.1.5", "@astrojs/mdx": "^3.1.9",
"astro": "^4.15.4", "astro": "4.16.10",
"typescript": "^5.6.2" "typescript": "^5.6.3"
}, },
"devDependencies": { "devDependencies": {
"sass": "^1.78.0" "sass": "^1.80.6"
} }
} }

View file

@ -16,7 +16,6 @@ interface Props {
const { title, plugins, seo } = Astro.props; const { title, plugins, seo } = Astro.props;
const plausible = import.meta.env.PUBLIC_PLAUSIBLE !== "false";
const address = import.meta.env.PUBLIC_ADDRESS; const address = import.meta.env.PUBLIC_ADDRESS;
--- ---
@ -51,20 +50,17 @@ const address = import.meta.env.PUBLIC_ADDRESS;
href="https://api.fontshare.com/v2/css?f[]=jet-brains-mono@400&f[]=general-sans@1&display=swap" href="https://api.fontshare.com/v2/css?f[]=jet-brains-mono@400&f[]=general-sans@1&display=swap"
/> />
{plausible ? ( <!--
<link If you want to disable your visits from being counted,
rel="preconnect" run "localStorage.setItem('umami.disabled', 1);"
href="https://plausible.leggy.dev" in the JS console (without the quotation marks).
> -->
<script <script
is:inline defer
defer src="https://umami.leggy.dev/script.js"
data-domain="gay.leggy.dev" data-website-id="e8c4fb4f-6ff2-4179-8873-957d635c862c"
src="https://plausible.leggy.dev/js/script.js" />
></script>
) : (
<script is:inline>console.log("Plausible Disabled");</script>
)}
{plugins?.katex && ( {plugins?.katex && (
<link <link
rel="preconnect" rel="preconnect"
@ -127,6 +123,10 @@ const address = import.meta.env.PUBLIC_ADDRESS;
</div> </div>
<main> <main>
<slot /> <slot />
<p id="anal_notice">
This website tracks anonymous analytics. To see them in action visit
<a href="https://umami.leggy.dev/share/jNKQaN97seslziXY/gay.leggy.dev" target="_blank">umami.leggy.dev</a>!
</p>
</main> </main>
</body> </body>
<script> <script>
@ -160,4 +160,19 @@ const address = import.meta.env.PUBLIC_ADDRESS;
outline: 0 solid transparent; outline: 0 solid transparent;
} }
} }
#anal_notice {
padding-top: 16px;
margin-bottom: -16px;
color: $light;
font-size: 11px;
text-align: center;
> a {
color: $accent;
&:hover {
color: $light;
}
}
}
</style> </style>