@karaoke-cms/theme-blog 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.
Files changed (2) hide show
  1. package/README.md +56 -48
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,79 +1,87 @@
1
1
  # @karaoke-cms/theme-blog
2
2
 
3
- Editorial blog theme for karaoke-cms. Features a featured hero post, card grid, and cover image support. Blog-only no docs or knowledge-base routes.
3
+ Editorial blog theme for karaoke-cms featured hero post, card grid, and cover image support. Blog-only: no docs or knowledge-base routes.
4
4
 
5
- ## Where it belongs
5
+ ## Installation
6
6
 
7
- `packages/theme-blog/` in the monorepo. Activated via `karaoke.config.ts`:
7
+ ```bash
8
+ npm install @karaoke-cms/theme-blog
9
+ ```
10
+
11
+ ## Usage
8
12
 
9
13
  ```ts
10
14
  // karaoke.config.ts
15
+ import { defineConfig } from '@karaoke-cms/astro';
11
16
  import { loadEnv } from '@karaoke-cms/astro/env';
12
- const { KARAOKE_VAULT } = loadEnv(new URL('.', import.meta.url));
13
-
14
- export default {
15
- vault: KARAOKE_VAULT,
16
- theme: '@karaoke-cms/theme-blog',
17
- };
18
- ```
19
17
 
20
- ## What it does
18
+ const env = loadEnv(new URL('.', import.meta.url));
21
19
 
22
- Injects blog-focused routes and sets the `@theme` Vite alias:
20
+ export default defineConfig({
21
+ vault: env.KARAOKE_VAULT,
22
+ title: 'My Blog',
23
+ // theme-blog uses the legacy integration API — import the default export
24
+ // and register it directly in astro.config.mjs
25
+ });
26
+ ```
23
27
 
24
- | Route | Page |
25
- |-------|------|
26
- | `/` | Home — featured hero post + recent posts card grid |
27
- | `/blog` | Blog index — all published posts |
28
- | `/blog/[slug]` | Blog post full content with cover image |
28
+ > **Note:** `theme-blog` currently uses the legacy theme API and does not yet expose a `themeBlog()` factory. Register it in `astro.config.mjs`:
29
+ >
30
+ > ```js
31
+ > // astro.config.mjs
32
+ > import { defineConfig } from 'astro/config';
33
+ > import karaoke from '@karaoke-cms/astro';
34
+ > import themeBlog from '@karaoke-cms/theme-blog';
35
+ > import karaokeConfig from './karaoke.config.ts';
36
+ >
37
+ > export default defineConfig({
38
+ > site: 'https://your-site.pages.dev',
39
+ > integrations: [karaoke({ ...karaokeConfig, theme: themeBlog })],
40
+ > });
41
+ > ```
42
+
43
+ ## Routes
44
+
45
+ | Route | Description |
46
+ |-------|-------------|
47
+ | `/` | Home — featured hero post + recent posts grid |
48
+ | `/blog` | All published posts |
49
+ | `/blog/[slug]` | Post page with cover image |
29
50
  | `/tags` | Tags index |
30
- | `/tags/[tag]` | Tag page |
51
+ | `/tags/[tag]` | Posts by tag |
31
52
  | `/404` | Not found page |
32
53
 
33
- Note: no `/docs` or `/docs/[slug]` routes. This theme is for publication-style blogs, not knowledge bases.
54
+ No `/docs` routes use `theme-default` for mixed blog + docs sites.
34
55
 
35
- ### Extended frontmatter
56
+ ## Extended frontmatter
36
57
 
37
- The theme supports optional blog-specific frontmatter fields via `blogThemeExtension`. Pass it to `makeCollections()` to unlock them:
58
+ Pass `blogThemeExtension` to `makeCollections()` to unlock cover image and featured-post fields:
38
59
 
39
60
  ```ts
40
61
  // src/content.config.ts
41
62
  import { makeCollections, blogThemeExtension } from '@karaoke-cms/astro/collections';
63
+ import { loadEnv } from '@karaoke-cms/astro/env';
42
64
 
43
- export const collections = makeCollections(import.meta.url, KARAOKE_VAULT, {
44
- blog: blogThemeExtension,
45
- });
65
+ const env = loadEnv(new URL('..', import.meta.url));
66
+ export const collections = makeCollections(
67
+ new URL('..', import.meta.url),
68
+ env.KARAOKE_VAULT,
69
+ { blogSchema: blogThemeExtension },
70
+ );
46
71
  ```
47
72
 
48
73
  Extra fields (all optional):
49
74
 
50
- | Field | Type | Purpose |
51
- |-------|------|---------|
75
+ | Field | Type | Description |
76
+ |-------|------|-------------|
52
77
  | `cover_image` | `string` | Path or URL to the post's cover image |
53
- | `featured` | `boolean` | Pins this post as the hero on the home page |
78
+ | `featured` | `boolean` | Pin this post as the hero on the home page |
54
79
  | `abstract` | `string` | Override the description shown in cards and the hero |
55
80
 
56
- Without `blogThemeExtension`, these fields are silently ignored — the theme falls back to `description`.
57
-
58
- ### Components
59
-
60
- - **`FeaturedHero`** — large hero block for the featured post with cover image overlay, title, date, and abstract
61
- - **`PostCard`** — card with cover image, title, date, reading time, and abstract for the grid
62
-
63
- ### Design system
64
-
65
- `src/styles.css` defines tokens on `:root`:
66
-
67
- - **Typography**: `--font-body`, `--font-mono`, `--font-size-base/sm/lg/xl`
68
- - **Color**: `--color-bg`, `--color-text`, `--color-muted`, `--color-border`, `--color-link`, `--color-link-hover`, `--color-link-visited`, `--color-card-bg`, `--color-hero-overlay`
69
- - **Spacing**: `--spacing-xs/sm/md/lg/xl`
70
- - **Sizing**: `--width-content` (700px), `--width-site` (1100px), `--radius-card` (8px), `--radius-sm` (4px)
81
+ ## Design system
71
82
 
72
- Dark mode via `@media (prefers-color-scheme: dark)`.
83
+ Tokens on `:root`: `--font-body`, `--font-mono`, `--color-bg`, `--color-text`, `--color-muted`, `--color-card-bg`, `--color-hero-overlay`, `--width-content` (700px), `--width-site` (1100px), `--radius-card` (8px). Dark mode via `@media (prefers-color-scheme: dark)`.
73
84
 
74
- ## How it changes the behavior of the system
85
+ ## What's new in 0.9.5
75
86
 
76
- - Replaces all routes from `theme-default`. The two themes cannot coexist only one is active at a time.
77
- - Home page behavior changes significantly: instead of a two-column blog + docs grid, it renders a featured hero and card grid.
78
- - Does not support docs — vault content in `docs/` is collected but has no public routes. Use `theme-default` if you need docs.
79
- - `featured: true` on a post controls the home page hero. If no post is marked featured, the most recent post is promoted automatically.
87
+ No user-facing changes in this releaseversion bumped for lockstep with the monorepo.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@karaoke-cms/theme-blog",
3
3
  "type": "module",
4
- "version": "0.9.3",
4
+ "version": "0.9.6",
5
5
  "description": "Blog theme for karaoke-cms — editorial layout with featured hero, card grid, and cover images",
6
6
  "main": "./src/index.ts",
7
7
  "exports": {
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "peerDependencies": {
20
20
  "astro": ">=6.0.0",
21
- "@karaoke-cms/astro": "^0.9.2"
21
+ "@karaoke-cms/astro": "^0.9.6"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@karaoke-cms/astro": "workspace:*",