@karaoke-cms/module-comments 0.9.3 → 0.9.6
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 +21 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,46 +1,34 @@
|
|
|
1
1
|
# @karaoke-cms/module-comments
|
|
2
2
|
|
|
3
|
-
Giscus comments module for karaoke-cms. Embeds GitHub
|
|
3
|
+
Giscus comments module for karaoke-cms. Embeds GitHub Discussion threads on blog posts and docs pages.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Status
|
|
6
|
+
|
|
7
|
+
**Stub** — not yet a standalone module. Comments work today via the `comments:` field in `karaoke.config.ts`. No separate install needed.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
## Usage (current)
|
|
8
10
|
|
|
9
11
|
```ts
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
// karaoke.config.ts
|
|
13
|
+
import { defineConfig } from '@karaoke-cms/astro';
|
|
14
|
+
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
// ...
|
|
17
|
+
comments: {
|
|
18
|
+
enabled: true,
|
|
19
|
+
repo: 'owner/repo',
|
|
20
|
+
repoId: 'R_...',
|
|
21
|
+
category: 'General',
|
|
22
|
+
categoryId: 'DIC_...',
|
|
21
23
|
},
|
|
22
|
-
};
|
|
24
|
+
});
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
Get `repoId` and `categoryId` from [giscus.app](https://giscus.app) after enabling GitHub Discussions on your repository.
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Renders a [Giscus](https://giscus.app) widget at the bottom of each blog post. Giscus maps GitHub Discussion threads to pages by URL, so each post automatically gets its own comment thread backed by your repo's Discussions tab.
|
|
30
|
-
|
|
31
|
-
`Comments.astro` is rendered by `ModuleLoader.astro` when `resolvedModules.comments.enabled` is true. It loads the Giscus `<script>` with your repo configuration. No server required — all comments are stored in GitHub Discussions.
|
|
32
|
-
|
|
33
|
-
Config is validated at build time: if `enabled: true` but any of `repo`, `repoId`, `category`, `categoryId` are missing, the build fails with a clear error pointing to giscus.app.
|
|
34
|
-
|
|
35
|
-
## Status
|
|
36
|
-
|
|
37
|
-
**Stub** — the package structure exists but `src/` is empty. The current implementation lives directly inside `@karaoke-cms/astro` (`src/modules/comments/Comments.astro`). This package will be split out as a standalone module in a future release.
|
|
38
|
-
|
|
39
|
-
To enable comments today: set `modules.comments` in `karaoke.config.ts` as shown above. No separate package install needed.
|
|
29
|
+
Individual posts and docs can override with `comments: false` in frontmatter.
|
|
40
30
|
|
|
41
|
-
##
|
|
31
|
+
## What's new in 0.9.5
|
|
42
32
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
- Adds a third-party script load (`giscus.app`) to every post page. If privacy or performance is a concern, keep `enabled: false`.
|
|
46
|
-
- All comment data lives in GitHub, not your site — no database or server required.
|
|
33
|
+
- `comments:` is now a top-level field in `karaoke.config.ts` (was `modules.comments` in previous versions)
|
|
34
|
+
- No user-facing behavior change
|