Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Simple Analytics badge to the VitePress site theme so it appears in the docs layout sidebar area.
Changes:
- Injects a new
SimpleAnalyticsBadgecomponent into the VitePress theme layout via a theme slot. - Adds
SimpleAnalyticsBadge.vue, which renders a light/dark-mode badge image linking to Simple Analytics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.vitepress/theme/index.js |
Wires the new badge component into the VitePress theme layout slots. |
.vitepress/theme/components/SimpleAnalyticsBadge.vue |
Implements the badge UI, including dark/light image URL switching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| extends: DefaultTheme, | ||
| Layout() { | ||
| return h(DefaultTheme.Layout, null, { | ||
| 'layout-top': () => h(PageLoader), | ||
| 'aside-outline-after': () => h(SimpleAnalyticsBadge), | ||
| }) |
There was a problem hiding this comment.
PR description says this adds the “official simpleanalytics plugin”, but the implementation here is a theme slot injection of a badge component (no VitePress plugin registered under .vitepress/plugins or via enhanceApp). Either adjust the PR description/title to match, or implement this as an actual plugin if that’s the intent.
| <template> | ||
| <div class="sa-badge"> | ||
| <a | ||
| href="https://www.simpleanalytics.com/?utm_source=&utm_content=badge" |
There was a problem hiding this comment.
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.
| href="https://www.simpleanalytics.com/?utm_source=&utm_content=badge" | |
| href="https://www.simpleanalytics.com/?utm_source=website&utm_content=badge" |
| <div class="sa-badge"> | ||
| <a | ||
| href="https://www.simpleanalytics.com/?utm_source=&utm_content=badge" | ||
| referrerpolicy="origin" |
There was a problem hiding this comment.
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.
| referrerpolicy="origin" | |
| referrerpolicy="origin" | |
| rel="noopener noreferrer" |
This PR adds the official simpleanalytics plugin in the form of a vitepress Vue plugin.