@ultimat3/seo 31.46.0 → 31.47.1
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 +31 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -72,8 +72,10 @@ a job boundary the class is gone and the `code` is what survives — match on th
|
|
|
72
72
|
## Type-level enforcement
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
|
+
import { ld } from '@ultimat3/seo';
|
|
76
|
+
|
|
77
|
+
// @ts-expect-error Property 'datePublished' is missing — required by schema.org
|
|
75
78
|
ld.Article({ headline: 'Ship it', author: { name: 'Ada' } });
|
|
76
|
-
// ^ error: Property 'datePublished' is missing — required by schema.org
|
|
77
79
|
```
|
|
78
80
|
|
|
79
81
|
A missing `datePublished` is a compile error, not a Search Console warning three
|
|
@@ -142,6 +144,8 @@ A CDN or `sharp`-backed transform implements `ImageTransformDriver` from `@ultim
|
|
|
142
144
|
`@ultimat3/core`'s pipeline — zero dependencies, no `sharp`, no native binary.
|
|
143
145
|
|
|
144
146
|
```ts
|
|
147
|
+
import { builtinImageDriver } from '@ultimat3/seo';
|
|
148
|
+
|
|
145
149
|
const images = builtinImageDriver({ read: (src) => Bun.file(`public${src}`).bytes() });
|
|
146
150
|
|
|
147
151
|
// a 1200x630 source
|
|
@@ -179,6 +183,13 @@ The two lists are `@ultimat3/core`'s `DECODABLE_FORMATS` and `ENCODABLE_FORMATS`
|
|
|
179
183
|
back, so a server route never hand-rolls its own parsing of what `responsiveImage()` wrote.
|
|
180
184
|
|
|
181
185
|
```ts
|
|
186
|
+
import { type ImageTransformDriver, parseImageQuery } from '@ultimat3/seo';
|
|
187
|
+
|
|
188
|
+
declare const req: Request;
|
|
189
|
+
declare const images: ImageTransformDriver;
|
|
190
|
+
declare const src: string;
|
|
191
|
+
declare const intrinsicWidth: number;
|
|
192
|
+
|
|
182
193
|
const query = parseImageQuery(new URL(req.url).searchParams);
|
|
183
194
|
// null: none of w/f/q was present — a plain asset read, not a transform.
|
|
184
195
|
if (query !== null) {
|
|
@@ -208,10 +219,27 @@ if (query !== null) {
|
|
|
208
219
|
## Usage
|
|
209
220
|
|
|
210
221
|
```ts
|
|
222
|
+
import { defineRoute } from '@ultimat3/render';
|
|
223
|
+
import { ld } from '@ultimat3/seo';
|
|
224
|
+
|
|
225
|
+
interface Post {
|
|
226
|
+
readonly slug: string;
|
|
227
|
+
readonly title: string;
|
|
228
|
+
readonly excerpt: string;
|
|
229
|
+
readonly cover: string;
|
|
230
|
+
readonly publishedAt: string;
|
|
231
|
+
readonly author: { readonly name: string };
|
|
232
|
+
readonly locales: readonly string[];
|
|
233
|
+
}
|
|
234
|
+
declare function listPostSlugs(): Promise<readonly string[]>;
|
|
235
|
+
declare function loadPost(slug: string): Promise<Post>;
|
|
236
|
+
|
|
211
237
|
export const config = defineRoute({
|
|
212
238
|
render: 'isr',
|
|
213
|
-
prerender: () =>
|
|
214
|
-
|
|
239
|
+
prerender: () => listPostSlugs(),
|
|
240
|
+
offline: 'precache',
|
|
241
|
+
load: ({ params }) => loadPost(params['slug'] ?? ''),
|
|
242
|
+
meta: ({ data: post }) => ({
|
|
215
243
|
title: post.title,
|
|
216
244
|
titleTemplate: '%s — Ultimate',
|
|
217
245
|
description: post.excerpt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/seo",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.47.1",
|
|
4
4
|
"description": "Enforced SEO: typed meta, JSON-LD, sitemap, robots, feeds, responsive images, perf budgets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test": "bun test"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ultimat3/core": "31.
|
|
47
|
-
"@ultimat3/schema": "31.
|
|
46
|
+
"@ultimat3/core": "31.47.1",
|
|
47
|
+
"@ultimat3/schema": "31.47.1"
|
|
48
48
|
}
|
|
49
49
|
}
|