@sharadox/metadata-web-library 0.1.2 → 0.2.0
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 +2 -0
- package/distribution/llms-text/index.d.ts +10 -0
- package/distribution/llms-text/index.d.ts.map +1 -0
- package/distribution/llms-text/index.js +18 -0
- package/distribution/llms-text/index.js.map +1 -0
- package/distribution/llms-text/type.d.ts +17 -0
- package/distribution/llms-text/type.d.ts.map +1 -0
- package/distribution/llms-text/type.js +2 -0
- package/distribution/llms-text/type.js.map +1 -0
- package/distribution/page-metadata/index.d.ts.map +1 -1
- package/distribution/page-metadata/index.js +5 -1
- package/distribution/page-metadata/index.js.map +1 -1
- package/distribution/page-metadata/type.d.ts +1 -1
- package/distribution/page-metadata/type.d.ts.map +1 -1
- package/distribution/security-text/index.d.ts +12 -0
- package/distribution/security-text/index.d.ts.map +1 -0
- package/distribution/security-text/index.js +21 -0
- package/distribution/security-text/index.js.map +1 -0
- package/distribution/security-text/type.d.ts +15 -0
- package/distribution/security-text/type.d.ts.map +1 -0
- package/distribution/security-text/type.js +2 -0
- package/distribution/security-text/type.js.map +1 -0
- package/llms.txt +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -66,6 +66,8 @@ export default async function Image() {
|
|
|
66
66
|
| `…/structured-data` | `<StructuredData data>` (escapes `<`) |
|
|
67
67
|
| `…/structured-data-graph` | `structuredDataGraph(...nodes)` → `{ "@context", "@graph" }` |
|
|
68
68
|
| `…/share-image` | `shareImage(element, { width?, height?, fonts? })`, `SHARE_IMAGE_SIZE` (1200×630) |
|
|
69
|
+
| `…/llms-text` | `llmsText({ title, summary, details?, sections: [{ title, lines, style? }] })` → the site's `llms.txt` (llmstxt.org) for AI assistants |
|
|
70
|
+
| `…/security-text` | `securityText({ contact, canonical, expires?, preferredLanguages?, policy? })` → `/.well-known/security.txt` (RFC 9116), valid a year from the build |
|
|
69
71
|
|
|
70
72
|
## Develop
|
|
71
73
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LlmsTextOptions } from "@sharadox/metadata-web-library/llms-text/type";
|
|
2
|
+
/**
|
|
3
|
+
* An `llms.txt` (llmstxt.org): a site described in plain Markdown for AI assistants — a title, a one-sentence
|
|
4
|
+
* summary, details, then sections of lists, steps or paragraphs. Serve it at `/llms.txt`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* llmsText({ title: "Example", summary: "A bakery in Faro.", sections: [{ title: "Contact", lines: ["Email: hi@example.com"] }] });
|
|
8
|
+
*/
|
|
9
|
+
export declare function llmsText({ title, summary, details, sections }: LlmsTextOptions): string;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/llms-text/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAErF;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,GAAG,MAAM,CAUvF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An `llms.txt` (llmstxt.org): a site described in plain Markdown for AI assistants — a title, a one-sentence
|
|
3
|
+
* summary, details, then sections of lists, steps or paragraphs. Serve it at `/llms.txt`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* llmsText({ title: "Example", summary: "A bakery in Faro.", sections: [{ title: "Contact", lines: ["Email: hi@example.com"] }] });
|
|
7
|
+
*/
|
|
8
|
+
export function llmsText({ title, summary, details, sections }) {
|
|
9
|
+
const blocks = [`# ${title}`, `> ${summary}`, ...(details ? [details] : [])];
|
|
10
|
+
for (const { title: heading, lines, style = "list" } of sections) {
|
|
11
|
+
const body = style === "plain"
|
|
12
|
+
? lines.join("\n\n")
|
|
13
|
+
: lines.map((line, index) => `${style === "numbered" ? `${index + 1}.` : "-"} ${line}`).join("\n");
|
|
14
|
+
blocks.push(`## ${heading}`, body);
|
|
15
|
+
}
|
|
16
|
+
return `${blocks.join("\n\n")}\n`;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/llms-text/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAmB;IAC7E,MAAM,MAAM,GAAG,CAAC,KAAK,KAAK,EAAE,EAAE,KAAK,OAAO,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QACjE,MAAM,IAAI,GACR,KAAK,KAAK,OAAO;YACf,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;YACpB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvG,MAAM,CAAC,IAAI,CAAC,MAAM,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** One part of an `llms.txt`: a heading and its lines (each becomes a list item unless `numbered` or `plain`). */
|
|
2
|
+
export interface LlmsSection {
|
|
3
|
+
title: string;
|
|
4
|
+
lines: readonly string[];
|
|
5
|
+
/** "list" (the default), "numbered" for steps, or "plain" for paragraphs. */
|
|
6
|
+
style?: "list" | "numbered" | "plain";
|
|
7
|
+
}
|
|
8
|
+
export interface LlmsTextOptions {
|
|
9
|
+
/** The site's or business's name: the file's title. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** One sentence on what it is, shown as the summary quote. */
|
|
12
|
+
summary: string;
|
|
13
|
+
/** A paragraph of detail after the summary. */
|
|
14
|
+
details?: string;
|
|
15
|
+
sections: readonly LlmsSection[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/llms-text/type.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/llms-text/type.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/page-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/page-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAE7F;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAS,MAAM,EAAE,EAClD,IAAI,EACJ,GAAG,EACH,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,IAAS,EACT,aAAyC,EACzC,QAAQ,EACR,SAAgB,GACjB,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,QAAQ,CA+BxC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SEPARATOR } from "@sharadox/web-library/text/separator";
|
|
1
2
|
/**
|
|
2
3
|
* Everything search engines and share cards need for a localized page, as a Next.js `Metadata` object: title and
|
|
3
4
|
* template, description, canonical address and hreflang alternates, Open Graph (with the locale and its
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
* title: "Sharadox • Technologies that simplify the world", description: "…" });
|
|
11
12
|
* }
|
|
12
13
|
*/
|
|
13
|
-
export function pageMetadata({ name, url, locales, locale, title, description, path = "", titleTemplate = `%s
|
|
14
|
+
export function pageMetadata({ name, url, locales, locale, title, description, path = "", titleTemplate = `%s ${SEPARATOR} ${name}`, keywords, indexable = true, }) {
|
|
14
15
|
const address = locales.localePath(locale, path);
|
|
15
16
|
return {
|
|
16
17
|
metadataBase: new URL(url),
|
|
@@ -19,6 +20,9 @@ export function pageMetadata({ name, url, locales, locale, title, description, p
|
|
|
19
20
|
applicationName: name,
|
|
20
21
|
authors: [{ name, url }],
|
|
21
22
|
creator: name,
|
|
23
|
+
publisher: name,
|
|
24
|
+
// The name under the icon when the site is added to an iPhone's home screen.
|
|
25
|
+
appleWebApp: { title: name, statusBarStyle: "black-translucent" },
|
|
22
26
|
...(keywords ? { keywords: [...keywords] } : {}),
|
|
23
27
|
alternates: { canonical: address, languages: locales.alternates(path) },
|
|
24
28
|
openGraph: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/page-metadata/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/page-metadata/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAwB,EAClD,IAAI,EACJ,GAAG,EACH,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,IAAI,GAAG,EAAE,EACT,aAAa,GAAG,MAAM,SAAS,IAAI,IAAI,EAAE,EACzC,QAAQ,EACR,SAAS,GAAG,IAAI,GACY;IAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACjD,OAAO;QACL,YAAY,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC;QAC1B,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE;QAClD,WAAW;QACX,eAAe,EAAE,IAAI;QACrB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QACxB,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,IAAI;QACf,6EAA6E;QAC7E,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,mBAAmB,EAAE;QACjE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,UAAU,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QACvE,SAAS,EAAE;YACT,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,OAAO;YACZ,QAAQ,EAAE,IAAI;YACd,KAAK;YACL,WAAW;YACX,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC;YACvC,eAAe,EAAE,OAAO,CAAC,OAAO;iBAC7B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC;iBACnC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;SAClD;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,WAAW,EAAE;QAC5D,MAAM,EAAE,SAAS;YACf,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE;YACvG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;QACnC,eAAe,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,7 @@ export interface PageMetadataOptions<Locale extends string> {
|
|
|
14
14
|
description: string;
|
|
15
15
|
/** The path after the locale, for example "/contact"; the home page by default. */
|
|
16
16
|
path?: string;
|
|
17
|
-
/** How sub-pages build their titles from this one; `%s` is the sub-page's title. Default: "%s
|
|
17
|
+
/** How sub-pages build their titles from this one; `%s` is the sub-page's title. Default: "%s · <name>", with the shared separator. */
|
|
18
18
|
titleTemplate?: string;
|
|
19
19
|
keywords?: readonly string[];
|
|
20
20
|
/** False keeps the page out of search engines (previews, demos). True by default. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/page-metadata/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AAEtF,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,MAAM;IACxD,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/page-metadata/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AAEtF,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,MAAM;IACxD,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uIAAuI;IACvI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SecurityTextOptions } from "@sharadox/metadata-web-library/security-text/type";
|
|
2
|
+
/**
|
|
3
|
+
* A `security.txt` (RFC 9116): how to report a vulnerability in the site, served at `/.well-known/security.txt`. It
|
|
4
|
+
* expires a year after it is built unless told otherwise, so a site rebuilt at least once a year stays valid.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // src/app/.well-known/security.txt/route.ts
|
|
8
|
+
* export const GET = () => new Response(securityText({ contact: "mailto:security@example.com",
|
|
9
|
+
* canonical: "https://example.com/.well-known/security.txt" }), { headers: { "content-type": "text/plain" } });
|
|
10
|
+
*/
|
|
11
|
+
export declare function securityText({ contact, canonical, now, expires, preferredLanguages, policy, }: SecurityTextOptions): string;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/security-text/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAI7F;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,SAAS,EACT,GAAgB,EAChB,OAAwC,EACxC,kBAAkB,EAClB,MAAM,GACP,EAAE,mBAAmB,GAAG,MAAM,CAS9B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const YEAR = 365 * 24 * 60 * 60 * 1000;
|
|
2
|
+
/**
|
|
3
|
+
* A `security.txt` (RFC 9116): how to report a vulnerability in the site, served at `/.well-known/security.txt`. It
|
|
4
|
+
* expires a year after it is built unless told otherwise, so a site rebuilt at least once a year stays valid.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // src/app/.well-known/security.txt/route.ts
|
|
8
|
+
* export const GET = () => new Response(securityText({ contact: "mailto:security@example.com",
|
|
9
|
+
* canonical: "https://example.com/.well-known/security.txt" }), { headers: { "content-type": "text/plain" } });
|
|
10
|
+
*/
|
|
11
|
+
export function securityText({ contact, canonical, now = new Date(), expires = new Date(now.getTime() + YEAR), preferredLanguages, policy, }) {
|
|
12
|
+
return [
|
|
13
|
+
...[contact].flat().map((address) => `Contact: ${address}`),
|
|
14
|
+
`Expires: ${expires.toISOString().replace(/\.\d{3}Z$/, "Z")}`,
|
|
15
|
+
...(preferredLanguages?.length ? [`Preferred-Languages: ${preferredLanguages.join(", ")}`] : []),
|
|
16
|
+
`Canonical: ${canonical}`,
|
|
17
|
+
...(policy ? [`Policy: ${policy}`] : []),
|
|
18
|
+
"",
|
|
19
|
+
].join("\n");
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/security-text/index.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,OAAO,EACP,SAAS,EACT,GAAG,GAAG,IAAI,IAAI,EAAE,EAChB,OAAO,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EACxC,kBAAkB,EAClB,MAAM,GACc;IACpB,OAAO;QACL,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,OAAO,EAAE,CAAC;QAC3D,YAAY,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE;QAC7D,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,wBAAwB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChG,cAAc,SAAS,EAAE;QACzB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxC,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SecurityTextOptions {
|
|
2
|
+
/** Where to report a vulnerability: "mailto:security@example.com" or a web address. */
|
|
3
|
+
contact: string | readonly string[];
|
|
4
|
+
/** The file's own address, for example "https://example.com/.well-known/security.txt". */
|
|
5
|
+
canonical: string;
|
|
6
|
+
/** When the file stops being valid; a year after `now` by default (the standard asks for under a year). */
|
|
7
|
+
expires?: Date;
|
|
8
|
+
/** Languages reports are read in, for example ["en", "pt"]. */
|
|
9
|
+
preferredLanguages?: readonly string[];
|
|
10
|
+
/** A page with the security policy. */
|
|
11
|
+
policy?: string;
|
|
12
|
+
/** Today, for the default expiry (tests). */
|
|
13
|
+
now?: Date;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/security-text/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,uFAAuF;IACvF,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACpC,0FAA0F;IAC1F,SAAS,EAAE,MAAM,CAAC;IAClB,2GAA2G;IAC3G,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/security-text/type.ts"],"names":[],"mappings":""}
|
package/llms.txt
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
> SEO/share/install metadata for Next.js App Router sites, built on @sharadox/internationalization-web-library locales.
|
|
4
4
|
|
|
5
|
-
- `/page-metadata` pageMetadata({ name, url, locales, locale, title, description, path?, titleTemplate? = "%s
|
|
5
|
+
- `/page-metadata` pageMetadata({ name, url, locales, locale, title, description, path?, titleTemplate? = "%s · name" (shared SEPARATOR), keywords?, indexable? = true }) → Metadata (metadataBase, title template, canonical, hreflang alternates incl. x-default, openGraph with locale/alternateLocale, twitter summary_large_image, robots, formatDetection, publisher, appleWebApp title)
|
|
6
6
|
- `/sitemap` localizedSitemap({ url, locales, paths? = [""], priority?, otherPriority?, changeFrequency? = "monthly", lastModified? })
|
|
7
7
|
- `/robots` robots({ url, indexable })
|
|
8
8
|
- `/manifest` webManifest({ name, shortName?, description?, id? = "/", startUrl? = "/", backgroundColor, themeColor, icons? = DEFAULT_ICONS }) → standalone, online-only
|
|
9
9
|
- `/structured-data` <StructuredData data /> ; `/structured-data-graph` structuredDataGraph(...nodes)
|
|
10
10
|
- `/share-image` shareImage(jsx, { width?, height?, fonts? }) → ImageResponse; SHARE_IMAGE_SIZE 1200x630
|
|
11
11
|
- Peer deps: next, react. License: Sharadox Open Source License 0.1.0
|
|
12
|
+
- `/llms-text` llmsText({ title, summary, details?, sections: [{ title, lines, style?: "list" | "numbered" | "plain" }] }) → Markdown llms.txt
|
|
13
|
+
- `/security-text` securityText({ contact (string or list), canonical, expires? = build + 1 year, preferredLanguages?, policy? }) → RFC 9116 text for /.well-known/security.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharadox/metadata-web-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Everything search engines, share cards and installation need: page metadata, sitemaps, robots rules, web app manifests, JSON-LD structured data and share images for Next.js.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENCA.md",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@sharadox/internationalization-web-library": "^0.1.0",
|
|
77
|
-
"@sharadox/web-library": "^0.
|
|
77
|
+
"@sharadox/web-library": "^0.7.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"next": ">=16",
|