Skip to content

Commit dc5a2ba

Browse files
committed
chore: add onedollarstats dependency and configure analytics in VitePress
1 parent dcb9ad4 commit dc5a2ba

4 files changed

Lines changed: 25 additions & 4 deletions

File tree

bun.lock

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.vitepress/config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
import { defineConfig } from "vitepress";
1+
import { defineConfig, type HeadConfig } from "vitepress";
2+
3+
const analyticsScript: HeadConfig = [
4+
"script",
5+
{
6+
defer: "true",
7+
src: "https://assets.onedollarstats.com/stonks.js",
8+
"data-hash-routing": "false",
9+
"data-autocollect": "true",
10+
},
11+
];
212

313
export default defineConfig({
414
title: "Solid Simple Maps",
515
description:
616
"Create beautiful SVG maps in SolidJS with d3-geo and topojson using a declarative API.",
717
base: "/",
18+
head: [analyticsScript],
819
themeConfig: {
920
nav: [
1021
{ text: "Home", link: "/" },

example/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11+
"@tailwindcss/vite": "^4.1.17",
12+
"onedollarstats": "^0.0.11",
1113
"solid-js": "^1.8.0",
1214
"solid-simple-maps": "workspace:*",
13-
"tailwindcss": "^4.1.17",
14-
"@tailwindcss/vite": "^4.1.17"
15+
"tailwindcss": "^4.1.17"
1516
},
1617
"devDependencies": {
1718
"@types/node": "^20.0.0",

example/src/main.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
import { configure } from "onedollarstats";
12
import { render } from "solid-js/web";
23
import App from "./App";
34
import "./index.css";
45

6+
configure({
7+
autocollect: true,
8+
hashRouting: false,
9+
});
10+
511
const appElement = document.getElementById("app");
612
if (appElement) {
713
render(() => <App />, appElement);

0 commit comments

Comments
 (0)