Skip to content

add simpleanalytics badge#3

Merged
josbeir merged 1 commit intomainfrom
simple-analytics-badge
Feb 15, 2026
Merged

add simpleanalytics badge#3
josbeir merged 1 commit intomainfrom
simple-analytics-badge

Conversation

@josbeir
Copy link
Collaborator

@josbeir josbeir commented Feb 15, 2026

This PR adds the official simpleanalytics plugin in the form of a vitepress Vue plugin.

image image

Copilot AI review requested due to automatic review settings February 15, 2026 17:01
@josbeir josbeir merged commit 0019abc into main Feb 15, 2026
6 checks passed
@josbeir josbeir deleted the simple-analytics-badge branch February 15, 2026 17:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 SimpleAnalyticsBadge component 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.

Comment on lines 8 to 13
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
'layout-top': () => h(PageLoader),
'aside-outline-after': () => h(SimpleAnalyticsBadge),
})
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.

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.

Copilot uses AI. Check for mistakes.
<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.
<div class="sa-badge">
<a
href="https://www.simpleanalytics.com/?utm_source=&utm_content=badge"
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant