@lupinum/ginko 0.4.0 → 0.6.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/CHANGELOG.md +161 -0
- package/README.md +2 -2
- package/dist/basics.d.mts +492 -0
- package/dist/basics.d.ts +492 -0
- package/dist/basics.mjs +416 -0
- package/dist/cli/index.mjs +59 -56
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +3 -3
- package/dist/internal/search.mjs +6 -3
- package/dist/internal.d.mts +387 -41
- package/dist/internal.d.ts +387 -41
- package/dist/internal.mjs +267 -101
- package/dist/nuxt/module.d.mts +2 -2
- package/dist/nuxt/module.d.ts +2 -2
- package/dist/nuxt/module.mjs +108 -15
- package/dist/nuxt/runtime/GinkoImage.d.mts +1 -1
- package/dist/nuxt/runtime/GinkoMarkdown.mjs +2 -2
- package/dist/nuxt/runtime/composables.d.mts +4 -3
- package/dist/nuxt/runtime/composables.mjs +19 -15
- package/dist/nuxt/runtime/fetch.d.mts +3 -1
- package/dist/nuxt/runtime/fetch.mjs +12 -6
- package/dist/nuxt/runtime/markdown.d.mts +3 -0
- package/dist/nuxt/runtime/markdown.mjs +15 -3
- package/dist/nuxt/runtime/plugin.mjs +6 -35
- package/dist/nuxt/runtime/preview-listener.d.mts +13 -0
- package/dist/nuxt/runtime/preview-listener.mjs +37 -0
- package/dist/nuxt/runtime/preview.vue +3 -1
- package/dist/nuxt/runtime/schema.d.ts +6 -0
- package/dist/nuxt/runtime/server/bundles.d.ts +4 -0
- package/dist/nuxt/runtime/server/files-md.d.ts +2 -0
- package/dist/nuxt/runtime/server/files.d.ts +2 -0
- package/dist/nuxt/runtime/server/headers.d.ts +2 -0
- package/dist/nuxt/runtime/server/items.d.mts +12 -0
- package/dist/nuxt/runtime/server/items.d.ts +12 -0
- package/dist/nuxt/runtime/server/items.mjs +17 -0
- package/dist/nuxt/runtime/server/llms-full.d.ts +2 -0
- package/dist/nuxt/runtime/server/llms.d.ts +2 -0
- package/dist/nuxt/runtime/server/markdown-trees.d.ts +2 -0
- package/dist/nuxt/runtime/server/markdown.d.ts +2 -0
- package/dist/nuxt/runtime/server/markdown.mjs +1 -1
- package/dist/nuxt/runtime/server/platform-md.d.mts +3 -0
- package/dist/nuxt/runtime/server/platform-md.d.ts +3 -0
- package/dist/nuxt/runtime/server/platform-md.mjs +71 -0
- package/dist/nuxt/runtime/server/redirects.d.ts +2 -0
- package/dist/nuxt/runtime/server/robots.d.ts +2 -0
- package/dist/nuxt/runtime/server/search.d.ts +2 -0
- package/dist/nuxt/runtime/server/site-config.d.ts +14 -0
- package/dist/nuxt/runtime/server/sitemap-source.d.ts +2 -0
- package/dist/nuxt/runtime/server/sitemap-xml.d.ts +24 -0
- package/dist/nuxt/runtime/server/sitemap.d.ts +2 -0
- package/dist/nuxt/runtime/shared.d.mts +10 -3
- package/dist/nuxt/runtime/shared.mjs +2 -2
- package/dist/shared/{ginko.BBkZW2nW.d.ts → ginko.6cI8KXZP.d.mts} +2 -2
- package/dist/shared/{ginko.CrNRBkS5.mjs → ginko.B1-DoOea.mjs} +253 -309
- package/dist/shared/ginko.BNVC-g9n.mjs +10389 -0
- package/dist/shared/{ginko.Bwan3BB-.d.mts → ginko.B_pACpVU.d.ts} +2 -2
- package/dist/shared/ginko.BaFweQcB.d.mts +91 -0
- package/dist/shared/ginko.BiDXgjLy.d.ts +91 -0
- package/dist/shared/ginko.C-oz8wwI.mjs +95 -0
- package/dist/shared/{ginko.BDF3bW0C.d.ts → ginko.CLzVaDi4.d.ts} +56 -5
- package/dist/shared/ginko.C_nq6vk7.d.mts +1622 -0
- package/dist/shared/ginko.CjWB8N7f.d.ts +128 -0
- package/dist/shared/ginko.D1PeQ3ds.mjs +36 -0
- package/dist/shared/ginko.D2oht0Kx.d.ts +1622 -0
- package/dist/shared/ginko.DCHGkQ7P.mjs +116 -0
- package/dist/shared/ginko.DIl7l-75.mjs +26 -0
- package/dist/shared/{ginko.akHewCGt.d.mts → ginko.DkIc0ZZk.d.mts} +56 -5
- package/dist/shared/{ginko.D-fNojn9.d.mts → ginko.DrkUeYFP.d.mts} +824 -10
- package/dist/shared/{ginko.D-fNojn9.d.ts → ginko.DrkUeYFP.d.ts} +824 -10
- package/dist/shared/ginko.WAfoMhv1.mjs +601 -0
- package/dist/shared/ginko.o1yIKlgj.d.mts +128 -0
- package/dist/shared/{ginko.Dht0xxE5.mjs → ginko.raCzOPYC.mjs} +1 -2
- package/dist/shared/{ginko.C90fPpMP.mjs → ginko.t-gbwzxh.mjs} +128 -101
- package/dist/shared/ginko.yKMIjJ68.mjs +84 -0
- package/dist/vue.d.mts +5 -4
- package/dist/vue.d.ts +5 -4
- package/dist/vue.mjs +1 -1
- package/i18n/ar.json +212 -0
- package/i18n/de.json +9 -1
- package/i18n/en.json +9 -1
- package/i18n/es.json +12 -4
- package/i18n/fr.json +212 -0
- package/i18n/it.json +212 -0
- package/package.json +7 -3
- package/dist/shared/ginko.BTUfZCfa.d.mts +0 -172
- package/dist/shared/ginko.C-QjDn3O.mjs +0 -4944
- package/dist/shared/ginko.CQvxhyez.mjs +0 -40
- package/dist/shared/ginko.Dc0oNcDv.d.ts +0 -172
- package/dist/shared/ginko.Mn30dmlm.mjs +0 -20
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { B as Bundle } from './ginko.B_pACpVU.js';
|
|
2
|
+
import { L as Locale } from './ginko.DrkUeYFP.js';
|
|
3
|
+
|
|
4
|
+
interface NavNode {
|
|
5
|
+
title: string;
|
|
6
|
+
path: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
brick?: string;
|
|
9
|
+
children: NavNode[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Navigation tree of the collections `bricks` in `locale`, built from item URLs. An item is a child of the
|
|
13
|
+
* node at its nearest existing path prefix, else a root node. A string `parent` field (item id) overrides that.
|
|
14
|
+
* Siblings keep the item order of the bundle (bricks in the given order).
|
|
15
|
+
*/
|
|
16
|
+
declare function navTree(bundle: Bundle, bricks: string[], locale: Locale): NavNode[];
|
|
17
|
+
/** Nodes from the root down to the node at `path`; empty when the path is not in the tree. */
|
|
18
|
+
declare function breadcrumbs(tree: NavNode[], path: string): NavNode[];
|
|
19
|
+
|
|
20
|
+
interface SeoImage {
|
|
21
|
+
url: string;
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
alt?: string;
|
|
25
|
+
}
|
|
26
|
+
interface SeoInput {
|
|
27
|
+
siteName: string;
|
|
28
|
+
/** `%s` is replaced by the page title; default '%s · <siteName>'. A page without title gets siteName alone. */
|
|
29
|
+
titleTemplate?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
image?: SeoImage;
|
|
33
|
+
type?: 'website' | 'article';
|
|
34
|
+
noindex?: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface SeoHead {
|
|
37
|
+
title: string;
|
|
38
|
+
meta: (({
|
|
39
|
+
name: string;
|
|
40
|
+
} | {
|
|
41
|
+
property: string;
|
|
42
|
+
}) & {
|
|
43
|
+
content: string;
|
|
44
|
+
})[];
|
|
45
|
+
}
|
|
46
|
+
declare function seoHead(input: SeoInput): SeoHead;
|
|
47
|
+
/** True when a request for `host` (with port, as in the Host header) is not for the site's own address: preview deployments, staging, localhost. Those must never be indexed. */
|
|
48
|
+
declare function isPreviewHost(host: string | undefined, siteUrl: string): boolean;
|
|
49
|
+
declare function robotsTxt(options: {
|
|
50
|
+
sitemap?: string;
|
|
51
|
+
noindex?: boolean;
|
|
52
|
+
disallow?: string[];
|
|
53
|
+
}): string;
|
|
54
|
+
declare function websiteLd(o: {
|
|
55
|
+
name: string;
|
|
56
|
+
url: string;
|
|
57
|
+
lang: string;
|
|
58
|
+
}): Record<string, unknown>;
|
|
59
|
+
/**
|
|
60
|
+
* `node` with the site's `country` (ISO 3166 code) where a builder left it out: `addressCountry` of every PostalAddress,
|
|
61
|
+
* and where remote applicants of a remote JobPosting must live. The Nuxt module applies it to a page's JSON-LD, so
|
|
62
|
+
* `siteJsonLd` and `jobJsonLd` need no `country` (an explicit one wins). An empty `country` changes nothing.
|
|
63
|
+
*/
|
|
64
|
+
declare function withCountry<T>(node: T, country: string): T;
|
|
65
|
+
/** The schema.org types `organizationLd` writes. A page whose JSON-LD has a node of one of them is the site's organisation node. */
|
|
66
|
+
declare const ORGANIZATION_TYPES: readonly ["Organization", "LocalBusiness", "NGO"];
|
|
67
|
+
interface OrganizationLdInput {
|
|
68
|
+
name: string;
|
|
69
|
+
url: string;
|
|
70
|
+
/** `Organization` (default), `LocalBusiness` for a shop or practice, `NGO` for a nonprofit. */
|
|
71
|
+
type?: (typeof ORGANIZATION_TYPES)[number];
|
|
72
|
+
legalName?: string;
|
|
73
|
+
/** Absolute URL of the logo. */
|
|
74
|
+
logo?: string;
|
|
75
|
+
email?: string;
|
|
76
|
+
telephone?: string;
|
|
77
|
+
address?: {
|
|
78
|
+
street?: string;
|
|
79
|
+
postalCode?: string;
|
|
80
|
+
city?: string;
|
|
81
|
+
country?: string;
|
|
82
|
+
};
|
|
83
|
+
vatID?: string;
|
|
84
|
+
/** Absolute URLs of the organisation's profiles elsewhere. */
|
|
85
|
+
sameAs?: string[];
|
|
86
|
+
}
|
|
87
|
+
declare function organizationLd(o: OrganizationLdInput): Record<string, unknown>;
|
|
88
|
+
/**
|
|
89
|
+
* A schema.org BreadcrumbList from the first step (usually the home page) to the page itself. Each step has a `title`
|
|
90
|
+
* and a `path` of the site, as the nodes of `useGinkoBreadcrumbs` do; `siteUrl` (`useGinkoSite().url`) makes the
|
|
91
|
+
* paths absolute.
|
|
92
|
+
*/
|
|
93
|
+
declare function breadcrumbJsonLd(steps: readonly Pick<NavNode, 'title' | 'path'>[], siteUrl: string): Record<string, unknown>;
|
|
94
|
+
interface ArticleLdInput {
|
|
95
|
+
/** `Article` (default) or `BlogPosting` for a post of a blog. */
|
|
96
|
+
type?: 'Article' | 'BlogPosting';
|
|
97
|
+
title: string;
|
|
98
|
+
url: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
image?: string;
|
|
101
|
+
published?: string;
|
|
102
|
+
modified?: string;
|
|
103
|
+
/** One author by name, or a list of authors with an optional website each. */
|
|
104
|
+
author?: string | readonly {
|
|
105
|
+
name: string;
|
|
106
|
+
url?: string;
|
|
107
|
+
}[];
|
|
108
|
+
keywords?: readonly string[];
|
|
109
|
+
lang: string;
|
|
110
|
+
}
|
|
111
|
+
declare function articleLd(o: ArticleLdInput): Record<string, unknown>;
|
|
112
|
+
declare function faqLd(pairs: {
|
|
113
|
+
question: string;
|
|
114
|
+
answer: string;
|
|
115
|
+
}[]): Record<string, unknown>;
|
|
116
|
+
/**
|
|
117
|
+
* Headers every response of a Ginko site carries. Only the platform may frame `/__ginko` (the preview); nothing
|
|
118
|
+
* else is framed. `nosniff` stops a browser from reading user text (`.md`, `llms.txt`, JSON) as HTML, and the
|
|
119
|
+
* referrer policy keeps full URLs from leaving the site.
|
|
120
|
+
*/
|
|
121
|
+
declare function siteHeaders(input: {
|
|
122
|
+
preview: boolean;
|
|
123
|
+
platformOrigin: string;
|
|
124
|
+
noindex: boolean;
|
|
125
|
+
}): Record<string, string>;
|
|
126
|
+
|
|
127
|
+
export { ORGANIZATION_TYPES as a, articleLd as d, breadcrumbJsonLd as e, breadcrumbs as f, faqLd as g, siteHeaders as h, isPreviewHost as i, withCountry as j, navTree as n, organizationLd as o, robotsTxt as r, seoHead as s, websiteLd as w };
|
|
128
|
+
export type { ArticleLdInput as A, NavNode as N, OrganizationLdInput as O, SeoHead as S, SeoImage as b, SeoInput as c };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const MB = 1024 * 1024;
|
|
2
|
+
const UPLOAD_TYPES = {
|
|
3
|
+
"image/jpeg": { label: "JPEG", kind: "image", limit: 20 * MB },
|
|
4
|
+
"image/png": { label: "PNG", kind: "image", limit: 20 * MB },
|
|
5
|
+
"image/webp": { label: "WebP", kind: "image", limit: 20 * MB },
|
|
6
|
+
"application/pdf": { label: "PDF", kind: "file", limit: 10 * MB }
|
|
7
|
+
};
|
|
8
|
+
function acceptOf(kind) {
|
|
9
|
+
return typesOf(kind).join(",");
|
|
10
|
+
}
|
|
11
|
+
function limitOf(kind) {
|
|
12
|
+
return Math.max(...typesOf(kind).map((type) => UPLOAD_TYPES[type].limit));
|
|
13
|
+
}
|
|
14
|
+
function formatMb(bytes) {
|
|
15
|
+
return `${roundedMb(bytes)}`.replace(".", ",");
|
|
16
|
+
}
|
|
17
|
+
function roundedMb(bytes) {
|
|
18
|
+
return Math.round(bytes / MB * 10) / 10;
|
|
19
|
+
}
|
|
20
|
+
function typesOf(kind) {
|
|
21
|
+
return Object.keys(UPLOAD_TYPES).filter((type) => UPLOAD_TYPES[type].kind === kind);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const CALENDAR_NAMES = ["AT", "DE", "SG", "none"];
|
|
25
|
+
const STORED_HOLIDAYS = [...CALENDAR_NAMES, "custom"];
|
|
26
|
+
const COUNTRY_CALENDARS = { AT: "AT", DE: "DE", SG: "SG" };
|
|
27
|
+
function calendarOfCountry(country) {
|
|
28
|
+
return Object.hasOwn(COUNTRY_CALENDARS, country) ? COUNTRY_CALENDARS[country] : void 0;
|
|
29
|
+
}
|
|
30
|
+
function holidaysOf(site) {
|
|
31
|
+
if (site.calendar !== void 0) return typeof site.calendar === "function" ? "custom" : site.calendar;
|
|
32
|
+
if (site.country !== void 0) return calendarOfCountry(site.country) ?? "none";
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { CALENDAR_NAMES as C, STORED_HOLIDAYS as S, UPLOAD_TYPES as U, acceptOf as a, calendarOfCountry as c, formatMb as f, holidaysOf as h, limitOf as l, roundedMb as r };
|