@karaoke-cms/module-tags 0.18.0 → 0.19.0

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
@@ -52,6 +52,10 @@ tags: [javascript, tutorial]
52
52
 
53
53
  No additional frontmatter fields are added by this module.
54
54
 
55
+ ## What's new in 0.18.2
56
+
57
+ No user-facing changes in this release.
58
+
55
59
  ## What's new in 0.18.0
56
60
 
57
61
  - **Dynamic content source indexing** — the tags module now discovers and indexes all enabled content sources (blog and every active docs section) automatically, instead of querying a hardcoded blog collection. Adding or removing modules updates the tag index without any config changes.
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@karaoke-cms/module-tags",
3
3
  "type": "module",
4
- "version": "0.18.0",
4
+ "version": "0.19.0",
5
5
  "description": "Tags module for karaoke-cms — cross-collection tag index with per-tag RSS feeds",
6
6
  "main": "./src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts",
9
9
  "./pages/index": "./src/pages/index.astro",
10
10
  "./pages/tag": "./src/pages/tag.astro",
11
- "./pages/tag-rss": "./src/pages/tag-rss.ts"
11
+ "./pages/tag-rss": "./src/pages/tag-rss.ts",
12
+ "./tags-styles.css": "./src/styles/tags-styles.css"
12
13
  },
13
14
  "files": [
14
15
  "src/"
@@ -25,14 +26,14 @@
25
26
  },
26
27
  "peerDependencies": {
27
28
  "astro": ">=6.0.0",
28
- "@karaoke-cms/contracts": "^0.18.0",
29
- "@karaoke-cms/astro": "^0.18.0"
29
+ "@karaoke-cms/contracts": "^0.19.0",
30
+ "@karaoke-cms/astro": "^0.19.0"
30
31
  },
31
32
  "devDependencies": {
32
33
  "astro": "^6.0.8",
33
34
  "vitest": "^4.1.1",
34
- "@karaoke-cms/contracts": "0.18.0",
35
- "@karaoke-cms/astro": "0.18.0"
35
+ "@karaoke-cms/contracts": "0.19.0",
36
+ "@karaoke-cms/astro": "0.19.0"
36
37
  },
37
38
  "scripts": {
38
39
  "test": "vitest run test/module-tags.test.js"
package/src/index.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  import type { ModuleInstance } from '@karaoke-cms/contracts';
2
+ import { fileURLToPath } from 'url';
3
+ import { join } from 'path';
2
4
  import { cssContract } from './css-contract.js';
3
5
 
6
+ const _srcDir = fileURLToPath(new URL('.', import.meta.url));
7
+ const _defaultCssPath = join(_srcDir, 'styles', 'tags-styles.css');
8
+
4
9
  export interface TagsConfig {
5
10
  /** Mount path for the tags section. Default: '/tags'. */
6
11
  mount?: string;
@@ -36,6 +41,12 @@ export function tags(config: TagsConfig = {}): ModuleInstance {
36
41
  id: 'tags',
37
42
  mount,
38
43
  enabled: config.enabled ?? true,
44
+ moduleNamespace: 'karaoke.tags',
45
+ pageVariants: ['list', 'tag'],
46
+ variantLayouts: {
47
+ list: { main: [{ component: 'body', weight: 20 }] },
48
+ tag: { main: [{ component: 'body', weight: 20 }] },
49
+ },
39
50
  routes: [
40
51
  { pattern: mount, entrypoint: '@karaoke-cms/module-tags/pages/index' },
41
52
  { pattern: `${mount}/[tag]`, entrypoint: '@karaoke-cms/module-tags/pages/tag' },
@@ -43,8 +54,9 @@ export function tags(config: TagsConfig = {}): ModuleInstance {
43
54
  ],
44
55
  menuEntries: [{ id: 'tags', name: 'Tags', path: mount, section: 'main', weight: 30 }],
45
56
  cssContract,
46
- hasDefaultCss: false,
47
- defaultCssPath: undefined,
57
+ hasUx: true,
58
+ hasDefaultCss: true,
59
+ defaultCssPath: _defaultCssPath,
48
60
  scaffoldPages: undefined,
49
61
  };
50
62
  }
@@ -0,0 +1,86 @@
1
+ /* Tags module default styles
2
+ *
3
+ * Targets the CSS contract class names declared in @karaoke-cms/module-tags.
4
+ * Themes override these via the cascade: base → modules → theme → app.
5
+ */
6
+
7
+ /* ── Tag index page ───────────────────────────────────────────────────────── */
8
+
9
+ .tag-listing-header {
10
+ margin-bottom: var(--spacing-lg, 2rem);
11
+ }
12
+
13
+ .tag-listing-header h1 {
14
+ font-size: var(--font-size-xl, 1.875rem);
15
+ margin-bottom: 0;
16
+ }
17
+
18
+ .tag-list {
19
+ list-style: none;
20
+ padding: 0;
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: var(--spacing-xs, 0.25rem);
24
+ }
25
+
26
+ .tag-list li {
27
+ display: flex;
28
+ align-items: center;
29
+ gap: var(--spacing-sm, 0.5rem);
30
+ }
31
+
32
+ .tag-count {
33
+ font-size: var(--font-size-sm, 0.875rem);
34
+ color: var(--color-muted, #737373);
35
+ }
36
+
37
+ /* ── Per-tag page ─────────────────────────────────────────────────────────── */
38
+
39
+ .tag-page-header {
40
+ margin-bottom: var(--spacing-lg, 2rem);
41
+ }
42
+
43
+ .tag-page-header h1 {
44
+ font-size: var(--font-size-xl, 1.875rem);
45
+ margin-bottom: var(--spacing-sm, 0.5rem);
46
+ }
47
+
48
+ .tag-post-list {
49
+ list-style: none;
50
+ margin: 0;
51
+ padding: 0;
52
+ }
53
+
54
+ .tag-post-list li {
55
+ padding: var(--spacing-sm, 0.5rem) 0;
56
+ border-bottom: 1px solid var(--color-border, #e5e5e5);
57
+ display: flex;
58
+ gap: var(--spacing-md, 1rem);
59
+ align-items: baseline;
60
+ }
61
+
62
+ .tag-post-list li:first-child {
63
+ border-top: 1px solid var(--color-border, #e5e5e5);
64
+ }
65
+
66
+ .tag-post-date {
67
+ color: var(--color-muted, #737373);
68
+ font-size: var(--font-size-sm, 0.875rem);
69
+ white-space: nowrap;
70
+ flex-shrink: 0;
71
+ font-variant-numeric: tabular-nums;
72
+ }
73
+
74
+ .tag-post-collection {
75
+ font-size: var(--font-size-sm, 0.875rem);
76
+ color: var(--color-muted, #737373);
77
+ }
78
+
79
+ .tag-empty-state {
80
+ color: var(--color-muted, #737373);
81
+ padding: var(--spacing-lg, 2rem) 0;
82
+ }
83
+
84
+ .tag-empty-state p {
85
+ margin: 0 0 var(--spacing-sm, 0.5rem);
86
+ }