@lupinum/ginko-docs 0.2.5 → 0.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -8,14 +8,14 @@ Ginko Docs is a Nuxt layer for focused documentation sites. It combines Ginko Co
|
|
|
8
8
|
- Nuxt `>=4.4.7 <5`
|
|
9
9
|
- Vue `^3.5.35`
|
|
10
10
|
- Vue Router `^5.1.0`
|
|
11
|
-
- Ginko Content `>=0.
|
|
11
|
+
- Ginko Content `>=0.4.0-rc.1 <0.5.0`
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
Install the layer and its Ginko Content peer:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
pnpm add -D @lupinum/ginko-docs @lupinum/ginko-content@0.
|
|
18
|
+
pnpm add -D @lupinum/ginko-docs@0.3.0-rc.1 @lupinum/ginko-content@0.4.0-rc.1
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Keep the public identity in one shared value:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Button } from "#ginko-docs/components/ui/button";
|
|
3
|
-
import { computed, ref } from "vue";
|
|
4
|
-
import { useI18n,
|
|
3
|
+
import { computed, ref, watch } from "vue";
|
|
4
|
+
import { useI18n, useRouter } from "#imports";
|
|
5
5
|
import { useGinkoAnalytics } from "#ginko-docs/composables/useGinkoAnalytics";
|
|
6
6
|
import { useGinkoDocsConfig } from "#ginko-docs/composables/useGinkoDocsConfig";
|
|
7
7
|
import { buildRepoIssueUrl } from "#ginko-docs/utils/repository";
|
|
@@ -15,7 +15,7 @@ withDefaults(
|
|
|
15
15
|
},
|
|
16
16
|
);
|
|
17
17
|
const { t, locale } = useI18n();
|
|
18
|
-
const
|
|
18
|
+
const router = useRouter();
|
|
19
19
|
|
|
20
20
|
const config = useGinkoDocsConfig();
|
|
21
21
|
const analytics = useGinkoAnalytics();
|
|
@@ -24,20 +24,24 @@ const enabled = config.feedback.enabled && analytics.enabled;
|
|
|
24
24
|
type Sentiment = "positive" | "negative";
|
|
25
25
|
|
|
26
26
|
const sentiment = ref<Sentiment | null>(null);
|
|
27
|
+
const routePath = computed(() => router.currentRoute.value.path);
|
|
28
|
+
watch(routePath, () => {
|
|
29
|
+
sentiment.value = null;
|
|
30
|
+
});
|
|
27
31
|
|
|
28
32
|
const issueUrl = computed(() => {
|
|
29
33
|
const repository = config.repository;
|
|
30
34
|
if (!repository) return null;
|
|
31
35
|
return buildRepoIssueUrl(repository, {
|
|
32
|
-
title: t("feedback.issueTitle", { path:
|
|
33
|
-
body: t("docs.issueBody", { path:
|
|
36
|
+
title: t("feedback.issueTitle", { path: routePath.value }),
|
|
37
|
+
body: t("docs.issueBody", { path: routePath.value }),
|
|
34
38
|
});
|
|
35
39
|
});
|
|
36
40
|
|
|
37
41
|
function selectSentiment(s: Sentiment) {
|
|
38
42
|
if (sentiment.value !== null) return;
|
|
39
43
|
analytics.track("docs-feedback", {
|
|
40
|
-
path:
|
|
44
|
+
path: routePath.value,
|
|
41
45
|
helpful: s === "positive" ? "yes" : "no",
|
|
42
46
|
locale: locale.value,
|
|
43
47
|
});
|
|
@@ -10,28 +10,32 @@ export interface GinkoAnalytics {
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Plausible analytics via the Nuxt Scripts registry script. Fully disabled
|
|
13
|
-
* unless `ginkoDocs.analytics.plausible.
|
|
14
|
-
*
|
|
13
|
+
* unless `ginkoDocs.analytics.plausible.scriptId` is configured. Without an
|
|
14
|
+
* ID, no script loads and `track()` is a no-op, so callers never guard.
|
|
15
15
|
*/
|
|
16
16
|
export function useGinkoAnalytics(): GinkoAnalytics {
|
|
17
17
|
const config = useGinkoDocsConfig();
|
|
18
|
-
const
|
|
18
|
+
const scriptId = config.analytics?.plausible?.scriptId?.trim();
|
|
19
19
|
|
|
20
|
-
if (!
|
|
20
|
+
if (!scriptId) {
|
|
21
21
|
return { enabled: false, track: () => {} };
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const script = useScriptPlausibleAnalytics({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
scriptId,
|
|
26
|
+
// The site ID comes from app.config at runtime. Keep the vendor script
|
|
27
|
+
// external so Nuxt Scripts does not bundle its legacy fallback URL during
|
|
28
|
+
// the build-time transform.
|
|
29
|
+
scriptOptions: { bundle: false },
|
|
28
30
|
});
|
|
29
31
|
|
|
30
32
|
return {
|
|
31
33
|
enabled: true,
|
|
32
34
|
track: (event, props) => {
|
|
33
35
|
if (!import.meta.client) return;
|
|
34
|
-
script.proxy.plausible
|
|
36
|
+
const plausible = script.proxy.plausible;
|
|
37
|
+
if (typeof plausible !== "function") return;
|
|
38
|
+
plausible(event, props ? { props } : undefined);
|
|
35
39
|
},
|
|
36
40
|
};
|
|
37
41
|
}
|
package/nuxt.config.ts
CHANGED
|
@@ -43,7 +43,7 @@ export default defineNuxtConfig({
|
|
|
43
43
|
},
|
|
44
44
|
mcp: {
|
|
45
45
|
name: "Ginko Docs",
|
|
46
|
-
version: "0.
|
|
46
|
+
version: "0.3.0-rc.1",
|
|
47
47
|
},
|
|
48
48
|
components: {
|
|
49
49
|
dirs: [
|
|
@@ -127,7 +127,7 @@ export default defineNuxtConfig({
|
|
|
127
127
|
markdown: {
|
|
128
128
|
plugins: [
|
|
129
129
|
[
|
|
130
|
-
"
|
|
130
|
+
"shiki",
|
|
131
131
|
{
|
|
132
132
|
preStyles: false,
|
|
133
133
|
transformers: [transformerNotationDiff(), transformerNotationHighlight()],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lupinum/ginko-docs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-rc.1",
|
|
4
4
|
"description": "A Nuxt documentation layer powered by Ginko Content.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"content",
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"markdown",
|
|
10
10
|
"nuxt"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://ginko-docs.lupinum.com",
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/lupinum-dev/ginko-docs/issues"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/
|
|
19
|
+
"url": "git+https://github.com/lupinum-dev/ginko-docs.git",
|
|
20
20
|
"directory": "layer"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"clsx": "^2.1.1",
|
|
73
73
|
"motion-v": "^2.3.0",
|
|
74
74
|
"nitropack": "^2.13.4",
|
|
75
|
-
"nuxt-og-image": "^6.7.
|
|
75
|
+
"nuxt-og-image": "^6.7.8",
|
|
76
76
|
"reka-ui": "^2.10.3",
|
|
77
|
-
"satori": "^0.
|
|
77
|
+
"satori": "^0.19.3",
|
|
78
78
|
"shiki": "^4.4.3",
|
|
79
79
|
"tailwind-merge": "^3.6.0",
|
|
80
80
|
"tailwindcss": "^4.3.3",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"zod": "^4.4.3"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
|
-
"@lupinum/ginko-content": ">=0.
|
|
85
|
+
"@lupinum/ginko-content": ">=0.4.0-rc.1 <0.5.0",
|
|
86
86
|
"nuxt": ">=4.4.7 <5",
|
|
87
87
|
"vue": "^3.5.35",
|
|
88
88
|
"vue-router": "^5.1.0"
|
|
@@ -58,17 +58,6 @@ export type GinkoDocsHeroMedia =
|
|
|
58
58
|
| { type: "code"; code: string; language?: string; filename?: string }
|
|
59
59
|
| { type: "code-tabs"; tabs: GinkoDocsHeroCodeTab[] };
|
|
60
60
|
|
|
61
|
-
export type GinkoDocsPlausibleExtension =
|
|
62
|
-
| "hash"
|
|
63
|
-
| "outbound-links"
|
|
64
|
-
| "file-downloads"
|
|
65
|
-
| "tagged-events"
|
|
66
|
-
| "revenue"
|
|
67
|
-
| "pageview-props"
|
|
68
|
-
| "compat"
|
|
69
|
-
| "local"
|
|
70
|
-
| "manual";
|
|
71
|
-
|
|
72
61
|
export interface GinkoDocsAppConfig {
|
|
73
62
|
theme: {
|
|
74
63
|
neutral: GinkoDocsNeutralPalette;
|
|
@@ -99,12 +88,8 @@ export interface GinkoDocsAppConfig {
|
|
|
99
88
|
};
|
|
100
89
|
analytics?: {
|
|
101
90
|
plausible?: {
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
/** Self-hosted Plausible script URL override. */
|
|
105
|
-
scriptSrc?: string;
|
|
106
|
-
/** Plausible script extensions, e.g. ["outbound-links", "file-downloads"]. */
|
|
107
|
-
extensions?: GinkoDocsPlausibleExtension[];
|
|
91
|
+
/** Public site-specific ID from the Plausible pa-<id>.js script URL. */
|
|
92
|
+
scriptId?: string;
|
|
108
93
|
};
|
|
109
94
|
};
|
|
110
95
|
social: Partial<Record<GinkoDocsSocialPlatform, GinkoDocsSocialEntry>>;
|