@karaoke-cms/module-comments 0.9.3 → 0.9.5

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.
Files changed (2) hide show
  1. package/README.md +21 -33
  2. 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 discussion threads on blog posts.
3
+ Giscus comments module for karaoke-cms. Embeds GitHub Discussion threads on blog posts and docs pages.
4
4
 
5
- ## Where it belongs
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
- `packages/module-comments/` in the monorepo. Enabled via `karaoke.config.ts`:
9
+ ## Usage (current)
8
10
 
9
11
  ```ts
10
- export default {
11
- vault: KARAOKE_VAULT,
12
- theme: '@karaoke-cms/theme-default',
13
- modules: {
14
- comments: {
15
- enabled: true,
16
- repo: 'owner/repo',
17
- repoId: 'R_...',
18
- category: 'General',
19
- categoryId: 'DIC_...',
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
- ## What it does
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
- ## How it changes the behavior of the system
31
+ ## What's new in 0.9.5
42
32
 
43
- - When enabled, a Giscus thread is embedded at the bottom of every blog post page. Docs pages do not get comments.
44
- - Requires a public GitHub repository with Discussions enabled — comments are not possible on private repos.
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@karaoke-cms/module-comments",
3
3
  "type": "module",
4
- "version": "0.9.3",
4
+ "version": "0.9.5",
5
5
  "description": "Giscus comments module for karaoke-cms",
6
6
  "keywords": [
7
7
  "astro",