@usegraft/registry 0.1.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/LICENSE +21 -0
- package/dist/index.d.ts +203 -0
- package/dist/index.js +365 -0
- package/package.json +41 -0
- package/registry/callout/components/Callout.tsx +34 -0
- package/registry/callout/components/callout.llms.txt +19 -0
- package/registry/callout/editor/Callout.json +15 -0
- package/registry/callout/registry.item.json +13 -0
- package/registry/comments/graft/comments.llms.txt +14 -0
- package/registry/comments/graft/comments.ts +113 -0
- package/registry/comments/registry.item.json +10 -0
- package/registry/commerce/graft/commerce.llms.txt +35 -0
- package/registry/commerce/graft/commerce.ts +294 -0
- package/registry/commerce/registry.item.json +13 -0
- package/registry/faq/components/Faq.tsx +38 -0
- package/registry/faq/components/faq.llms.txt +22 -0
- package/registry/faq/editor/Faq.json +5 -0
- package/registry/faq/graft/fields/faq.ts +21 -0
- package/registry/faq/registry.item.json +14 -0
- package/registry/scoped-access/graft/scoped-access.llms.txt +9 -0
- package/registry/scoped-access/graft/scoped-access.ts +19 -0
- package/registry/scoped-access/registry.item.json +14 -0
- package/registry/seo/graft/fields/seo.llms.txt +19 -0
- package/registry/seo/graft/fields/seo.ts +24 -0
- package/registry/seo/registry.item.json +10 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## seo (primitive)
|
|
2
|
+
|
|
3
|
+
Spreadable SEO field group in `graft/fields/seo.ts`. Import and spread into a
|
|
4
|
+
collection — no barrel wiring (field items are composition helpers, not
|
|
5
|
+
runtime modules):
|
|
6
|
+
|
|
7
|
+
import { seoFields } from "./graft/fields/seo";
|
|
8
|
+
|
|
9
|
+
export const pages = defineCollection({
|
|
10
|
+
name: "pages",
|
|
11
|
+
fields: {
|
|
12
|
+
title: field.string(),
|
|
13
|
+
...seoFields, // seoTitle?, seoDescription?, ogImage?
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
All three fields are optional (no migration needed). In the app, prefer
|
|
18
|
+
`doc.data.seoTitle ?? doc.data.title` and `doc.data.seoDescription ?? doc.data.description`
|
|
19
|
+
for `generateMetadata` / head tags.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* seo — spreadable SEO field group (owned code; edit freely).
|
|
3
|
+
*
|
|
4
|
+
* Spread into any collection: `fields: { title: field.string(), ...seoFields }`.
|
|
5
|
+
* All fields optional so existing documents keep compiling. Wire into
|
|
6
|
+
* `generateMetadata` (or your framework's head helper) from the page data.
|
|
7
|
+
*/
|
|
8
|
+
import { field } from "@usegraft/core";
|
|
9
|
+
|
|
10
|
+
/** Optional SEO fields — spread into a collection's `fields` map. */
|
|
11
|
+
export const seoFields = {
|
|
12
|
+
seoTitle: field.string({
|
|
13
|
+
optional: true,
|
|
14
|
+
description: "Override <title> / og:title. Falls back to the page title when unset.",
|
|
15
|
+
}),
|
|
16
|
+
seoDescription: field.string({
|
|
17
|
+
optional: true,
|
|
18
|
+
description: "Meta description / og:description for search and social previews.",
|
|
19
|
+
}),
|
|
20
|
+
ogImage: field.asset({
|
|
21
|
+
optional: true,
|
|
22
|
+
description: "Open Graph image. Upload with `graft asset put <file> [key]`.",
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "seo",
|
|
3
|
+
"type": "field",
|
|
4
|
+
"description": "Spreadable SEO field group (seoTitle, seoDescription, ogImage) for any collection.",
|
|
5
|
+
"graftVersion": "*",
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"registryDependencies": [],
|
|
8
|
+
"files": [{ "source": "graft/fields/seo.ts", "target": "graft/fields/seo.ts", "role": "module" }],
|
|
9
|
+
"llms": "graft/fields/seo.llms.txt"
|
|
10
|
+
}
|