@rimelight/seo 0.0.5 → 0.0.6

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/src/types.ts CHANGED
@@ -1,281 +1,367 @@
1
- /**
2
- * Change frequency for sitemap entries
3
- */
4
- export type ChangeFreq = "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never"
5
-
6
- /**
7
- * SEO entry — a single page to include in sitemaps
8
- */
9
- export interface SeoEntry {
10
- /**
11
- * Locale-less path, e.g. "/company/blog/hello". Leading slash required.
12
- */
13
- path: string
14
- lastmod?: Date
15
- changefreq?: ChangeFreq
16
- priority?: number
17
- /**
18
- * Restrict to a subset of locales; defaults to all configured locales.
19
- */
20
- locales?: readonly string[]
21
- }
22
-
23
- /**
24
- * Locale configuration for SEO builders
25
- */
26
- export interface LocaleConfig {
27
- /**
28
- * Absolute origin, e.g. "https://rimelight.com"
29
- */
30
- site: string
31
- /**
32
- * Map of locale segment -> hreflang, e.g. { en: "en-US", pt: "pt-BR" }
33
- */
34
- locales: Record<string, string>
35
- defaultLocale: string
36
- /**
37
- * Emit the default locale without a prefix. Default: false.
38
- */
39
- prefixDefaultLocale?: boolean
40
- trailingSlash?: "always" | "never"
41
- }
42
-
43
- /**
44
- * Fully resolved sitemap URL with alternates
45
- */
46
- export interface SitemapUrl {
47
- loc: string
48
- lastmod?: string
49
- changefreq?: ChangeFreq
50
- priority?: number
51
- alternates?: SitemapAlternate[]
52
- }
53
-
54
- /**
55
- * Language alternate for a sitemap URL
56
- */
57
- export interface SitemapAlternate {
58
- hreflang: string
59
- href: string
60
- }
61
-
62
- /**
63
- * Options for robots.txt generation
64
- */
65
- export interface RobotsOptions {
66
- /**
67
- * The sitemap URL to reference
68
- */
69
- sitemapUrl: string
70
- /**
71
- * Paths to disallow for all user agents
72
- */
73
- disallow?: string[]
74
- /**
75
- * Paths to allow for all user agents
76
- */
77
- allow?: string[]
78
- /**
79
- * User-agent specific rules
80
- */
81
- userAgentRules?: UserAgentRule[]
82
- }
83
-
84
- /**
85
- * User-agent specific robots.txt rule
86
- */
87
- export interface UserAgentRule {
88
- userAgent: string
89
- disallow?: string[]
90
- allow?: string[]
91
- }
92
-
93
- export interface OpenGraphMeta {
94
- type?: string
95
- locale?: string
96
- url?: string
97
- title?: string
98
- description?: string
99
- images?: OGImage[] | OGImage
100
- siteName?: string
101
- [key: string]: unknown
102
- }
103
-
104
- export interface TwitterMeta {
105
- card?: "summary" | "summary_large_image" | "player" | "app"
106
- site?: string
107
- creator?: string
108
- title?: string
109
- description?: string
110
- images?: OGImage[] | OGImage | string
111
- [key: string]: unknown
112
- }
113
-
114
- /**
115
- * Site identity and SEO defaults shared across all Rimelight Astro sites. The UI-specific overrides
116
- * (component themes, shortcuts, etc.) live in UIConfig (packages/ui) and are passed directly to the
117
- * ui() integration.
118
- */
119
- export interface SiteConfig {
120
- id: string
121
- name: string
122
- description: string
123
- url: string
124
- ogImage: string
125
- author: string
126
- email: string
127
- branding: {
128
- logo: {
129
- alt: string
130
- }
131
- favicon: {
132
- svg: string
133
- }
134
- colors: {
135
- themeColor: string
136
- backgroundColor: string
137
- }
138
- }
139
- seo: {
140
- titleTemplate: string
141
- ogImageFallback: string
142
- maxDescriptionLength: number
143
- authorHandle?: string
144
- }
145
- openGraph?: OpenGraphMeta
146
- twitter?: TwitterMeta
147
- }
148
-
149
- /**
150
- * Open Graph image with alt text
151
- */
152
- export interface OGImage {
153
- /**
154
- * Image URL (relative or absolute)
155
- */
156
- src: string
157
- /**
158
- * Alt text for the image
159
- */
160
- alt: string
161
- }
162
-
163
- /**
164
- * RSS feed link configuration
165
- */
166
- export interface RSSFeed {
167
- /**
168
- * RSS feed URL
169
- */
170
- href: string
171
- /**
172
- * Feed title (defaults to "RSS")
173
- */
174
- title?: string
175
- }
176
-
177
- /**
178
- * Props for the RLAHead Astro component. Defined here so consumers can construct head props without
179
- * importing @rimelight/ui.
180
- */
181
- export interface HeadProps {
182
- /**
183
- * Page title
184
- */
185
- title?: string
186
- /**
187
- * Page description
188
- */
189
- description?: string
190
- /**
191
- * Open Graph image with alt text
192
- */
193
- ogImage?: OGImage
194
- /**
195
- * Open Graph type (e.g., "website", "article")
196
- */
197
- ogType?: string
198
- /**
199
- * Open Graph locale (defaults to "en_US")
200
- */
201
- ogLocale?: string
202
- /**
203
- * Whether to prevent indexing
204
- */
205
- noindex?: boolean
206
- /**
207
- * Whether this is a 404 page
208
- */
209
- is404?: boolean
210
- /**
211
- * Robots metadata (overrides noindex/is404 logic if provided)
212
- */
213
- robots?: string
214
- /**
215
- * Canonical URL
216
- */
217
- canonical?: string
218
- /**
219
- * Language alternates for i18n
220
- */
221
- languageAlternates?: Array<{ hreflang: string; href: string }>
222
- /**
223
- * Custom favicon SVG or image path (overrides config.branding.favicon.svg)
224
- */
225
- favicon?: string
226
- /**
227
- * Site configuration for defaults
228
- */
229
- config?: SiteConfig
230
- /**
231
- * Whether to enable View Transitions (ClientRouter)
232
- */
233
- transitions?: boolean
234
- /**
235
- * Meta charset
236
- */
237
- charset?: string
238
- /**
239
- * Meta viewport
240
- */
241
- viewport?: string
242
- /**
243
- * RSS feed configuration
244
- */
245
- rssFeed?: RSSFeed
246
- /**
247
- * Article or BlogPosting JSON-LD configuration
248
- */
249
- articleSchema?: import("./schema.js").ArticleSchemaOptions
250
- /**
251
- * Breadcrumb list for JSON-LD structured data
252
- */
253
- breadcrumbs?: import("./schema.js").BreadcrumbItem[]
254
- /**
255
- * URL for this page's raw Markdown alternate twin
256
- */
257
- markdownUrl?: string
258
- /**
259
- * Version alternates for multi-version documentation
260
- */
261
- versionAlternates?: Array<{ version: string; href: string }>
262
- /**
263
- * Whether the title should bypass site title template
264
- */
265
- absolute?: boolean
266
- /**
267
- * Twitter card type
268
- */
269
- twitterCard?: "summary" | "summary_large_image" | "player" | "app"
270
- /**
271
- * Open Graph metadata overrides
272
- */
273
- openGraph?: OpenGraphMeta
274
- /**
275
- * Twitter metadata overrides
276
- */
277
- twitter?: TwitterMeta
278
- }
279
-
280
- export type { LlmsPage, LlmsTxtOptions, LlmsFullTxtOptions } from "./llms.js"
281
- export type { ArticleSchemaOptions, BreadcrumbItem } from "./schema.js"
1
+ /**
2
+ * Change frequency for sitemap entries
3
+ */
4
+ export type ChangeFreq = "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never"
5
+
6
+ /**
7
+ * SEO entry — a single page to include in sitemaps
8
+ */
9
+ export interface SeoEntry {
10
+ /**
11
+ * Locale-less path, e.g. "/company/blog/hello". Leading slash required.
12
+ */
13
+ path: string
14
+ lastmod?: Date
15
+ changefreq?: ChangeFreq
16
+ priority?: number
17
+ /**
18
+ * Restrict to a subset of locales; defaults to all configured locales.
19
+ */
20
+ locales?: readonly string[]
21
+ }
22
+
23
+ /**
24
+ * Locale configuration for SEO builders
25
+ */
26
+ export interface LocaleConfig {
27
+ /**
28
+ * Absolute origin, e.g. "https://rimelight.com"
29
+ */
30
+ site: string
31
+ /**
32
+ * Map of locale segment -> hreflang, e.g. { en: "en-US", pt: "pt-BR" }
33
+ */
34
+ locales: Record<string, string>
35
+ defaultLocale: string
36
+ /**
37
+ * Emit the default locale without a prefix. Default: false.
38
+ */
39
+ prefixDefaultLocale?: boolean
40
+ trailingSlash?: "always" | "never"
41
+ }
42
+
43
+ /**
44
+ * Fully resolved sitemap URL with alternates
45
+ */
46
+ export interface SitemapUrl {
47
+ loc: string
48
+ lastmod?: string
49
+ changefreq?: ChangeFreq
50
+ priority?: number
51
+ alternates?: SitemapAlternate[]
52
+ }
53
+
54
+ /**
55
+ * Language alternate for a sitemap URL
56
+ */
57
+ export interface SitemapAlternate {
58
+ hreflang: string
59
+ href: string
60
+ }
61
+
62
+ /**
63
+ * Options for robots.txt generation
64
+ */
65
+ export interface RobotsOptions {
66
+ /**
67
+ * The sitemap URL to reference
68
+ */
69
+ sitemapUrl: string
70
+ /**
71
+ * Paths to disallow for all user agents
72
+ */
73
+ disallow?: string[]
74
+ /**
75
+ * Paths to allow for all user agents
76
+ */
77
+ allow?: string[]
78
+ /**
79
+ * User-agent specific rules
80
+ */
81
+ userAgentRules?: UserAgentRule[]
82
+ }
83
+
84
+ /**
85
+ * User-agent specific robots.txt rule
86
+ */
87
+ export interface UserAgentRule {
88
+ userAgent: string
89
+ disallow?: string[]
90
+ allow?: string[]
91
+ }
92
+
93
+ export interface OpenGraphMeta {
94
+ type?: string
95
+ locale?: string
96
+ url?: string
97
+ title?: string
98
+ description?: string
99
+ images?: OGImage[] | OGImage
100
+ siteName?: string
101
+ [key: string]: unknown
102
+ }
103
+
104
+ export interface TwitterMeta {
105
+ card?: "summary" | "summary_large_image" | "player" | "app"
106
+ site?: string
107
+ creator?: string
108
+ title?: string
109
+ description?: string
110
+ images?: OGImage[] | OGImage | string
111
+ [key: string]: unknown
112
+ }
113
+
114
+ /**
115
+ * Site identity and SEO defaults shared across all Rimelight Astro sites. The UI-specific overrides
116
+ * (component themes, shortcuts, etc.) live in UIConfig (packages/ui) and are passed directly to the
117
+ * ui() integration.
118
+ */
119
+ export interface SiteConfig {
120
+ id: string
121
+ name: string
122
+ description: string
123
+ url: string
124
+ ogImage: string
125
+ author: string
126
+ email: string
127
+ branding: {
128
+ logo: {
129
+ alt: string
130
+ }
131
+ favicon: {
132
+ svg: string
133
+ }
134
+ colors: {
135
+ themeColor: string
136
+ backgroundColor: string
137
+ }
138
+ }
139
+ seo: {
140
+ titleTemplate: string
141
+ ogImageFallback: string
142
+ maxDescriptionLength: number
143
+ authorHandle?: string
144
+ }
145
+ openGraph?: OpenGraphMeta
146
+ twitter?: TwitterMeta
147
+ }
148
+
149
+ /**
150
+ * Open Graph image with alt text
151
+ */
152
+ export interface OGImage {
153
+ /**
154
+ * Image URL (relative or absolute)
155
+ */
156
+ src: string
157
+ /**
158
+ * Alt text for the image
159
+ */
160
+ alt: string
161
+ }
162
+
163
+ /**
164
+ * RSS feed link configuration
165
+ */
166
+ export interface RSSFeed {
167
+ /**
168
+ * RSS feed URL
169
+ */
170
+ href: string
171
+ /**
172
+ * Feed title (defaults to "RSS")
173
+ */
174
+ title?: string
175
+ }
176
+
177
+ /**
178
+ * Props for the RLAHead Astro component. Defined here so consumers can construct head props without
179
+ * importing @rimelight/ui.
180
+ */
181
+ export interface HeadProps {
182
+ /**
183
+ * Page title
184
+ */
185
+ title?: string
186
+ /**
187
+ * Page description
188
+ */
189
+ description?: string
190
+ /**
191
+ * Open Graph image with alt text
192
+ */
193
+ ogImage?: OGImage
194
+ /**
195
+ * Open Graph type (e.g., "website", "article")
196
+ */
197
+ ogType?: string
198
+ /**
199
+ * Open Graph locale (defaults to "en_US")
200
+ */
201
+ ogLocale?: string
202
+ /**
203
+ * Whether to prevent indexing
204
+ */
205
+ noindex?: boolean
206
+ /**
207
+ * Whether this is a 404 page
208
+ */
209
+ is404?: boolean
210
+ /**
211
+ * Robots metadata (overrides noindex/is404 logic if provided)
212
+ */
213
+ robots?: string
214
+ /**
215
+ * Canonical URL
216
+ */
217
+ canonical?: string
218
+ /**
219
+ * Language alternates for i18n
220
+ */
221
+ languageAlternates?: Array<{ hreflang: string; href: string }>
222
+ /**
223
+ * Custom favicon SVG or image path (overrides config.branding.favicon.svg)
224
+ */
225
+ favicon?: string
226
+ /**
227
+ * Site configuration for defaults
228
+ */
229
+ config?: SiteConfig
230
+ /**
231
+ * Whether to enable View Transitions (ClientRouter)
232
+ */
233
+ transitions?: boolean
234
+ /**
235
+ * Meta charset
236
+ */
237
+ charset?: string
238
+ /**
239
+ * Meta viewport
240
+ */
241
+ viewport?: string
242
+ /**
243
+ * RSS feed configuration
244
+ */
245
+ rssFeed?: RSSFeed
246
+ /**
247
+ * Article or BlogPosting JSON-LD configuration
248
+ */
249
+ articleSchema?: import("./schema.js").ArticleSchemaOptions
250
+ /**
251
+ * Breadcrumb list for JSON-LD structured data
252
+ */
253
+ breadcrumbs?: import("./schema.js").BreadcrumbItem[]
254
+ /**
255
+ * URL for this page's raw Markdown alternate twin
256
+ */
257
+ markdownUrl?: string
258
+ /**
259
+ * Version alternates for multi-version documentation
260
+ */
261
+ versionAlternates?: Array<{ version: string; href: string }>
262
+ /**
263
+ * Whether the title should bypass site title template
264
+ */
265
+ absolute?: boolean
266
+ /**
267
+ * Twitter card type
268
+ */
269
+ twitterCard?: "summary" | "summary_large_image" | "player" | "app"
270
+ /**
271
+ * Open Graph metadata overrides
272
+ */
273
+ openGraph?: OpenGraphMeta
274
+ /**
275
+ * Twitter metadata overrides
276
+ */
277
+ twitter?: TwitterMeta
278
+ }
279
+
280
+ export interface RssItem {
281
+ title: string
282
+ link: string
283
+ pubDate: Date | string | number
284
+ description?: string
285
+ content?: string
286
+ guid?: string
287
+ author?: string
288
+ }
289
+
290
+ export interface RssFeedOptions {
291
+ title: string
292
+ description: string
293
+ site: string
294
+ feedUrl?: string
295
+ language?: string
296
+ items: RssItem[]
297
+ }
298
+
299
+ export interface RssOptions extends Partial<RssFeedOptions> {
300
+ /**
301
+ * Custom RSS route pattern (default: "/rss.xml")
302
+ */
303
+ path?: string
304
+ /**
305
+ * Custom items loader
306
+ */
307
+ items?: RssItem[]
308
+ }
309
+
310
+ export interface SitemapOptions {
311
+ /**
312
+ * Sitemap route pattern (default: "/sitemap.xml")
313
+ */
314
+ path?: string
315
+ urls?: SitemapUrl[]
316
+ entries?: () => Promise<SeoEntry[]> | SeoEntry[]
317
+ locales?: LocaleConfig
318
+ [key: string]: unknown
319
+ }
320
+
321
+ export interface RobotsRouteOptions extends Partial<RobotsOptions> {
322
+ /**
323
+ * Route pattern (default: "/robots.txt")
324
+ */
325
+ path?: string
326
+ }
327
+
328
+ export interface LlmsRouteOptions extends Partial<LlmsTxtOptions> {
329
+ /**
330
+ * Route pattern (default: "/llms.txt")
331
+ */
332
+ path?: string
333
+ }
334
+
335
+ export interface LlmsFullRouteOptions extends Partial<LlmsFullTxtOptions> {
336
+ /**
337
+ * Route pattern (default: "/llms-full.txt")
338
+ */
339
+ path?: string
340
+ }
341
+
342
+ export interface RimelightSeoOptions {
343
+ /**
344
+ * Sitemap configuration or false to disable automatic /sitemap.xml (default: true)
345
+ */
346
+ sitemap?: boolean | SitemapOptions
347
+ /**
348
+ * Robots.txt configuration or false to disable automatic /robots.txt (default: true)
349
+ */
350
+ robots?: boolean | RobotsRouteOptions
351
+ /**
352
+ * RSS feed configuration or false to disable automatic /rss.xml (default: true)
353
+ */
354
+ rss?: boolean | RssOptions
355
+ /**
356
+ * LLMs.txt configuration or false to disable automatic /llms.txt (default: true)
357
+ */
358
+ llms?: boolean | LlmsRouteOptions
359
+ /**
360
+ * LLMs-full.txt configuration or false to disable automatic /llms-full.txt (default: true)
361
+ */
362
+ llmsFull?: boolean | LlmsFullRouteOptions
363
+ }
364
+
365
+ export type { LlmsPage, LlmsTxtOptions, LlmsFullTxtOptions } from "./llms.js"
366
+ export type { ArticleSchemaOptions, BreadcrumbItem } from "./schema.js"
367
+