@fayz-ai/plugin-blog 0.1.0 → 0.8.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 +44 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @fayz-ai/plugin-blog
|
|
2
|
+
|
|
3
|
+
> A headless blog surface — post list + article page — you drop into any Fayz website.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@fayz-ai/plugin-blog)
|
|
6
|
+
[](https://github.com/FayaLabs/fayz-sdk/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
**Status:** beta — pre-1.0. Ships a public website surface (blog list + post detail) running on bundled mock/seed data, with a Supabase-backed provider seam included and evolving. No admin UI in M1 (the host owns website navigation). APIs may change before 1.0.
|
|
9
|
+
|
|
10
|
+
Marketing sites need a blog, and every one ends up rebuilt from scratch. `plugin-blog` is the reusable version: a headless, SEO-ready blog you compose into a Fayz website as a bundle of `{ manifest, Provider }`. It ships the public read surface — a `/blog` list and a `/blog/:slug` article page — plus the data seam behind them, so the host site owns layout and navigation while the plugin owns posts.
|
|
11
|
+
|
|
12
|
+
It follows the "website plugin" (Model A) pattern: instead of a `defineSaas` plugin, `createBlogPlugin` returns a manifest (with public routes), an app-root `Provider`, and the resolved data provider. Drop the routes into your router, wrap your app in the `Provider`, and you have a blog.
|
|
13
|
+
|
|
14
|
+
## What's inside
|
|
15
|
+
- **Public routes** — `GET /blog` (list) and `/blog/:slug` (detail), both `guard: "public"`, mounted under a configurable `basePath`
|
|
16
|
+
- **Components** — `BlogList`, `PostDetail`, `PostCard`, `AuthorAvatar` (exported for custom composition)
|
|
17
|
+
- **Hooks** — `useBlogPosts`, `usePost`, and `useBlogContext`
|
|
18
|
+
- **Data seam** — `createSafeDataProvider` picks `createSupabaseBlogProvider` when configured, else `createMockBlogProvider` seeded from your `seed` posts
|
|
19
|
+
- **SEO** — per-page `useSeo` with `og:site_name`, plus organization + breadcrumb JSON-LD
|
|
20
|
+
- **Byline + i18n defaults** — configurable `defaultAuthor`, `siteName`, and pt-BR list/back labels
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
```bash
|
|
24
|
+
npm install @fayz-ai/plugin-blog
|
|
25
|
+
```
|
|
26
|
+
Peer deps: `react`, `react-dom`, `react-router-dom`. Runtime dep: `@fayz-ai/core`.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
```tsx
|
|
30
|
+
import { createBlogPlugin } from '@fayz-ai/plugin-blog'
|
|
31
|
+
|
|
32
|
+
const blog = createBlogPlugin({
|
|
33
|
+
basePath: '/blog',
|
|
34
|
+
siteName: 'Acme',
|
|
35
|
+
defaultAuthor: { name: 'Equipe Acme' },
|
|
36
|
+
seed: { posts: [/* ... */] },
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
// blog.manifest.routes -> spread into your website router
|
|
40
|
+
// wrap your app tree in <blog.Provider> so the routes resolve their data
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Part of the Fayz SDK
|
|
44
|
+
A website surface plugin. Pairs with `@fayz-ai/plugin-sites` and the storefront/website scaffolds; complements `@fayz-ai/plugin-payments` in composing bespoke marketing sites from curated plugins.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fayz-ai/plugin-blog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "[experimental] Fayz SDK — blog / articles plugin (website surface)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"lucide-react": "^0.400.0",
|
|
28
|
-
"@fayz-ai/core": "^0.
|
|
28
|
+
"@fayz-ai/core": "^0.8.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/react": "^18.3.0",
|