@escape-game-over/atlas 0.1.115 → 0.1.116
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/docs/NOT-BUILT.md +2 -2
- package/package.json +1 -1
- package/src/analytics/storage.ts +34 -39
- package/src/astro/images.ts +12 -26
- package/src/astro/index.ts +2 -9
- package/src/astro/public-files.ts +11 -52
- package/src/astro/site-routes.ts +11 -55
- package/src/config.ts +8 -17
- package/src/content/rich.ts +15 -18
- package/src/i18n/catalog.ts +20 -1
- package/src/i18n/define.ts +0 -5
- package/src/i18n/translate.ts +9 -48
- package/src/index.ts +23 -160
- package/src/jsonld/article.ts +7 -17
- package/src/jsonld/business.ts +27 -28
- package/src/jsonld/creative-work.ts +8 -20
- package/src/jsonld/node.ts +37 -7
- package/src/jsonld/organization.ts +21 -30
- package/src/jsonld/place.ts +2 -6
- package/src/jsonld/product.ts +16 -22
- package/src/jsonld/service.ts +21 -37
- package/src/jsonld/video.ts +4 -8
- package/src/jsonld/website.ts +3 -5
- package/src/meta/content.ts +14 -66
- package/src/meta/index.ts +10 -32
- package/src/project.ts +4 -18
- package/src/routes/define.ts +0 -13
- package/src/site/api.ts +1 -21
- package/src/site/create.ts +17 -26
- package/src/site/page.ts +1 -10
package/src/site/create.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { consentVendors } from "../analytics/index.ts";
|
|
|
2
2
|
import {
|
|
3
3
|
type LocaleMeta,
|
|
4
4
|
type LocalesOf,
|
|
5
|
-
|
|
5
|
+
resolveLocaleMeta,
|
|
6
6
|
type SiteConfigShape,
|
|
7
7
|
} from "../config.ts";
|
|
8
8
|
import {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
mergeCatalog,
|
|
22
22
|
type OverrideCatalog,
|
|
23
23
|
} from "../i18n/define.ts";
|
|
24
|
-
import {
|
|
24
|
+
import { createTranslate, type TranslateFor } from "../i18n/translate.ts";
|
|
25
25
|
import type { ImageAsset } from "../image.ts";
|
|
26
26
|
import { buildLlms, type LlmsItem, type LlmsSection } from "../llms.ts";
|
|
27
27
|
import {
|
|
@@ -43,11 +43,7 @@ import {
|
|
|
43
43
|
statusFor,
|
|
44
44
|
} from "../redirects.ts";
|
|
45
45
|
import { buildRobots, type RobotsGroup } from "../robots.ts";
|
|
46
|
-
import type {
|
|
47
|
-
OrphanSectionPrefixOf,
|
|
48
|
-
RouteRegistry,
|
|
49
|
-
SectionPrefixOf,
|
|
50
|
-
} from "../routes/define.ts";
|
|
46
|
+
import type { RouteRegistry, SectionPrefixOf } from "../routes/define.ts";
|
|
51
47
|
import {
|
|
52
48
|
buildPath,
|
|
53
49
|
listRouteEntries,
|
|
@@ -122,8 +118,7 @@ export function createSite<
|
|
|
122
118
|
Published,
|
|
123
119
|
MessagesOf<Cat>,
|
|
124
120
|
ProjectRouteId<Routes, P>,
|
|
125
|
-
SectionPrefixOf<Routes, P["overrideRoutes"]
|
|
126
|
-
OrphanSectionPrefixOf<Routes, P["overrideRoutes"]>
|
|
121
|
+
SectionPrefixOf<Routes, P["overrideRoutes"]>
|
|
127
122
|
> {
|
|
128
123
|
// The locales this *project* publishes, from its catalog, not the
|
|
129
124
|
// universe the site config declares: `pathFor("home", "el-GR")` must not
|
|
@@ -171,10 +166,10 @@ export function createSite<
|
|
|
171
166
|
// narrowing inside the closures below, which a property access would not.
|
|
172
167
|
const siteUrl = project.url;
|
|
173
168
|
|
|
174
|
-
const localeMeta =
|
|
169
|
+
const localeMeta = resolveLocaleMeta<L>(
|
|
175
170
|
config_.locales as Readonly<Record<L, LocaleMeta>>,
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
locales,
|
|
172
|
+
catalog.labels
|
|
178
173
|
);
|
|
179
174
|
const fonts = mergeFonts(config_.defaultFonts, project.overrideFonts);
|
|
180
175
|
const pathContext: PathContext<L> = {
|
|
@@ -205,7 +200,6 @@ export function createSite<
|
|
|
205
200
|
catalog.override,
|
|
206
201
|
catalog.add
|
|
207
202
|
);
|
|
208
|
-
const translateFactory = createTranslateFactory<Full, L>();
|
|
209
203
|
|
|
210
204
|
const resolved = mergeRoutes<L, Routes>(routes, project.overrideRoutes);
|
|
211
205
|
|
|
@@ -283,9 +277,7 @@ export function createSite<
|
|
|
283
277
|
* Three callers, and two of them want one string out of it: `robots()` and
|
|
284
278
|
* `llms()` each advertise `entry.url`, so an unmemoised call derived every
|
|
285
279
|
* URL on the site — each with its alternates, each joined to the origin —
|
|
286
|
-
* three times over to answer a question about a filename.
|
|
287
|
-
* then does the whole thing again on every dev-server request that hits a
|
|
288
|
-
* generated file.
|
|
280
|
+
* three times over to answer a question about a filename.
|
|
289
281
|
*
|
|
290
282
|
* Safe to hold because everything it reads is settled before this closure
|
|
291
283
|
* exists: `entries`, `localeMeta` and the origin are fixed for the life of
|
|
@@ -783,17 +775,11 @@ export function createSite<
|
|
|
783
775
|
options.sectionHeading?.(parent, locale) ??
|
|
784
776
|
(owner === undefined ? parent : describe(owner, locale).name);
|
|
785
777
|
|
|
786
|
-
//
|
|
787
|
-
//
|
|
788
|
-
// nowhere else — and the heading is then left unlinked rather than
|
|
789
|
-
// pointed at a URL this build never wrote.
|
|
790
|
-
const target = owner ?? options.sectionLink?.(parent, locale);
|
|
791
|
-
|
|
778
|
+
// Linked to the owning page; a section with none, a family with no
|
|
779
|
+
// index page, is left unlinked rather than pointed somewhere else.
|
|
792
780
|
sections.push({
|
|
793
781
|
heading,
|
|
794
|
-
...(
|
|
795
|
-
? {}
|
|
796
|
-
: { url: urlFor(target, locale) }),
|
|
782
|
+
...(owner === undefined ? {} : { url: urlFor(owner, locale) }),
|
|
797
783
|
items: members.map(item),
|
|
798
784
|
});
|
|
799
785
|
}
|
|
@@ -888,7 +874,12 @@ export function createSite<
|
|
|
888
874
|
translate: <const Values extends string = never>(
|
|
889
875
|
locale: L,
|
|
890
876
|
bind?: { readonly values?: Readonly<Record<Values, string>> }
|
|
891
|
-
)
|
|
877
|
+
): TranslateFor<Full, Values> =>
|
|
878
|
+
createTranslate({
|
|
879
|
+
catalog: messages,
|
|
880
|
+
locale,
|
|
881
|
+
values: bind?.values,
|
|
882
|
+
}),
|
|
892
883
|
rich: <
|
|
893
884
|
const Links extends string = never,
|
|
894
885
|
const Values extends string = never,
|
package/src/site/page.ts
CHANGED
|
@@ -89,16 +89,7 @@ export interface PageMeta {
|
|
|
89
89
|
* the trail and had to be handed ids this project actually builds. The trail
|
|
90
90
|
* now arrives finished, so nothing here mentions a route.
|
|
91
91
|
*/
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* The two things a document cannot answer about itself.
|
|
96
|
-
*
|
|
97
|
-
* Split out because `MetaContent` is an intersection with a union — an
|
|
98
|
-
* interface cannot extend one — and the union is what stops a page being both
|
|
99
|
-
* an article and something else.
|
|
100
|
-
*/
|
|
101
|
-
interface PageExtras {
|
|
92
|
+
export interface PageContent extends MetaContent {
|
|
102
93
|
/**
|
|
103
94
|
* Which page of a paginated list this is, from 1.
|
|
104
95
|
*
|