@rimelight/seo 0.0.3 → 0.0.4
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/dist/index.d.mts +1 -1
- package/dist/index.mjs +7 -7
- package/dist/robots.d.mts +1 -1
- package/dist/sitemap.d.mts +1 -1
- package/dist/{types-Ck_Zs5Ws.d.mts → types-e7gqYZwc.d.mts} +4 -0
- package/dist/types.d.mts +1 -1
- package/package.json +3 -3
- package/src/components/SEOHead.astro +9 -3
- package/src/env.d.ts +3 -0
- package/src/index.ts +38 -0
- package/src/llms.test.ts +61 -0
- package/src/llms.ts +124 -0
- package/src/meta.test.ts +110 -0
- package/src/meta.ts +70 -0
- package/src/robots.test.ts +75 -0
- package/src/robots.ts +59 -0
- package/src/schema.test.ts +45 -0
- package/src/schema.ts +96 -0
- package/src/sitemap.test.ts +191 -0
- package/src/sitemap.ts +166 -0
- package/src/types.ts +242 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
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
|
+
/**
|
|
94
|
+
* Site identity and SEO defaults shared across all Rimelight Astro sites. The UI-specific overrides
|
|
95
|
+
* (component themes, shortcuts, etc.) live in UIConfig (packages/ui) and are passed directly to the
|
|
96
|
+
* ui() integration.
|
|
97
|
+
*/
|
|
98
|
+
export interface SiteConfig {
|
|
99
|
+
id: string
|
|
100
|
+
name: string
|
|
101
|
+
description: string
|
|
102
|
+
url: string
|
|
103
|
+
ogImage: string
|
|
104
|
+
author: string
|
|
105
|
+
email: string
|
|
106
|
+
branding: {
|
|
107
|
+
logo: {
|
|
108
|
+
alt: string
|
|
109
|
+
}
|
|
110
|
+
favicon: {
|
|
111
|
+
svg: string
|
|
112
|
+
}
|
|
113
|
+
colors: {
|
|
114
|
+
themeColor: string
|
|
115
|
+
backgroundColor: string
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
seo: {
|
|
119
|
+
titleTemplate: string
|
|
120
|
+
ogImageFallback: string
|
|
121
|
+
maxDescriptionLength: number
|
|
122
|
+
authorHandle?: string
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Open Graph image with alt text
|
|
128
|
+
*/
|
|
129
|
+
export interface OGImage {
|
|
130
|
+
/**
|
|
131
|
+
* Image URL (relative or absolute)
|
|
132
|
+
*/
|
|
133
|
+
src: string
|
|
134
|
+
/**
|
|
135
|
+
* Alt text for the image
|
|
136
|
+
*/
|
|
137
|
+
alt: string
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* RSS feed link configuration
|
|
142
|
+
*/
|
|
143
|
+
export interface RSSFeed {
|
|
144
|
+
/**
|
|
145
|
+
* RSS feed URL
|
|
146
|
+
*/
|
|
147
|
+
href: string
|
|
148
|
+
/**
|
|
149
|
+
* Feed title (defaults to "RSS")
|
|
150
|
+
*/
|
|
151
|
+
title?: string
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Props for the RLAHead Astro component. Defined here so consumers can construct head props without
|
|
156
|
+
* importing @rimelight/ui.
|
|
157
|
+
*/
|
|
158
|
+
export interface HeadProps {
|
|
159
|
+
/**
|
|
160
|
+
* Page title
|
|
161
|
+
*/
|
|
162
|
+
title?: string
|
|
163
|
+
/**
|
|
164
|
+
* Page description
|
|
165
|
+
*/
|
|
166
|
+
description?: string
|
|
167
|
+
/**
|
|
168
|
+
* Open Graph image with alt text
|
|
169
|
+
*/
|
|
170
|
+
ogImage?: OGImage
|
|
171
|
+
/**
|
|
172
|
+
* Open Graph type (e.g., "website", "article")
|
|
173
|
+
*/
|
|
174
|
+
ogType?: string
|
|
175
|
+
/**
|
|
176
|
+
* Open Graph locale (defaults to "en_US")
|
|
177
|
+
*/
|
|
178
|
+
ogLocale?: string
|
|
179
|
+
/**
|
|
180
|
+
* Whether to prevent indexing
|
|
181
|
+
*/
|
|
182
|
+
noindex?: boolean
|
|
183
|
+
/**
|
|
184
|
+
* Whether this is a 404 page
|
|
185
|
+
*/
|
|
186
|
+
is404?: boolean
|
|
187
|
+
/**
|
|
188
|
+
* Robots metadata (overrides noindex/is404 logic if provided)
|
|
189
|
+
*/
|
|
190
|
+
robots?: string
|
|
191
|
+
/**
|
|
192
|
+
* Canonical URL
|
|
193
|
+
*/
|
|
194
|
+
canonical?: string
|
|
195
|
+
/**
|
|
196
|
+
* Language alternates for i18n
|
|
197
|
+
*/
|
|
198
|
+
languageAlternates?: Array<{ hreflang: string; href: string }>
|
|
199
|
+
/**
|
|
200
|
+
* Custom favicon SVG or image path (overrides config.branding.favicon.svg)
|
|
201
|
+
*/
|
|
202
|
+
favicon?: string
|
|
203
|
+
/**
|
|
204
|
+
* Site configuration for defaults
|
|
205
|
+
*/
|
|
206
|
+
config?: SiteConfig
|
|
207
|
+
/**
|
|
208
|
+
* Whether to enable View Transitions (ClientRouter)
|
|
209
|
+
*/
|
|
210
|
+
transitions?: boolean
|
|
211
|
+
/**
|
|
212
|
+
* Meta charset
|
|
213
|
+
*/
|
|
214
|
+
charset?: string
|
|
215
|
+
/**
|
|
216
|
+
* Meta viewport
|
|
217
|
+
*/
|
|
218
|
+
viewport?: string
|
|
219
|
+
/**
|
|
220
|
+
* RSS feed configuration
|
|
221
|
+
*/
|
|
222
|
+
rssFeed?: RSSFeed
|
|
223
|
+
/**
|
|
224
|
+
* Article or BlogPosting JSON-LD configuration
|
|
225
|
+
*/
|
|
226
|
+
articleSchema?: import("./schema.js").ArticleSchemaOptions
|
|
227
|
+
/**
|
|
228
|
+
* Breadcrumb list for JSON-LD structured data
|
|
229
|
+
*/
|
|
230
|
+
breadcrumbs?: import("./schema.js").BreadcrumbItem[]
|
|
231
|
+
/**
|
|
232
|
+
* URL for this page's raw Markdown alternate twin
|
|
233
|
+
*/
|
|
234
|
+
markdownUrl?: string
|
|
235
|
+
/**
|
|
236
|
+
* Version alternates for multi-version documentation
|
|
237
|
+
*/
|
|
238
|
+
versionAlternates?: Array<{ version: string; href: string }>
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export type { LlmsPage, LlmsTxtOptions, LlmsFullTxtOptions } from "./llms.js"
|
|
242
|
+
export type { ArticleSchemaOptions, BreadcrumbItem } from "./schema.js"
|