@fullstackdatasolutions/articles 0.10.0 → 0.11.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/CHANGELOG.md +6 -0
- package/README.md +27 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js.map +1 -1
- package/dist/nextjs.d.cts +5 -0
- package/dist/nextjs.d.ts +5 -0
- package/dist/server.cjs +2 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +5 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/articlesConfig.test.ts +20 -1
- package/src/__tests__/renderMdx.test.tsx +78 -0
- package/src/articlesConfig.ts +6 -0
- package/src/index.ts +1 -0
- package/src/renderMdx.tsx +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.11.0] - 2026-07-30
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added `mdxComponents` to `ArticlesConfig`, allowing consuming apps to register React components for explicit use inside article MDX bodies. Registered components are merged with the package's built-in MDX image override.
|
|
13
|
+
|
|
8
14
|
## [0.10.0] - 2026-07-23
|
|
9
15
|
|
|
10
16
|
### Added
|
package/README.md
CHANGED
|
@@ -454,12 +454,39 @@ Use this if you don't need a custom API base path. For custom paths, use `create
|
|
|
454
454
|
| `defaultAuthor` | `string` | — | Default author slug or name used when article frontmatter omits both `authors` and `author`. |
|
|
455
455
|
| `breadcrumbs` | `false \| BreadcrumbsConfig` | default trails | Set to `false` to hide breadcrumbs, or configure article/category/author breadcrumb trails, custom URL items, separator, schema output, and labels. |
|
|
456
456
|
| `linkTargetStrategy` | `'external-new-tab' \| 'all-new-tab' \| 'same-tab'` | `'external-new-tab'` | Controls article body links. Internal links open in the same window by default; external `http`/`https` links open in a new window. |
|
|
457
|
+
| `mdxComponents` | `Record<string, ComponentType<never>>` | - | Components exposed to article `.mdx` bodies by tag name. Merged with the built-in MDX image override. |
|
|
457
458
|
| `description` | `string` | — | Short description used as the RSS feed channel description. Falls back to `siteName` if omitted. |
|
|
458
459
|
|
|
459
460
|
**Default layout order:** `['hero', 'search', 'featured', 'latest', 'categories']`
|
|
460
461
|
|
|
461
462
|
To add a newsletter section, pass `layout: ['hero','search','featured','latest','categories','newsletter']` — the library renders `null` for `'newsletter'` so you can append your own component after `<ArticlesPage />`.
|
|
462
463
|
|
|
464
|
+
### Custom MDX components
|
|
465
|
+
|
|
466
|
+
Pass React components through `mdxComponents` to make them available to article `.mdx` files. The component key is the JSX tag authors write in the article.
|
|
467
|
+
|
|
468
|
+
```tsx
|
|
469
|
+
// config/articles.ts
|
|
470
|
+
import type { ArticlesConfig } from '@fullstackdatasolutions/articles'
|
|
471
|
+
import { LeadMagnetCTA } from '@/components/LeadMagnetCTA'
|
|
472
|
+
|
|
473
|
+
export const siteConfig: ArticlesConfig = {
|
|
474
|
+
siteUrl: 'https://yoursite.com',
|
|
475
|
+
siteName: 'Your Site',
|
|
476
|
+
mdxComponents: {
|
|
477
|
+
LeadMagnetCTA,
|
|
478
|
+
},
|
|
479
|
+
}
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
```mdx
|
|
483
|
+
Article intro paragraph.
|
|
484
|
+
|
|
485
|
+
<LeadMagnetCTA system="DND" segment="new-players" />
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Imports inside individual `.mdx` article files are not supported. Define components in the consuming app and register them through `mdxComponents`.
|
|
489
|
+
|
|
463
490
|
### Authors
|
|
464
491
|
|
|
465
492
|
Author profiles are optional. If an article has no configured author and no plain `author` frontmatter, author UI and author metadata are omitted for that article.
|