Skip to content

Commit 0019abc

Browse files
authored
Merge pull request #3 from cakephp/simple-analytics-badge
add simpleanalytics badge
1 parent 64403b3 commit 0019abc

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script setup>
2+
import { useData } from 'vitepress'
3+
4+
const { isDark } = useData()
5+
</script>
6+
7+
<template>
8+
<div class="sa-badge">
9+
<a
10+
href="https://www.simpleanalytics.com/?utm_source=&utm_content=badge"
11+
referrerpolicy="origin"
12+
target="_blank"
13+
>
14+
<img
15+
:src="isDark
16+
? 'https://simpleanalyticsbadges.com/?mode=dark&background=1a1a1a&text=ff6b6b'
17+
: 'https://simpleanalyticsbadges.com/?mode=light&background=d33c43&text=ffffff'"
18+
loading="lazy"
19+
referrerpolicy="no-referrer"
20+
crossorigin="anonymous"
21+
alt="Simple Analytics"
22+
/>
23+
</a>
24+
</div>
25+
</template>
26+
27+
<style scoped>
28+
.sa-badge {
29+
margin-top: 2rem;
30+
padding-top: 1rem;
31+
}
32+
33+
.sa-badge img {
34+
display: block;
35+
margin: 0 auto;
36+
}
37+
</style>

.vitepress/theme/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import DefaultTheme from 'vitepress/theme-without-fonts'
22
import PageLoader from "./components/PageLoader.vue";
3+
import SimpleAnalyticsBadge from "./components/SimpleAnalyticsBadge.vue";
34
import './custom.css'
45
import { h } from "vue";
56

@@ -8,6 +9,7 @@ export default {
89
Layout() {
910
return h(DefaultTheme.Layout, null, {
1011
'layout-top': () => h(PageLoader),
12+
'aside-outline-after': () => h(SimpleAnalyticsBadge),
1113
})
1214
}
1315
}

0 commit comments

Comments
 (0)