@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/dist/index.d.mts +5 -3
- package/dist/index.mjs +6 -2
- package/dist/integration.d.mts +3 -20
- package/dist/integration.mjs +75 -7
- package/dist/og.d.mts +117 -0
- package/dist/og.mjs +302 -0
- package/dist/routes/llms-full.txt.d.mts +5 -0
- package/dist/routes/llms-full.txt.mjs +57 -0
- package/dist/routes/llms.txt.d.mts +1 -0
- package/dist/routes/llms.txt.mjs +60 -12
- package/dist/routes/robots.txt.mjs +32 -4
- package/dist/routes/rss.xml.d.mts +4 -0
- package/dist/routes/rss.xml.mjs +51 -0
- package/dist/routes/sitemap.xml.mjs +18 -4
- package/dist/rss.d.mts +8 -0
- package/dist/rss.mjs +44 -0
- package/dist/types.d.mts +79 -2
- package/package.json +17 -3
- package/src/env.d.ts +33 -8
- package/src/index.ts +15 -1
- package/src/integration.ts +172 -74
- package/src/og.ts +444 -0
- package/src/routes/llms-full.txt.ts +77 -0
- package/src/routes/llms.txt.ts +90 -22
- package/src/routes/robots.txt.ts +63 -20
- package/src/routes/rss.xml.ts +87 -0
- package/src/routes/sitemap.xml.ts +43 -16
- package/src/rss.test.ts +28 -0
- package/src/rss.ts +63 -0
- package/src/types.ts +367 -281
package/dist/routes/llms.txt.mjs
CHANGED
|
@@ -1,20 +1,68 @@
|
|
|
1
1
|
import { buildLlmsTxt } from "../llms.mjs";
|
|
2
|
-
import
|
|
2
|
+
import * as siteConfigMod from "virtual:rimelight-seo/site-config";
|
|
3
|
+
import * as dbMod from "virtual:rimelight-seo/db";
|
|
4
|
+
import * as corpusMod from "virtual:rimelight-seo/corpus";
|
|
5
|
+
import seoOptions from "virtual:rimelight-seo/options";
|
|
3
6
|
//#region src/routes/llms.txt.ts
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const prerender = false;
|
|
8
|
+
const GET = async ({ site, url }) => {
|
|
9
|
+
const siteConfig = siteConfigMod.siteConfig || {};
|
|
10
|
+
const siteUrl = site ? site.toString() : siteConfig.url || `${url.protocol}//${url.host}`;
|
|
11
|
+
const llmsOpts = typeof seoOptions?.llms === "object" ? seoOptions.llms : {};
|
|
12
|
+
let pages = [];
|
|
13
|
+
if (Array.isArray(llmsOpts.pages) && llmsOpts.pages.length > 0) pages = llmsOpts.pages;
|
|
14
|
+
else if (Array.isArray(corpusMod.corpusPages) && corpusMod.corpusPages.length > 0) pages = corpusMod.corpusPages.map((p) => {
|
|
15
|
+
const slug = p.slug === "index" ? "" : p.slug;
|
|
16
|
+
const pageUrl = `${siteUrl.replace(/\/$/, "")}/${slug}`.replace(/\/+$/, "");
|
|
17
|
+
return {
|
|
18
|
+
title: p.title,
|
|
19
|
+
description: p.description,
|
|
20
|
+
url: pageUrl,
|
|
21
|
+
section: p.section ? p.section.toUpperCase() : "GENERAL"
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
else if (dbMod.db) try {
|
|
25
|
+
const { pages: pagesTable } = await import("#db/schema").catch(() => ({ pages: null }));
|
|
26
|
+
const { and, isNotNull, isNull } = await import("drizzle-orm");
|
|
27
|
+
if (pagesTable) {
|
|
28
|
+
const docRows = await dbMod.db.select().from(pagesTable).where(and(isNull(pagesTable.deletedAt), isNotNull(pagesTable.publishedVersionId))).catch(() => []);
|
|
29
|
+
const resolveLocalized = (val) => {
|
|
30
|
+
if (typeof val === "string") return val;
|
|
31
|
+
if (typeof val === "object" && val !== null) {
|
|
32
|
+
const rec = val;
|
|
33
|
+
return rec["en"] || Object.values(rec)[0] || "";
|
|
34
|
+
}
|
|
35
|
+
return typeof val === "number" ? String(val) : "";
|
|
36
|
+
};
|
|
37
|
+
pages = docRows.map((p) => {
|
|
38
|
+
const title = resolveLocalized(p.title) || p.slug;
|
|
39
|
+
const description = resolveLocalized(p.description);
|
|
40
|
+
const slug = p.slug === "index" ? "" : p.slug;
|
|
41
|
+
const pathPrefix = p.type === "doc" ? "docs" : p.type || "docs";
|
|
42
|
+
const pageUrl = `${siteUrl.replace(/\/$/, "")}/en/${pathPrefix}/${slug}`.replace(/\/+$/, "");
|
|
43
|
+
return {
|
|
44
|
+
title,
|
|
45
|
+
description,
|
|
46
|
+
url: pageUrl,
|
|
47
|
+
markdownUrl: `${pageUrl}.md`,
|
|
48
|
+
section: p.type ? p.type.toUpperCase() : "GENERAL"
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
} catch {}
|
|
53
|
+
const title = llmsOpts.title || siteConfig.name || "Documentation";
|
|
54
|
+
const description = llmsOpts.description || siteConfig.description || "Documentation index for AI agents.";
|
|
55
|
+
const body = buildLlmsTxt({
|
|
56
|
+
site: siteUrl,
|
|
57
|
+
title,
|
|
58
|
+
description,
|
|
59
|
+
pages,
|
|
12
60
|
...llmsOpts
|
|
13
61
|
});
|
|
14
|
-
return new Response(
|
|
62
|
+
return new Response(body, { headers: {
|
|
15
63
|
"Content-Type": "text/plain; charset=utf-8",
|
|
16
|
-
"Cache-Control": "public, max-age=3600,
|
|
64
|
+
"Cache-Control": "public, max-age=3600, s-maxage=86400"
|
|
17
65
|
} });
|
|
18
66
|
};
|
|
19
67
|
//#endregion
|
|
20
|
-
export { GET };
|
|
68
|
+
export { GET, prerender };
|
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
import { buildRobotsTxt } from "../robots.mjs";
|
|
2
|
-
import
|
|
2
|
+
import * as siteConfigMod from "virtual:rimelight-seo/site-config";
|
|
3
|
+
import seoOptions from "virtual:rimelight-seo/options";
|
|
4
|
+
import * as seoConfig from "virtual:rimelight-seo/config";
|
|
3
5
|
//#region src/routes/robots.txt.ts
|
|
4
|
-
const GET = ({ site }) => {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const GET = ({ site, url }) => {
|
|
7
|
+
const siteUrl = site ? site.toString() : siteConfigMod.siteConfig?.url || url.origin;
|
|
8
|
+
const sitemapURL = new URL("sitemap.xml", siteUrl).toString();
|
|
9
|
+
const defaultPrivatePrefixes = [
|
|
10
|
+
"/dashboard",
|
|
11
|
+
"/admin",
|
|
12
|
+
"/cms",
|
|
13
|
+
"/internal",
|
|
14
|
+
"/api",
|
|
15
|
+
"/dev",
|
|
16
|
+
"/og",
|
|
17
|
+
"/open-graph",
|
|
18
|
+
"/auth"
|
|
19
|
+
];
|
|
20
|
+
const customPrivatePrefixes = Array.isArray(seoConfig.PRIVATE_PATH_PREFIXES) ? seoConfig.PRIVATE_PATH_PREFIXES : [];
|
|
21
|
+
const privatePrefixes = Array.from(/* @__PURE__ */ new Set([...defaultPrivatePrefixes, ...customPrivatePrefixes]));
|
|
22
|
+
const disallowPatterns = [...privatePrefixes, ...privatePrefixes.map((p) => `/*${p.startsWith("/") ? p : `/${p}`}/`)];
|
|
23
|
+
const robotsOpts = typeof seoOptions?.robots === "object" ? seoOptions.robots : {};
|
|
24
|
+
const defaultAgentRules = [{
|
|
25
|
+
userAgent: "GPTBot",
|
|
26
|
+
disallow: privatePrefixes.map((p) => `${p.startsWith("/") ? p : `/${p}`}/`),
|
|
27
|
+
allow: ["/"]
|
|
28
|
+
}, {
|
|
29
|
+
userAgent: "ClaudeBot",
|
|
30
|
+
disallow: privatePrefixes.map((p) => `${p.startsWith("/") ? p : `/${p}`}/`),
|
|
31
|
+
allow: ["/"]
|
|
32
|
+
}];
|
|
7
33
|
const robots = buildRobotsTxt({
|
|
8
34
|
sitemapUrl: sitemapURL,
|
|
35
|
+
disallow: disallowPatterns,
|
|
9
36
|
allow: ["/"],
|
|
37
|
+
userAgentRules: defaultAgentRules,
|
|
10
38
|
...robotsOpts
|
|
11
39
|
});
|
|
12
40
|
return new Response(robots, { headers: {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { buildRssXml } from "../rss.mjs";
|
|
2
|
+
import * as siteConfigMod from "virtual:rimelight-seo/site-config";
|
|
3
|
+
import * as dbMod from "virtual:rimelight-seo/db";
|
|
4
|
+
import seoOptions from "virtual:rimelight-seo/options";
|
|
5
|
+
import * as seoConfig from "virtual:rimelight-seo/config";
|
|
6
|
+
//#region src/routes/rss.xml.ts
|
|
7
|
+
const GET = async ({ site, url }) => {
|
|
8
|
+
const rssOpts = typeof seoOptions?.rss === "object" ? seoOptions.rss : {};
|
|
9
|
+
const siteConfig = siteConfigMod.siteConfig || {};
|
|
10
|
+
const siteUrl = site ? site.toString() : rssOpts.site || siteConfig.url || url.origin;
|
|
11
|
+
let items = [];
|
|
12
|
+
if (Array.isArray(rssOpts.items)) items = rssOpts.items;
|
|
13
|
+
else if (typeof seoConfig.rssEntries === "function") items = await seoConfig.rssEntries();
|
|
14
|
+
else if (dbMod.db) try {
|
|
15
|
+
const { pages } = await import("#db/schema").catch(() => ({ pages: null }));
|
|
16
|
+
const { and, isNull, sql } = await import("drizzle-orm");
|
|
17
|
+
if (pages) items = (await dbMod.db.select().from(pages).where(and(sql`${pages.type} = 'blog'`, isNull(pages.deletedAt))).catch(() => [])).map((p) => {
|
|
18
|
+
return {
|
|
19
|
+
title: typeof p.title === "string" ? p.title : p.title?.en || p.title && Object.values(p.title)[0] || p.slug,
|
|
20
|
+
description: typeof p.description === "string" ? p.description : p.description?.en || p.description && Object.values(p.description)[0] || "",
|
|
21
|
+
link: `/blog/${p.slug}`,
|
|
22
|
+
pubDate: p.postedAt || p.createdAt || /* @__PURE__ */ new Date()
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
} catch {}
|
|
26
|
+
if (items.length === 0) try {
|
|
27
|
+
const { getCollection } = await import("astro:content");
|
|
28
|
+
const blog = await getCollection("blog");
|
|
29
|
+
if (Array.isArray(blog)) items = blog.map((post) => ({
|
|
30
|
+
title: post.data?.title || post.id,
|
|
31
|
+
pubDate: post.data?.pubDate || /* @__PURE__ */ new Date(),
|
|
32
|
+
description: post.data?.description,
|
|
33
|
+
link: `/blog/${post.id}/`
|
|
34
|
+
}));
|
|
35
|
+
} catch {}
|
|
36
|
+
const feedTitle = rssOpts.title || siteConfig.name || "RSS Feed";
|
|
37
|
+
const feedDesc = rssOpts.description || siteConfig.description || "";
|
|
38
|
+
const xml = buildRssXml({
|
|
39
|
+
title: feedTitle,
|
|
40
|
+
description: feedDesc,
|
|
41
|
+
site: siteUrl,
|
|
42
|
+
language: rssOpts.language || "en-US",
|
|
43
|
+
items
|
|
44
|
+
});
|
|
45
|
+
return new Response(xml, { headers: {
|
|
46
|
+
"Content-Type": "application/xml; charset=utf-8",
|
|
47
|
+
"Cache-Control": "public, max-age=3600, stale-while-revalidate=86400"
|
|
48
|
+
} });
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { GET };
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
import { buildSitemapXml } from "../sitemap.mjs";
|
|
2
|
-
import
|
|
1
|
+
import { buildSitemapUrls, buildSitemapXml } from "../sitemap.mjs";
|
|
2
|
+
import * as siteConfigMod from "virtual:rimelight-seo/site-config";
|
|
3
|
+
import seoOptions from "virtual:rimelight-seo/options";
|
|
4
|
+
import * as seoConfig from "virtual:rimelight-seo/config";
|
|
3
5
|
//#region src/routes/sitemap.xml.ts
|
|
4
|
-
const GET = () => {
|
|
5
|
-
const
|
|
6
|
+
const GET = async ({ site, url }) => {
|
|
7
|
+
const sitemapOpts = typeof seoOptions?.sitemap === "object" ? seoOptions.sitemap : {};
|
|
8
|
+
const siteUrl = site ? site.toString() : siteConfigMod.siteConfig?.url || url.origin;
|
|
9
|
+
let entries = [];
|
|
10
|
+
if (typeof sitemapOpts.entries === "function") entries = await sitemapOpts.entries();
|
|
11
|
+
else if (typeof seoConfig.seoEntries === "function") entries = await seoConfig.seoEntries();
|
|
12
|
+
const locales = sitemapOpts.locales || seoConfig.SEO_LOCALES || (siteUrl ? {
|
|
13
|
+
site: siteUrl.replace(/\/$/, ""),
|
|
14
|
+
locales: { en: "en-US" },
|
|
15
|
+
defaultLocale: "en",
|
|
16
|
+
trailingSlash: "never"
|
|
17
|
+
} : void 0);
|
|
18
|
+
let urls = sitemapOpts.urls || [];
|
|
19
|
+
if (urls.length === 0 && entries.length > 0 && locales) urls = buildSitemapUrls(entries, locales);
|
|
6
20
|
const xml = buildSitemapXml(urls);
|
|
7
21
|
return new Response(xml, { headers: {
|
|
8
22
|
"Content-Type": "application/xml; charset=utf-8",
|
package/dist/rss.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RssFeedOptions } from "./types.mjs";
|
|
2
|
+
//#region src/rss.d.ts
|
|
3
|
+
export declare function escapeXml(str: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Builds standard RSS 2.0 feed XML document with Atom namespace link.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildRssXml(options: RssFeedOptions): string;
|
|
8
|
+
//#endregion
|
package/dist/rss.mjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/rss.ts
|
|
2
|
+
function escapeXml(str) {
|
|
3
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Builds standard RSS 2.0 feed XML document with Atom namespace link.
|
|
7
|
+
*/
|
|
8
|
+
function buildRssXml(options) {
|
|
9
|
+
const siteUrl = (options.site || "").replace(/\/$/, "");
|
|
10
|
+
const feedUrl = options.feedUrl || `${siteUrl}/rss.xml`;
|
|
11
|
+
const language = options.language || "en-US";
|
|
12
|
+
const lastBuildDate = (/* @__PURE__ */ new Date()).toUTCString();
|
|
13
|
+
const itemXmls = (options.items || []).map((item) => {
|
|
14
|
+
const itemLink = item.link.startsWith("http://") || item.link.startsWith("https://") ? item.link : `${siteUrl}${item.link.startsWith("/") ? "" : "/"}${item.link}`;
|
|
15
|
+
const pubDate = new Date(item.pubDate).toUTCString();
|
|
16
|
+
const guid = item.guid || itemLink;
|
|
17
|
+
const lines = [
|
|
18
|
+
" <item>",
|
|
19
|
+
` <title>${escapeXml(item.title)}</title>`,
|
|
20
|
+
` <link>${escapeXml(itemLink)}</link>`,
|
|
21
|
+
` <guid isPermaLink="${guid.startsWith("http") ? "true" : "false"}">${escapeXml(guid)}</guid>`,
|
|
22
|
+
` <pubDate>${pubDate}</pubDate>`
|
|
23
|
+
];
|
|
24
|
+
if (item.description) lines.push(` <description>${escapeXml(item.description)}</description>`);
|
|
25
|
+
if (item.author) lines.push(` <author>${escapeXml(item.author)}</author>`);
|
|
26
|
+
if (item.content) lines.push(` <content:encoded><![CDATA[${item.content}]]></content:encoded>`);
|
|
27
|
+
lines.push(" </item>");
|
|
28
|
+
return lines.join("\n");
|
|
29
|
+
});
|
|
30
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
31
|
+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
|
32
|
+
<channel>
|
|
33
|
+
<title>${escapeXml(options.title || "")}</title>
|
|
34
|
+
<description>${escapeXml(options.description || "")}</description>
|
|
35
|
+
<link>${escapeXml(siteUrl)}</link>
|
|
36
|
+
<language>${escapeXml(language)}</language>
|
|
37
|
+
<lastBuildDate>${lastBuildDate}</lastBuildDate>
|
|
38
|
+
<atom:link href="${escapeXml(feedUrl)}" rel="self" type="application/rss+xml"/>
|
|
39
|
+
${itemXmls.join("\n")}
|
|
40
|
+
</channel>
|
|
41
|
+
</rss>`;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { buildRssXml, escapeXml };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as BreadcrumbItem, t as ArticleSchemaOptions } from "./schema-C8v69blQ.mjs";
|
|
2
|
-
import { n as LlmsPage, r as LlmsTxtOptions, t as LlmsFullTxtOptions } from "./llms-BVLxzjr-.mjs";
|
|
2
|
+
import { n as LlmsPage, r as LlmsTxtOptions$1, t as LlmsFullTxtOptions$1 } from "./llms-BVLxzjr-.mjs";
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Change frequency for sitemap entries
|
|
@@ -273,5 +273,82 @@ export interface HeadProps {
|
|
|
273
273
|
*/
|
|
274
274
|
twitter?: TwitterMeta;
|
|
275
275
|
}
|
|
276
|
+
export interface RssItem {
|
|
277
|
+
title: string;
|
|
278
|
+
link: string;
|
|
279
|
+
pubDate: Date | string | number;
|
|
280
|
+
description?: string;
|
|
281
|
+
content?: string;
|
|
282
|
+
guid?: string;
|
|
283
|
+
author?: string;
|
|
284
|
+
}
|
|
285
|
+
export interface RssFeedOptions {
|
|
286
|
+
title: string;
|
|
287
|
+
description: string;
|
|
288
|
+
site: string;
|
|
289
|
+
feedUrl?: string;
|
|
290
|
+
language?: string;
|
|
291
|
+
items: RssItem[];
|
|
292
|
+
}
|
|
293
|
+
export interface RssOptions extends Partial<RssFeedOptions> {
|
|
294
|
+
/**
|
|
295
|
+
* Custom RSS route pattern (default: "/rss.xml")
|
|
296
|
+
*/
|
|
297
|
+
path?: string;
|
|
298
|
+
/**
|
|
299
|
+
* Custom items loader
|
|
300
|
+
*/
|
|
301
|
+
items?: RssItem[];
|
|
302
|
+
}
|
|
303
|
+
export interface SitemapOptions {
|
|
304
|
+
/**
|
|
305
|
+
* Sitemap route pattern (default: "/sitemap.xml")
|
|
306
|
+
*/
|
|
307
|
+
path?: string;
|
|
308
|
+
urls?: SitemapUrl[];
|
|
309
|
+
entries?: () => Promise<SeoEntry[]> | SeoEntry[];
|
|
310
|
+
locales?: LocaleConfig;
|
|
311
|
+
[key: string]: unknown;
|
|
312
|
+
}
|
|
313
|
+
export interface RobotsRouteOptions extends Partial<RobotsOptions> {
|
|
314
|
+
/**
|
|
315
|
+
* Route pattern (default: "/robots.txt")
|
|
316
|
+
*/
|
|
317
|
+
path?: string;
|
|
318
|
+
}
|
|
319
|
+
export interface LlmsRouteOptions extends Partial<LlmsTxtOptions> {
|
|
320
|
+
/**
|
|
321
|
+
* Route pattern (default: "/llms.txt")
|
|
322
|
+
*/
|
|
323
|
+
path?: string;
|
|
324
|
+
}
|
|
325
|
+
export interface LlmsFullRouteOptions extends Partial<LlmsFullTxtOptions> {
|
|
326
|
+
/**
|
|
327
|
+
* Route pattern (default: "/llms-full.txt")
|
|
328
|
+
*/
|
|
329
|
+
path?: string;
|
|
330
|
+
}
|
|
331
|
+
export interface RimelightSeoOptions {
|
|
332
|
+
/**
|
|
333
|
+
* Sitemap configuration or false to disable automatic /sitemap.xml (default: true)
|
|
334
|
+
*/
|
|
335
|
+
sitemap?: boolean | SitemapOptions;
|
|
336
|
+
/**
|
|
337
|
+
* Robots.txt configuration or false to disable automatic /robots.txt (default: true)
|
|
338
|
+
*/
|
|
339
|
+
robots?: boolean | RobotsRouteOptions;
|
|
340
|
+
/**
|
|
341
|
+
* RSS feed configuration or false to disable automatic /rss.xml (default: true)
|
|
342
|
+
*/
|
|
343
|
+
rss?: boolean | RssOptions;
|
|
344
|
+
/**
|
|
345
|
+
* LLMs.txt configuration or false to disable automatic /llms.txt (default: true)
|
|
346
|
+
*/
|
|
347
|
+
llms?: boolean | LlmsRouteOptions;
|
|
348
|
+
/**
|
|
349
|
+
* LLMs-full.txt configuration or false to disable automatic /llms-full.txt (default: true)
|
|
350
|
+
*/
|
|
351
|
+
llmsFull?: boolean | LlmsFullRouteOptions;
|
|
352
|
+
}
|
|
276
353
|
//#endregion
|
|
277
|
-
export type { ArticleSchemaOptions, BreadcrumbItem, LlmsFullTxtOptions, LlmsPage, LlmsTxtOptions };
|
|
354
|
+
export type { ArticleSchemaOptions, BreadcrumbItem, LlmsFullTxtOptions$1 as LlmsFullTxtOptions, LlmsPage, LlmsTxtOptions$1 as LlmsTxtOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/seo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment's SEO Package",
|
|
6
6
|
"homepage": "https://rimelight.com/docs",
|
|
@@ -41,6 +41,14 @@
|
|
|
41
41
|
"types": "./dist/integration.d.mts",
|
|
42
42
|
"import": "./dist/integration.mjs"
|
|
43
43
|
},
|
|
44
|
+
"./rss": {
|
|
45
|
+
"types": "./dist/rss.d.mts",
|
|
46
|
+
"import": "./dist/rss.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./og": {
|
|
49
|
+
"types": "./dist/og.d.mts",
|
|
50
|
+
"import": "./dist/og.mjs"
|
|
51
|
+
},
|
|
44
52
|
"./components/*": "./src/components/*",
|
|
45
53
|
"./routes/*": "./src/routes/*",
|
|
46
54
|
"./*": "./src/*"
|
|
@@ -49,12 +57,18 @@
|
|
|
49
57
|
"access": "public"
|
|
50
58
|
},
|
|
51
59
|
"devDependencies": {
|
|
52
|
-
"@rimelight/config": "0.0.
|
|
60
|
+
"@rimelight/config": "0.0.8",
|
|
53
61
|
"astro": "7.3.2",
|
|
54
62
|
"typescript": "6.0.3"
|
|
55
63
|
},
|
|
56
64
|
"peerDependencies": {
|
|
57
|
-
"astro": ">=7.0.0"
|
|
65
|
+
"astro": ">=7.0.0",
|
|
66
|
+
"takumi-js": ">=2.0.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"takumi-js": {
|
|
70
|
+
"optional": true
|
|
71
|
+
}
|
|
58
72
|
},
|
|
59
73
|
"engines": {
|
|
60
74
|
"node": ">=26.8.2"
|
package/src/env.d.ts
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
|
-
declare module "*.astro" {
|
|
2
|
-
export default {} as import("astro/runtime/server").AstroComponentFactory
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
declare module "virtual:rimelight-seo-config" {
|
|
6
|
-
const config: import("./integration.js").RimelightSeoOptions
|
|
7
|
-
export default config
|
|
8
|
-
}
|
|
1
|
+
declare module "*.astro" {
|
|
2
|
+
export default {} as import("astro/runtime/server").AstroComponentFactory
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare module "virtual:rimelight-seo-config" {
|
|
6
|
+
const config: import("./integration.js").RimelightSeoOptions
|
|
7
|
+
export default config
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module "virtual:rimelight-seo/options" {
|
|
11
|
+
const config: import("./integration.js").RimelightSeoOptions
|
|
12
|
+
export default config
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare module "virtual:rimelight-seo/config" {
|
|
16
|
+
export const SEO_LOCALES: import("./types.js").LocaleConfig | undefined
|
|
17
|
+
export const PRIVATE_PATH_PREFIXES: string[] | undefined
|
|
18
|
+
export const seoEntries: (() => Promise<import("./types.js").SeoEntry[]>) | undefined
|
|
19
|
+
export const rssEntries: (() => Promise<import("./types.js").RssItem[]>) | undefined
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module "virtual:rimelight-seo/site-config" {
|
|
23
|
+
export const siteConfig: import("./types.js").SiteConfig | Record<string, any>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module "virtual:rimelight-seo/db" {
|
|
27
|
+
export const db: any
|
|
28
|
+
export const pages: any
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare module "virtual:rimelight-seo/corpus" {
|
|
32
|
+
export const corpusPages: any[]
|
|
33
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -2,19 +2,26 @@ export type {
|
|
|
2
2
|
ChangeFreq,
|
|
3
3
|
LocaleConfig,
|
|
4
4
|
RobotsOptions,
|
|
5
|
+
RobotsRouteOptions,
|
|
5
6
|
SeoEntry,
|
|
6
7
|
SitemapAlternate,
|
|
7
8
|
SitemapUrl,
|
|
9
|
+
SitemapOptions,
|
|
8
10
|
UserAgentRule,
|
|
9
11
|
SiteConfig,
|
|
10
12
|
OGImage,
|
|
11
13
|
RSSFeed,
|
|
14
|
+
RssItem,
|
|
15
|
+
RssFeedOptions,
|
|
16
|
+
RssOptions,
|
|
12
17
|
HeadProps,
|
|
13
18
|
OpenGraphMeta,
|
|
14
19
|
TwitterMeta,
|
|
15
20
|
LlmsPage,
|
|
16
21
|
LlmsTxtOptions,
|
|
17
22
|
LlmsFullTxtOptions,
|
|
23
|
+
LlmsRouteOptions,
|
|
24
|
+
LlmsFullRouteOptions,
|
|
18
25
|
ArticleSchemaOptions,
|
|
19
26
|
BreadcrumbItem
|
|
20
27
|
} from "./types.js"
|
|
@@ -28,6 +35,8 @@ export {
|
|
|
28
35
|
|
|
29
36
|
export { buildRobotsTxt } from "./robots.js"
|
|
30
37
|
|
|
38
|
+
export { buildRssXml, escapeXml } from "./rss.js"
|
|
39
|
+
|
|
31
40
|
export {
|
|
32
41
|
buildCanonicalUrl,
|
|
33
42
|
buildPageTitle,
|
|
@@ -39,4 +48,9 @@ export {
|
|
|
39
48
|
|
|
40
49
|
export { buildLlmsTxt, buildLlmsFullTxt } from "./llms.js"
|
|
41
50
|
export { buildArticleSchema, buildBreadcrumbSchema } from "./schema.js"
|
|
42
|
-
export {
|
|
51
|
+
export type { OgFontConfig, OgLayoutOptions, OgRenderConfig } from "./og.js"
|
|
52
|
+
|
|
53
|
+
import { rimelightSeo } from "./integration.js"
|
|
54
|
+
export type { RimelightSeoOptions } from "./integration.js"
|
|
55
|
+
export { rimelightSeo }
|
|
56
|
+
export default rimelightSeo
|