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
37 changes: 37 additions & 0 deletions .vitepress/theme/components/SimpleAnalyticsBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup>
import { useData } from 'vitepress'

const { isDark } = useData()
</script>

<template>
<div class="sa-badge">
<a
href="https://www.simpleanalytics.com/?utm_source=&utm_content=badge"
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The badge link includes an empty utm_source query parameter (utm_source=). This makes attribution ambiguous and may break Simple Analytics’ intended UTM tracking. Either populate utm_source with a meaningful value (e.g., site/domain) or remove the utm_source parameter entirely.

Suggested change
href="https://www.simpleanalytics.com/?utm_source=&utm_content=badge"
href="https://www.simpleanalytics.com/?utm_source=website&utm_content=badge"

Copilot uses AI. Check for mistakes.
referrerpolicy="origin"
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Links opened with target="_blank" should include rel="noopener noreferrer" to prevent the new page from being able to access window.opener (tabnabbing risk). Add the appropriate rel attribute on this anchor.

Suggested change
referrerpolicy="origin"
referrerpolicy="origin"
rel="noopener noreferrer"

Copilot uses AI. Check for mistakes.
target="_blank"
>
<img
:src="isDark
? 'https://simpleanalyticsbadges.com/?mode=dark&background=1a1a1a&text=ff6b6b'
: 'https://simpleanalyticsbadges.com/?mode=light&background=d33c43&text=ffffff'"
loading="lazy"
referrerpolicy="no-referrer"
crossorigin="anonymous"
alt="Simple Analytics"
/>
</a>
</div>
</template>

<style scoped>
.sa-badge {
margin-top: 2rem;
padding-top: 1rem;
}

.sa-badge img {
display: block;
margin: 0 auto;
}
</style>
2 changes: 2 additions & 0 deletions .vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import DefaultTheme from 'vitepress/theme-without-fonts'
import PageLoader from "./components/PageLoader.vue";
import SimpleAnalyticsBadge from "./components/SimpleAnalyticsBadge.vue";
import './custom.css'
import { h } from "vue";

Expand All @@ -8,6 +9,7 @@ export default {
Layout() {
return h(DefaultTheme.Layout, null, {
'layout-top': () => h(PageLoader),
'aside-outline-after': () => h(SimpleAnalyticsBadge),
})
}
}