@hagicode/hagilight 0.3.2-dev.55.1.1e29eba → 0.3.2-dev.57.1.ee1f17e

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.
@@ -1,306 +0,0 @@
1
- [
2
- {
3
- "id": "hagitask",
4
- "name": {
5
- "zh-CN": "HagiTask",
6
- "zh-Hant": "HagiTask",
7
- "en-US": "HagiTask",
8
- "ja-JP": "HagiTask",
9
- "ko-KR": "HagiTask",
10
- "de-DE": "HagiTask",
11
- "fr-FR": "HagiTask",
12
- "es-ES": "HagiTask",
13
- "pt-BR": "HagiTask",
14
- "ru-RU": "HagiTask"
15
- },
16
- "description": {
17
- "zh-CN": "任务与工作流管理",
18
- "zh-Hant": "任務與工作流程管理",
19
- "en-US": "Task and workflow management.",
20
- "ja-JP": "タスクとワークフローを管理します。",
21
- "ko-KR": "작업과 워크플로를 관리합니다.",
22
- "de-DE": "Aufgaben und Workflows verwalten.",
23
- "fr-FR": "Gestion des tâches et des workflows.",
24
- "es-ES": "Gestión de tareas y flujos de trabajo.",
25
- "pt-BR": "Gerenciamento de tarefas e fluxos de trabalho.",
26
- "ru-RU": "Управление задачами и рабочими процессами."
27
- },
28
- "url": "https://tasks.hagicode.com/"
29
- },
30
- {
31
- "id": "costCalculator",
32
- "name": {
33
- "zh-CN": "算一算,AI会不会淘汰我",
34
- "zh-Hant": "算一算,AI 會不會淘汰我",
35
- "en-US": "Will AI Replace Me?",
36
- "ja-JP": "AI に置き換えられるか診断",
37
- "ko-KR": "AI가 나를 대체할까?",
38
- "de-DE": "Wird KI mich ersetzen?",
39
- "fr-FR": "L'IA va-t-elle me remplacer ?",
40
- "es-ES": "Me reemplazará la IA?",
41
- "pt-BR": "A IA vai me substituir?",
42
- "ru-RU": "Заменит ли меня ИИ?"
43
- },
44
- "url": "https://cost.hagicode.com"
45
- },
46
- {
47
- "id": "hagicode-main",
48
- "name": {
49
- "zh-CN": "HagiCode 主站",
50
- "zh-Hant": "HagiCode 主站",
51
- "en-US": "HagiCode Main Site",
52
- "ja-JP": "HagiCode 公式サイト",
53
- "ko-KR": "HagiCode 메인 사이트",
54
- "de-DE": "HagiCode Hauptseite",
55
- "fr-FR": "Site principal HagiCode",
56
- "es-ES": "Sitio principal de HagiCode",
57
- "pt-BR": "Site principal da HagiCode",
58
- "ru-RU": "Главный сайт HagiCode"
59
- },
60
- "description": {
61
- "zh-CN": "产品入口",
62
- "zh-Hant": "產品入口",
63
- "en-US": "Primary product entry.",
64
- "ja-JP": "製品全体の入口です。",
65
- "ko-KR": "제품으로 들어가는 기본 진입점입니다.",
66
- "de-DE": "Zentraler Einstieg zum Produkt.",
67
- "fr-FR": "Point d'entrée principal du produit.",
68
- "es-ES": "Entrada principal al producto.",
69
- "pt-BR": "Entrada principal do produto.",
70
- "ru-RU": "Основной вход в продукт."
71
- },
72
- "url": "https://www.hagicode.com/",
73
- "supportsLocalePath": true
74
- },
75
- {
76
- "id": "newbe-blog",
77
- "name": {
78
- "zh-CN": "newbe",
79
- "zh-Hant": "newbe",
80
- "en-US": "newbe",
81
- "ja-JP": "newbe",
82
- "ko-KR": "newbe",
83
- "de-DE": "newbe",
84
- "fr-FR": "newbe",
85
- "es-ES": "newbe",
86
- "pt-BR": "newbe",
87
- "ru-RU": "newbe"
88
- },
89
- "description": {
90
- "zh-CN": "作者博客",
91
- "zh-Hant": "作者部落格",
92
- "en-US": "Author blog.",
93
- "ja-JP": "作者ブログです。",
94
- "ko-KR": "작성자 블로그입니다.",
95
- "de-DE": "Blog des Autors.",
96
- "fr-FR": "Blog de l'auteur.",
97
- "es-ES": "Blog del autor.",
98
- "pt-BR": "Blog do autor.",
99
- "ru-RU": "Блог автора."
100
- },
101
- "url": "https://newbe.hagicode.com/"
102
- },
103
- {
104
- "id": "index-data",
105
- "name": {
106
- "zh-CN": "Index Data Mirror",
107
- "zh-Hant": "Index Data Mirror",
108
- "en-US": "Index Data Mirror",
109
- "ja-JP": "Index Data Mirror",
110
- "ko-KR": "Index Data Mirror",
111
- "de-DE": "Index Data Mirror",
112
- "fr-FR": "Index Data Mirror",
113
- "es-ES": "Index Data Mirror",
114
- "pt-BR": "Index Data Mirror",
115
- "ru-RU": "Index Data Mirror"
116
- },
117
- "description": {
118
- "zh-CN": "公开数据",
119
- "zh-Hant": "公開資料",
120
- "en-US": "Public data mirror.",
121
- "ja-JP": "公開データミラーです。",
122
- "ko-KR": "공개 데이터 미러입니다.",
123
- "de-DE": "Öffentlicher Daten-Spiegel.",
124
- "fr-FR": "Miroir de données public.",
125
- "es-ES": "Espejo de datos público.",
126
- "pt-BR": "Espelho público de dados.",
127
- "ru-RU": "Публичное зеркало данных."
128
- },
129
- "url": "https://index.hagicode.com/data/"
130
- },
131
- {
132
- "id": "compose-builder",
133
- "name": {
134
- "zh-CN": "Docker Compose Builder",
135
- "zh-Hant": "Docker Compose Builder",
136
- "en-US": "Docker Compose Builder",
137
- "ja-JP": "Docker Compose Builder",
138
- "ko-KR": "Docker Compose Builder",
139
- "de-DE": "Docker Compose Builder",
140
- "fr-FR": "Docker Compose Builder",
141
- "es-ES": "Docker Compose Builder",
142
- "pt-BR": "Docker Compose Builder",
143
- "ru-RU": "Docker Compose Builder"
144
- },
145
- "description": {
146
- "zh-CN": "Docker 部署 Hagicode",
147
- "zh-Hant": "使用 Docker 部署 Hagicode",
148
- "en-US": "Deploy HagiCode with Docker.",
149
- "ja-JP": "Docker で HagiCode をデプロイします。",
150
- "ko-KR": "Docker로 HagiCode를 배포합니다.",
151
- "de-DE": "HagiCode mit Docker bereitstellen.",
152
- "fr-FR": "Déployer HagiCode avec Docker.",
153
- "es-ES": "Despliega HagiCode con Docker.",
154
- "pt-BR": "Implante a HagiCode com Docker.",
155
- "ru-RU": "Развёртывание HagiCode через Docker."
156
- },
157
- "url": "https://builder.hagicode.com/"
158
- },
159
- {
160
- "id": "status-page",
161
- "name": {
162
- "zh-CN": "HagiCode Status",
163
- "zh-Hant": "HagiCode Status",
164
- "en-US": "HagiCode Status",
165
- "ja-JP": "HagiCode Status",
166
- "ko-KR": "HagiCode Status",
167
- "de-DE": "HagiCode Status",
168
- "fr-FR": "HagiCode Status",
169
- "es-ES": "HagiCode Status",
170
- "pt-BR": "HagiCode Status",
171
- "ru-RU": "HagiCode Status"
172
- },
173
- "description": {
174
- "zh-CN": "服务状态",
175
- "zh-Hant": "服務狀態",
176
- "en-US": "Service status.",
177
- "ja-JP": "サービス状態の確認ページです。",
178
- "ko-KR": "서비스 상태를 확인하는 페이지입니다.",
179
- "de-DE": "Dienststatus.",
180
- "fr-FR": "État des services.",
181
- "es-ES": "Estado del servicio.",
182
- "pt-BR": "Status do serviço.",
183
- "ru-RU": "Статус сервисов."
184
- },
185
- "url": "https://status.hagicode.com/"
186
- },
187
- {
188
- "id": "awesome-design-gallery",
189
- "name": {
190
- "zh-CN": "Awesome Design MD",
191
- "zh-Hant": "Awesome Design MD",
192
- "en-US": "Awesome Design MD",
193
- "ja-JP": "Awesome Design MD",
194
- "ko-KR": "Awesome Design MD",
195
- "de-DE": "Awesome Design MD",
196
- "fr-FR": "Awesome Design MD",
197
- "es-ES": "Awesome Design MD",
198
- "pt-BR": "Awesome Design MD",
199
- "ru-RU": "Awesome Design MD"
200
- },
201
- "description": {
202
- "zh-CN": "超酷的AI Web 设计",
203
- "zh-Hant": "超酷的 AI Web 設計",
204
- "en-US": "A gallery of standout AI web design work.",
205
- "ja-JP": "印象的な AI Web デザインを集めたギャラリーです。",
206
- "ko-KR": "인상적인 AI 웹 디자인을 모아 둔 갤러리입니다.",
207
- "de-DE": "Galerie mit markanten AI-Webdesigns.",
208
- "fr-FR": "Galerie de designs web IA remarquables.",
209
- "es-ES": "Galería de diseños web de IA destacados.",
210
- "pt-BR": "Galeria com designs web de IA de destaque.",
211
- "ru-RU": "Галерея выразительных AI web-дизайнов."
212
- },
213
- "url": "https://design.hagicode.com/",
214
- "supportsLocalePath": true
215
- },
216
- {
217
- "id": "soul-builder",
218
- "name": {
219
- "zh-CN": "Soul Builder",
220
- "zh-Hant": "Soul Builder",
221
- "en-US": "Soul Builder",
222
- "ja-JP": "Soul Builder",
223
- "ko-KR": "Soul Builder",
224
- "de-DE": "Soul Builder",
225
- "fr-FR": "Soul Builder",
226
- "es-ES": "Soul Builder",
227
- "pt-BR": "Soul Builder",
228
- "ru-RU": "Soul Builder"
229
- },
230
- "description": {
231
- "zh-CN": "Agent之魂",
232
- "zh-Hant": "Agent 之魂",
233
- "en-US": "Define the soul of an agent.",
234
- "ja-JP": "Agent の魂を形にする体験です。",
235
- "ko-KR": "에이전트의 영혼을 설계하는 경험입니다.",
236
- "de-DE": "Forme die Seele eines Agenten.",
237
- "fr-FR": "Façonnez l'âme d'un agent.",
238
- "es-ES": "Define el alma de un agente.",
239
- "pt-BR": "Defina a alma de um agente.",
240
- "ru-RU": "Определите душу агента."
241
- },
242
- "url": "https://soul.hagicode.com/"
243
- },
244
- {
245
- "id": "trait-builder",
246
- "name": {
247
- "zh-CN": "Trait Builder",
248
- "zh-Hant": "Trait Builder",
249
- "en-US": "Trait Builder",
250
- "ja-JP": "Trait Builder",
251
- "ko-KR": "Trait Builder",
252
- "de-DE": "Trait Builder",
253
- "fr-FR": "Trait Builder",
254
- "es-ES": "Trait Builder",
255
- "pt-BR": "Trait Builder",
256
- "ru-RU": "Trait Builder"
257
- },
258
- "description": {
259
- "zh-CN": "Agent之能",
260
- "zh-Hant": "Agent 之能",
261
- "en-US": "Shape what an agent can do.",
262
- "ja-JP": "Agent の能力を組み立てる体験です。",
263
- "ko-KR": "에이전트의 능력을 설계하는 경험입니다.",
264
- "de-DE": "Definiere, was ein Agent kann.",
265
- "fr-FR": "Définissez ce qu'un agent peut faire.",
266
- "es-ES": "Define lo que un agente puede hacer.",
267
- "pt-BR": "Defina o que um agente pode fazer.",
268
- "ru-RU": "Соберите способности агента."
269
- },
270
- "url": "https://trait.hagicode.com/"
271
- },
272
- {
273
- "id": "openspec-docs",
274
- "name": {
275
- "zh-CN": "OpenSpec 文档",
276
- "zh-Hant": "OpenSpec 文件",
277
- "en-US": "OpenSpec Docs",
278
- "ja-JP": "OpenSpec ドキュメント",
279
- "ko-KR": "OpenSpec 문서",
280
- "de-DE": "OpenSpec-Dokumentation",
281
- "fr-FR": "Documentation OpenSpec",
282
- "es-ES": "Documentación de OpenSpec",
283
- "pt-BR": "Documentação do OpenSpec",
284
- "ru-RU": "Документация OpenSpec"
285
- },
286
- "url": "https://openspec.hagicode.com/",
287
- "supportsLocalePath": true
288
- },
289
- {
290
- "id": "omniroute-docs",
291
- "name": {
292
- "zh-CN": "OmniRoute 文档",
293
- "zh-Hant": "OmniRoute 文件",
294
- "en-US": "OmniRoute Docs",
295
- "ja-JP": "OmniRoute ドキュメント",
296
- "ko-KR": "OmniRoute 문서",
297
- "de-DE": "OmniRoute-Dokumentation",
298
- "fr-FR": "Documentation OmniRoute",
299
- "es-ES": "Documentación de OmniRoute",
300
- "pt-BR": "Documentação do OmniRoute",
301
- "ru-RU": "Документация OmniRoute"
302
- },
303
- "url": "https://omniroute.hagicode.com/",
304
- "supportsLocalePath": true
305
- }
306
- ]
@@ -1,51 +0,0 @@
1
- function isRecord(value) {
2
- return value !== null && typeof value === 'object' && !Array.isArray(value);
3
- }
4
-
5
- function normalizeLanguageTag(value) {
6
- if (typeof value !== 'string' || !value.trim()) return undefined;
7
- const input = value.trim().replaceAll('_', '-');
8
- const alias = input.toLowerCase();
9
- if (['zh', 'zh-cn', 'zh-hans', 'root'].includes(alias)) return 'zh-CN';
10
- if (['zh-hant', 'zh-tw', 'zh-hk'].includes(alias)) return 'zh-Hant';
11
- try {
12
- return Intl.getCanonicalLocales(input)[0];
13
- } catch {
14
- return undefined;
15
- }
16
- }
17
-
18
- export function resolveRssFooterLinks(locals, locale, links = {}) {
19
- if (!isRecord(locals) || !Object.hasOwn(locals, 'hagilightRss')) return links;
20
- const rss = locals.hagilightRss;
21
- if (!isRecord(rss)
22
- || typeof rss.defaultFeedUrl !== 'string'
23
- || !rss.defaultFeedUrl
24
- || !isRecord(rss.localeFeedUrls)
25
- || !Array.isArray(rss.locales)
26
- || rss.locales.some((entry) => !isRecord(entry)
27
- || typeof entry.lang !== 'string'
28
- || typeof entry.filename !== 'string')) {
29
- throw new TypeError('Hagilight RSS Footer context is malformed.');
30
- }
31
-
32
- const normalizedLocale = normalizeLanguageTag(locale);
33
- const configuredLocale = rss.locales.find((entry) =>
34
- isRecord(entry)
35
- && entry.filename !== 'en'
36
- && normalizeLanguageTag(entry.lang) === normalizedLocale);
37
- const localeFeedUrl = configuredLocale
38
- ? rss.localeFeedUrls[configuredLocale.lang]
39
- : undefined;
40
- if (configuredLocale && (typeof localeFeedUrl !== 'string' || !localeFeedUrl)) {
41
- throw new TypeError(`Hagilight RSS Footer context has no URL for "${configuredLocale.lang}".`);
42
- }
43
-
44
- return {
45
- ...links,
46
- rssFeedUrl: links.rssFeedUrl ?? rss.defaultFeedUrl,
47
- ...(typeof localeFeedUrl === 'string' && localeFeedUrl
48
- ? { rssLocaleFeedUrl: links.rssLocaleFeedUrl ?? localeFeedUrl }
49
- : {}),
50
- };
51
- }
package/rss-locales.mjs DELETED
@@ -1,40 +0,0 @@
1
- const LANGUAGE_TAG_PATTERN = /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$/u;
2
-
3
- export function resolveRssLocales(locales, { requireNonEmpty = false } = {}) {
4
- if (locales !== undefined && (!locales || typeof locales !== 'object' || Array.isArray(locales))) {
5
- throw new TypeError('Hagilight RSS locales must be an object.');
6
- }
7
- if (requireNonEmpty && (locales === undefined || Object.keys(locales).length === 0)) {
8
- throw new TypeError('Hagilight RSS locales must contain at least one locale.');
9
- }
10
-
11
- const configuredLocales = locales === undefined
12
- ? [['root', { lang: 'en' }]]
13
- : Object.entries(locales);
14
- if (configuredLocales.length === 0) {
15
- if (requireNonEmpty) throw new TypeError('Hagilight RSS locales must contain at least one locale.');
16
- configuredLocales.push(['root', { lang: 'en' }]);
17
- }
18
-
19
- const usedFilenames = new Set();
20
- return configuredLocales.map(([route, config]) => {
21
- const lang = typeof config === 'string' ? config : config?.lang ?? (route === 'root' ? undefined : route);
22
- if (typeof lang !== 'string' || !LANGUAGE_TAG_PATTERN.test(lang)) {
23
- throw new TypeError(`Hagilight RSS locale "${route}" must have a valid language tag.`);
24
- }
25
- let normalizedLang;
26
- try {
27
- [normalizedLang] = Intl.getCanonicalLocales(lang);
28
- } catch {
29
- throw new TypeError(`Hagilight RSS locale "${route}" has an invalid language tag "${lang}".`);
30
- }
31
-
32
- const filename = /^en(?:-us)?$/iu.test(normalizedLang) ? 'en' : normalizedLang;
33
- const collisionKey = filename.toLowerCase();
34
- if (usedFilenames.has(collisionKey)) {
35
- throw new Error(`Hagilight RSS locales collide on the "${filename}" feed filename.`);
36
- }
37
- usedFilenames.add(collisionKey);
38
- return { route, lang: normalizedLang, filename };
39
- });
40
- }
package/rss-renderer.mjs DELETED
@@ -1,114 +0,0 @@
1
- import rss from '@astrojs/rss';
2
-
3
- function resolveSite(value) {
4
- try {
5
- const site = new URL(value);
6
- if (!['http:', 'https:'].includes(site.protocol) || site.username || site.password) {
7
- throw new Error();
8
- }
9
- return site;
10
- } catch {
11
- throw new TypeError('Hagilight RSS requires an absolute Astro site URL; configure `site` in astro.config.mjs.');
12
- }
13
- }
14
-
15
- function resolveLanguage(value) {
16
- if (typeof value !== 'string' || !value.trim()) {
17
- throw new TypeError('Hagilight RSS language must be a valid language tag.');
18
- }
19
- try {
20
- return Intl.getCanonicalLocales(value)[0];
21
- } catch {
22
- throw new TypeError(`Hagilight RSS language "${value}" must be a valid language tag.`);
23
- }
24
- }
25
-
26
- function resolveBaseUrl(site, baseUrl = '/') {
27
- let base;
28
- try {
29
- base = new URL(baseUrl, site);
30
- } catch {
31
- throw new TypeError('Hagilight RSS base URL must be a valid path or absolute URL on the configured site.');
32
- }
33
- if (base.origin !== site.origin) {
34
- throw new TypeError('Hagilight RSS base URL must use the configured Astro site origin.');
35
- }
36
- base.pathname = `${base.pathname.replace(/\/+$/u, '')}/`;
37
- base.search = '';
38
- base.hash = '';
39
- return base;
40
- }
41
-
42
- function resolveItemUrl(value, base) {
43
- if (typeof value !== 'string' || !value.trim()) {
44
- throw new TypeError('Hagilight RSS items require a non-empty link.');
45
- }
46
- let url;
47
- try {
48
- url = new URL(value);
49
- } catch {
50
- url = new URL(value.replace(/^\/+/u, ''), base);
51
- }
52
- if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password) {
53
- throw new TypeError(`Hagilight RSS item link "${value}" must resolve to an absolute HTTP(S) URL.`);
54
- }
55
- return url.href;
56
- }
57
-
58
- function resolvePublicationDate(item, index) {
59
- const value = item.pubDate ?? item.date;
60
- if (value === undefined || value === null) return undefined;
61
- const date = value instanceof Date ? value : new Date(value);
62
- if (Number.isNaN(date.getTime())) {
63
- throw new TypeError(`Hagilight RSS item ${index + 1} has an invalid publication date.`);
64
- }
65
- return date;
66
- }
67
-
68
- export function generateRssFeed({
69
- site: siteInput,
70
- baseUrl = '/',
71
- language = 'en',
72
- title,
73
- description,
74
- items,
75
- } = {}) {
76
- const site = resolveSite(siteInput);
77
- const base = resolveBaseUrl(site, baseUrl);
78
- const lang = resolveLanguage(language);
79
- if (typeof title !== 'string' || !title.trim()) {
80
- throw new TypeError('Hagilight RSS requires a non-empty feed title.');
81
- }
82
- if (typeof description !== 'string' || !description.trim()) {
83
- throw new TypeError('Hagilight RSS requires a non-empty feed description.');
84
- }
85
- if (!Array.isArray(items)) {
86
- throw new TypeError('Hagilight RSS items must be an array supplied by the consumer.');
87
- }
88
- const feedItems = items.map((item, index) => {
89
- if (!item || typeof item !== 'object' || Array.isArray(item)) {
90
- throw new TypeError(`Hagilight RSS item ${index + 1} must be an object.`);
91
- }
92
- if (typeof item.title !== 'string' || !item.title.trim()) {
93
- throw new TypeError(`Hagilight RSS item ${index + 1} requires a non-empty title.`);
94
- }
95
- if (item.description !== undefined && typeof item.description !== 'string') {
96
- throw new TypeError(`Hagilight RSS item ${index + 1} description must be a string.`);
97
- }
98
- const pubDate = resolvePublicationDate(item, index);
99
- return {
100
- title: item.title,
101
- ...(item.description === undefined ? {} : { description: item.description }),
102
- link: resolveItemUrl(item.link, base),
103
- ...(pubDate === undefined ? {} : { pubDate }),
104
- };
105
- });
106
-
107
- return rss({
108
- title,
109
- description,
110
- site: base,
111
- customData: `<language>${lang}</language>`,
112
- items: feedItems,
113
- });
114
- }
package/rss-runtime.mjs DELETED
@@ -1,45 +0,0 @@
1
- import { generateRssFeed } from './rss-renderer.mjs';
2
-
3
- const EMPTY_ENGLISH_FEED = {
4
- title: 'Hagilight RSS Feed',
5
- description: 'English-language feed for this site.',
6
- items: [],
7
- };
8
-
9
- export async function renderRssFeed(config, filename) {
10
- const locale = config.locales.find((entry) => entry.filename === filename);
11
- if (!locale && filename !== 'en') {
12
- throw new Error(`Hagilight RSS has no configured locale for "${filename}".`);
13
- }
14
-
15
- let feed;
16
- if (!locale) {
17
- feed = EMPTY_ENGLISH_FEED;
18
- } else {
19
- if (typeof config.getFeed !== 'function') {
20
- throw new TypeError('Hagilight RSS getFeed module must default-export a callback function.');
21
- }
22
- feed = await config.getFeed({ route: locale.route, lang: locale.lang });
23
- if (!feed || typeof feed !== 'object' || Array.isArray(feed)) {
24
- throw new TypeError(`Hagilight RSS getFeed callback for "${locale.lang}" must return an object.`);
25
- }
26
- if (typeof feed.title !== 'string' || !feed.title.trim()) {
27
- throw new TypeError(`Hagilight RSS getFeed callback for "${locale.lang}" must return a non-empty title.`);
28
- }
29
- if (typeof feed.description !== 'string' || !feed.description.trim()) {
30
- throw new TypeError(`Hagilight RSS getFeed callback for "${locale.lang}" must return a non-empty description.`);
31
- }
32
- if (!Array.isArray(feed.items)) {
33
- throw new TypeError(`Hagilight RSS getFeed callback for "${locale.lang}" must return an items array.`);
34
- }
35
- }
36
-
37
- return generateRssFeed({
38
- site: config.site,
39
- baseUrl: config.baseUrl,
40
- language: locale?.lang ?? 'en',
41
- title: feed.title,
42
- description: feed.description,
43
- items: feed.items,
44
- });
45
- }
package/seo-schema.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import type {
2
- ZodDate,
3
- ZodObject,
4
- ZodOptional,
5
- ZodString,
6
- } from "astro/zod";
7
-
8
- export const seoSchema: ZodObject<{
9
- seo: ZodOptional<
10
- ZodObject<{
11
- title: ZodOptional<ZodString>;
12
- description: ZodOptional<ZodString>;
13
- image: ZodOptional<ZodString>;
14
- author: ZodOptional<ZodString>;
15
- publishedDate: ZodOptional<ZodDate>;
16
- }>
17
- >;
18
- }>;
19
-
20
- export { seoSchema as seoFrontmatterSchema };
21
- export { seoSchema as default };
package/seo-schema.mjs DELETED
@@ -1,24 +0,0 @@
1
- import { z } from 'astro/zod';
2
- import { isValidSeoImageReference } from './seo-utils.mjs';
3
-
4
- const optionalText = z.string().trim().min(1).optional();
5
- const optionalImage = z.string()
6
- .trim()
7
- .min(1)
8
- .refine(isValidSeoImageReference, {
9
- message: 'Use an absolute HTTP(S) URL or a site-root path beginning with "/".',
10
- })
11
- .optional();
12
-
13
- export const seoSchema = z.object({
14
- seo: z.object({
15
- title: optionalText,
16
- description: optionalText,
17
- image: optionalImage,
18
- author: optionalText,
19
- publishedDate: z.coerce.date().optional(),
20
- }).optional(),
21
- });
22
-
23
- export { seoSchema as seoFrontmatterSchema };
24
- export default seoSchema;