@nakedcreativity/cee-ms-node 2.0.0-beta.5 → 2.0.0-beta.9

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 CHANGED
@@ -9,7 +9,7 @@ import { CacheSource, Ceems } from '@nakedcreativity/cee-ms-node';
9
9
  const ceems = new Ceems({
10
10
  assets: './src',
11
11
  cacheSource: CacheSource.S3,
12
- cacheBucket: 'my-site',
12
+ cacheBucket: 'my-site-bucket',
13
13
  viewsPath: './views/',
14
14
  customHandler: true,
15
15
  tags: [],
@@ -38,9 +38,18 @@ Link settings read as their address, like links in modules (`{{ settings.cta.kin
38
38
  the settings as edited; the published site shows them once they are published. A static global named `settings` in
39
39
  `config.globals` takes precedence, so a site that already uses that name keeps working.
40
40
 
41
- Published files are read from `ceems/` in the bucket or folder (`ceems/pages/site.json`, `ceems/pages/<id>.json`,
42
- and `ceems/data/<id>.json` through `loadS3File('data/<id>.json')`), where Cee.ms 2 publishes them. That lets it
43
- publish to the same bucket as Cee.ms 1 while a site moves over. Set `cachePrefix: ''` to read from the top instead.
41
+ ## Reading the published site
42
+
43
+ Cee.ms publishes each environment to its own folder in the site's bucket: `<environment>/pages/site.json`,
44
+ `<environment>/pages/<id>.json` and `<environment>/data/<id>.json` (read through `loadS3File('data/<id>.json')`).
45
+ The bucket is private, in the site owner's AWS account. `CacheSource.S3` reads it (`cacheBucket`, `cacheRegion`)
46
+ with the host's own AWS credentials: a Lambda or container role, OIDC from the host, or keys, as the site chooses. It
47
+ needs `s3:GetObject` on `<bucket>/*/pages/*` and `<bucket>/*/data/*`; Cee.ms's Settings → Storage screen shows the
48
+ statement. Set `CEEMS_ENVIRONMENT` (or `config.environment`) to the environment this server renders, such as
49
+ `live`; it defaults to `development`.
50
+
51
+ `CacheSource.Local` reads a folder (`cacheFolder`) laid out like the bucket. Set `cachePrefix` to read from somewhere
52
+ other than `<environment>/`.
44
53
 
45
54
  ## Structured data
46
55
 
@@ -58,15 +67,15 @@ It outputs the types the page has switched on in its settings, or the site's def
58
67
  page, blog or article), plus a node for the page's **entity**: what the page is about. Each is built from data
59
68
  Cee.ms already has:
60
69
 
61
- | Type | From |
62
- |---|---|
63
- | `website` (WebSite) | the site's name and URL |
64
- | `organisation` (Organization, or a business type such as RealEstateAgent) | the organisation on the Settings screen |
65
- | `webpage` (WebPage) | the page's SEO title, description and social image |
66
- | `breadcrumb` (BreadcrumbList) | home and the page's published ancestors |
67
- | `article` (BlogPosting) | an article's title, description, image, date and tags |
68
- | `faq` (FAQPage) | the questions in the page's modules whose type maps them |
69
- | `entity` (Product, Event, Person or Service) | the page's entity and the details entered for it |
70
+ | Type | From |
71
+ | ------------------------------------------------------------------------- | -------------------------------------------------------- |
72
+ | `website` (WebSite) | the site's name and URL |
73
+ | `organisation` (Organization, or a business type such as RealEstateAgent) | the organisation on the Settings screen |
74
+ | `webpage` (WebPage) | the page's SEO title, description and social image |
75
+ | `breadcrumb` (BreadcrumbList) | home and the page's published ancestors |
76
+ | `article` (BlogPosting) | an article's title, description, image, date and tags |
77
+ | `faq` (FAQPage) | the questions in the page's modules whose type maps them |
78
+ | `entity` (Product, Event, Person or Service) | the page's entity and the details entered for it |
70
79
 
71
80
  By default the site and organisation are described in full on the home page, and other pages refer to them with a
72
81
  short copy (name, URL, logo). A product or event page also gets the reviews in its modules whose type maps them,
@@ -77,12 +86,76 @@ A node missing what it needs (an event with no start date, a product with neithe
77
86
  rather than output invalid, and the tag outputs nothing when no node has data. Name parts to output only those, to
78
87
  place them separately: `{% structureddata 'article' 'faq' %}`, `{% structureddata 'entity' %}`.
79
88
 
80
- The entity is also in templates and modules as `page.entity` (`HOME`, `PAGE`, `PRODUCT`, `EVENT`, `PERSON` or
81
- `SERVICE`), e.g. `{% if page.entity == 'PRODUCT' %}`.
89
+ The entity is also in templates and modules as `page.entity` (`HOME`, `PAGE`, `ARTICLE`, `PERSON`, `PRODUCT`,
90
+ `EVENT` or `SERVICE`), e.g. `{% if page.entity == 'PRODUCT' %}`. A blog's articles are `ARTICLE` unless they choose
91
+ otherwise, and any other page can be one: an article uses the site's article defaults and has authors.
92
+
93
+ ## Link previews
94
+
95
+ Facebook, LinkedIn, WhatsApp, Slack and X don't read JSON-LD: they build link previews from Open Graph `<meta>`
96
+ tags. `{% socialmeta %}` outputs them from the same page data, so put it beside `{% structureddata %}`:
97
+
98
+ ```liquid
99
+ <head>
100
+ {% structureddata %}
101
+ {% socialmeta %}
102
+ </head>
103
+ ```
104
+
105
+ | Tag | From |
106
+ | ---------------------------------------------------------- | ------------------------------------------------------------ |
107
+ | `og:title`, `og:description` | the page's SEO title (else its name) and description |
108
+ | `og:url`, `og:site_name` | the site's URL and name |
109
+ | `og:image` (with its width, height and alt) | the page's social image |
110
+ | `og:type` | `article` for articles, `profile` for people, else `website` |
111
+ | `article:published_time`, `modified_time`, `tag`, `author` | an article's dates, tags and authors' profile pages |
112
+ | `twitter:card` | a large image card with a social image, else a small one |
113
+ | `twitter:site` | the organisation's X profile, among its profile links |
114
+
115
+ X reads the title, description and image from Open Graph, so they aren't repeated. Tags without data are left
116
+ out.
82
117
 
83
118
  The organisation is also in templates as `site.organisation`, e.g. `{{ site.organisation.telephone }}`. For custom
84
119
  tags or routes, `structuredDataGraph(site, page)` returns the graph as an object.
85
120
 
121
+ People feed the structured data too. A page whose entity is `PERSON` and that has its person chosen becomes a
122
+ `ProfilePage`, describing them in full. An article's byline becomes its `author`, with the organisation still the
123
+ publisher, and its reviewer becomes `reviewedBy`. People that a module features through a module type's people
124
+ mapping each get a `Person` node. A person has the same `@id` on every page: their profile page's, or, without one,
125
+ one of the site's.
126
+
127
+ ## Links, documents and rows
128
+
129
+ Links, documents and rows are read from what is published as the page renders, so a renamed page or a replaced
130
+ document is right on every page once that one change is published:
131
+
132
+ - **Page links** take their address from `site.json` `pageIndex`. A link to a page that isn't published reads as
133
+ `''` and has `broken` set, so `{% if link %}` leaves it out. Rich text links to it lose their `href`.
134
+ - **Document values and links** take their address from `site.json` `documents`. A document value prints as its
135
+ address, and keeps `url`, `thumbnail` and `info`: `{{ download }}`, `{{ download.url }}`.
136
+ - **Row fields** read as the row they point at, with its columns: `{{ author.name }}`,
137
+ `{% image person.photo 'square' %}`. A row prints as its `name`. Rows come from the collection's
138
+ `data/<id>.json`, which is read once and kept until `site.json` changes. A deleted row reads as nothing and is
139
+ left out of lists.
140
+
141
+ A site last published before Cee.ms published `pageIndex` keeps the addresses stored with its links, as before.
142
+
143
+ ## People and bylines
144
+
145
+ A site's People (name, job title, photo, bio, profile links, email, telephone, profile page) is published in
146
+ `site.json` `people`. An article's byline is `page.authors`, in order. Each author has a `kind` (`person`, `guest`
147
+ or `organisation`), a `name` and a `url`: a person's profile page, else their first profile link. A person
148
+ author also has all their People columns:
149
+
150
+ ```liquid
151
+ {% for author in page.authors %}
152
+ <a href="{{ author.url }}">{{ author.name }}</a>{% if author.jobTitle %}, {{ author.jobTitle }}{% endif %}
153
+ {% endfor %}
154
+ ```
155
+
156
+ On a profile page, `page.person` is the person. `{% blog news articles 10 author:page.person %}` lists the
157
+ articles they appear in the byline of. With none yet, the list is empty, not a 404.
158
+
86
159
  ## Draft previews
87
160
 
88
161
  The editor loads `GET /draft/{pageId}?token=…` in an iframe. The renderer verifies the token, fetches the draft from
@@ -105,6 +178,54 @@ Optional:
105
178
  Draft responses send `Cache-Control: no-store`, `X-Robots-Tag: noindex`, `frame-ancestors <editor origin>` and
106
179
  `Referrer-Policy: no-referrer` (the token is in the URL).
107
180
 
181
+ ## Views and the editor
182
+
183
+ A view is named by its file name alone: a module of type `text` renders `text.liquid`, a page from a template
184
+ with the layout `default` renders `default.liquid`. Views can be grouped in folders, which also tell the editor
185
+ what each one is:
186
+
187
+ ```
188
+ views/
189
+ layouts/default.liquid templates: each {% region %} is somewhere modules go
190
+ modules/text.liquid module types: the values they print are their fields
191
+ partials/nav.liquid everything else (navigation, includes)
192
+ ```
193
+
194
+ Names are looked up in `views/`, then `layouts/`, `modules/` and `partials/`, so a site with every view at the
195
+ top of `views/` works as before.
196
+
197
+ When the preview secret is set, `GET /ceems/views?token=…` lists the views for the Cee.ms editor, which
198
+ suggests templates and module types from them: their regions, and for modules the values they read and how (an
199
+ image, a date, a link, a list of items). Run it again from the editor as the site grows. The token is one the
200
+ editor signs for this purpose, and only that editor may read the response, from the browser: that is how it
201
+ reaches a site running on `localhost` (the route answers Chrome's private network preflight). Without folders,
202
+ a view with a `{% region %}` is taken to be a layout, and the rest modules.
203
+
204
+ The guesses can be overridden in a comment at the top of a view:
205
+
206
+ ```liquid
207
+ {% comment %}
208
+ @name Team members
209
+ @field intro RICH_TEXT Introduction
210
+ @field people.photo IMAGE Photo
211
+ {% endcomment %}
212
+ ```
213
+
214
+ `@field <key> <kind> [label]` sets a field's kind (`TEXT`, `TEXTBOX`, `RICH_TEXT`, `SELECT`, `CHECKBOX`, `DATE`,
215
+ `IMAGE`, `DOCUMENT`, `LINK` or `CONTRIBUTOR`) and label; `people.photo` is the `photo` of each item looped over
216
+ in `people`. `scanViews(viewsPath)` returns the same list, for scripts.
217
+
218
+ ## Upgrading to 2.0.0-beta.8
219
+
220
+ - **Views in folders** (`layouts/`, `modules/`, `partials/`), and **`GET /ceems/views`** for the editor's view
221
+ sync (above). Sites with flat views are unchanged.
222
+
223
+ ## Upgrading to 2.0.0-beta.6
224
+
225
+ Upgrade the Cee.ms API first. Drafts now ask it for the data a page's rows come from, which earlier versions of
226
+ the API don't send. Before adding `row` fields to a site's module types, move the site to this version of the
227
+ package: older versions print a row reference as an object.
228
+
108
229
  ## Upgrading a site from 1.x
109
230
 
110
231
  2.0 ships with Cee.ms v2. Upgrade a site when it moves to v2: the 1.x `POST /draft` that the old editor uses is gone.
package/lib/draft.js CHANGED
@@ -37,7 +37,7 @@ exports.draftServiceFor = draftServiceFor;
37
37
  const links_1 = require("./links");
38
38
  const cheerio = __importStar(require("cheerio"));
39
39
  const preview_token_1 = require("./preview-token");
40
- const DRAFT_QUERY = 'query Draft($token: String!) { draftRenderPayload(token: $token) { page site } }';
40
+ const DRAFT_QUERY = 'query Draft($token: String!) { draftRenderPayload(token: $token) { page site data } }';
41
41
  /** The origin of an http(s) URL, or undefined. */
42
42
  function originOf(url) {
43
43
  if (!url)
@@ -99,9 +99,14 @@ function draftServiceFor(config = {}) {
99
99
  return { ok: false, status: 502 };
100
100
  }
101
101
  const site = JSON.parse(payload.site);
102
+ // links resolve against the draft site, and rows against the draft's data as it is now
103
+ const data = payload.data ? JSON.parse(payload.data) : {};
104
+ const context = (0, links_1.linkContextFor)(site, Object.values(data));
102
105
  if (site.settings)
103
- site.settings = (0, links_1.wrapLinks)(site.settings);
104
- return { ok: true, page: (0, links_1.wrapLinks)(JSON.parse(payload.page)), site, editorOrigin };
106
+ site.settings = (0, links_1.wrapLinks)(site.settings, context);
107
+ const page = (0, links_1.wrapLinks)(JSON.parse(payload.page), context);
108
+ page.authors = (0, links_1.bylineAuthors)(page, site, context);
109
+ return { ok: true, page, site, editorOrigin };
105
110
  },
106
111
  setHeaders(res, editorOrigin) {
107
112
  res.set({
package/lib/draft.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"draft.js","sourceRoot":"","sources":["../src/draft.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,0CA+DC;AAtGD,mCAAoC;AAEpC,iDAAmC;AAEnC,mDAAqD;AAYrD,MAAM,WAAW,GAAG,kFAAkF,CAAC;AAEvG,kDAAkD;AAClD,SAAS,QAAQ,CAAC,GAAuB;IACrC,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACnG,CAAC;IA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AClD,CAAC;QAED,UAAU,CAAC,GAAG,EAAE,YAAY;YACxB,GAAG,CAAC,GAAG,CAAC;gBACJ,eAAe,EAAE,UAAU;gBAC3B,cAAc,EAAE,mBAAmB;gBACnC,yBAAyB,EAAE,mBAAmB,YAAY,IAAI,cAAc,IAAI,QAAQ,EAAE;gBAC1F,4EAA4E;gBAC5E,iBAAiB,EAAE,aAAa;gBAChC,wBAAwB,EAAE,SAAS;aACtC,CAAC,CAAC;QACP,CAAC;QAED,YAAY,CAAC,IAAI,EAAE,YAAY;YAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YAClC,MAAM,MAAM,GAAG,CAAC,CAAC,yBAAyB,CAAC;iBACtC,IAAI,CAAC,KAAK,EAAE,SAAS,IAAI,GAAG,YAAY,YAAY,CAAC;iBACrD,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;YAC9C,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACzB,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;KACJ,CAAC;AACN,CAAC"}
package/lib/index.d.ts CHANGED
@@ -5,9 +5,13 @@ import { Storage } from './storage';
5
5
  export * from './interfaces';
6
6
  export { signPreviewToken, verifyPreviewToken } from './preview-token';
7
7
  export { renderState } from './state';
8
- export { LinkDrop, wrapLinks } from './links';
8
+ export { DocumentDrop, LinkDrop, RowDrop, linkContextFor, wrapLinks } from './links';
9
+ export type { LinkContext } from './links';
9
10
  export { enabledTypes, entityOf, serialiseJsonLd, structuredDataGraph } from './structured-data';
11
+ export { socialMeta, renderSocialMeta, SocialMetaTag } from './social-meta';
10
12
  export type { StructuredDataPart } from './structured-data';
13
+ export { VIEW_FOLDERS, VIEWS_TOKEN_SUBJECT, scanViews, viewRoots } from './views';
14
+ export type { ScanOptions, ViewHint, ViewInfo, ViewManifest, ViewVariable } from './views';
11
15
  /**
12
16
  * A Cee.ms site renderer: an Express app that renders published pages, and verified editor drafts, with the
13
17
  * site's Liquid templates.
@@ -23,10 +27,23 @@ export declare class Ceems {
23
27
  site: CeemsSite | undefined;
24
28
  storage: Storage;
25
29
  private drafts;
30
+ /** The `site.json` the data file cache was filled for: publishing rewrites it, which empties the cache. */
31
+ private siteSource;
32
+ private dataFiles;
26
33
  constructor(config: CeemsConfig);
34
+ private storageFor;
27
35
  private registerTags;
28
36
  /** Loads the published `site.json`, remembers it as `this.site`, and returns it. */
29
37
  loadSite(): Promise<CeemsSite>;
38
+ /** A published data file, read once until the site is next published. `null` if it isn't published. */
39
+ private dataFile;
40
+ /**
41
+ * What a page's references resolve against: the site's pages and documents, and the rows of the data
42
+ * collections it points at, and of those their rows point at.
43
+ */
44
+ private linkContext;
45
+ /** Wraps a page's references (see `wrapLinks`) and adds its byline as `page.authors`. */
46
+ private resolvePage;
30
47
  /**
31
48
  * Loads the published page for the request's path (or the `404` page), ready for `render`. With
32
49
  * `loadPage` false, returns `page` as given (for custom routes that build their own page object).
@@ -34,8 +51,11 @@ export declare class Ceems {
34
51
  load(req: CeemsRequest, res: express.Response, loadPage?: boolean, page?: CeemsPage): Promise<CeemsPage>;
35
52
  /** Reads a published file, under `cachePrefix`. */
36
53
  private readPublished;
37
- /** Reads `pages/<id>.json`. Stored links read as their address in templates (see `LinkDrop`). */
38
- loadPageFile(id: string): Promise<CeemsPage>;
54
+ /**
55
+ * Reads `pages/<id>.json`. Stored links read as their address in templates (see `LinkDrop`), resolved
56
+ * against `site` (by default the last site loaded), and row references read as their rows (`RowDrop`).
57
+ */
58
+ loadPageFile(id: string, site?: CeemsSite | undefined): Promise<CeemsPage>;
39
59
  /** Synchronous local read, kept for custom tags. `filename` is a full path. */
40
60
  loadLocalFile(filename: string): any;
41
61
  /**
package/lib/index.js CHANGED
@@ -39,9 +39,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.Ceems = exports.structuredDataGraph = exports.serialiseJsonLd = exports.entityOf = exports.enabledTypes = exports.wrapLinks = exports.LinkDrop = exports.renderState = exports.verifyPreviewToken = exports.signPreviewToken = void 0;
42
+ exports.Ceems = exports.viewRoots = exports.scanViews = exports.VIEWS_TOKEN_SUBJECT = exports.VIEW_FOLDERS = exports.renderSocialMeta = exports.socialMeta = exports.structuredDataGraph = exports.serialiseJsonLd = exports.entityOf = exports.enabledTypes = exports.wrapLinks = exports.linkContextFor = exports.RowDrop = exports.LinkDrop = exports.DocumentDrop = exports.renderState = exports.verifyPreviewToken = exports.signPreviewToken = void 0;
43
43
  const express_1 = __importDefault(require("express"));
44
- const path_1 = __importDefault(require("path"));
45
44
  const fs_1 = __importDefault(require("fs"));
46
45
  const liquidjs_1 = require("liquidjs");
47
46
  const links_1 = require("./links");
@@ -52,6 +51,7 @@ const interfaces_1 = require("./interfaces");
52
51
  const storage_1 = require("./storage");
53
52
  const state_1 = require("./state");
54
53
  const draft_1 = require("./draft");
54
+ const views_1 = require("./views");
55
55
  __exportStar(require("./interfaces"), exports);
56
56
  var preview_token_1 = require("./preview-token");
57
57
  Object.defineProperty(exports, "signPreviewToken", { enumerable: true, get: function () { return preview_token_1.signPreviewToken; } });
@@ -59,13 +59,24 @@ Object.defineProperty(exports, "verifyPreviewToken", { enumerable: true, get: fu
59
59
  var state_2 = require("./state");
60
60
  Object.defineProperty(exports, "renderState", { enumerable: true, get: function () { return state_2.renderState; } });
61
61
  var links_2 = require("./links");
62
+ Object.defineProperty(exports, "DocumentDrop", { enumerable: true, get: function () { return links_2.DocumentDrop; } });
62
63
  Object.defineProperty(exports, "LinkDrop", { enumerable: true, get: function () { return links_2.LinkDrop; } });
64
+ Object.defineProperty(exports, "RowDrop", { enumerable: true, get: function () { return links_2.RowDrop; } });
65
+ Object.defineProperty(exports, "linkContextFor", { enumerable: true, get: function () { return links_2.linkContextFor; } });
63
66
  Object.defineProperty(exports, "wrapLinks", { enumerable: true, get: function () { return links_2.wrapLinks; } });
64
67
  var structured_data_1 = require("./structured-data");
65
68
  Object.defineProperty(exports, "enabledTypes", { enumerable: true, get: function () { return structured_data_1.enabledTypes; } });
66
69
  Object.defineProperty(exports, "entityOf", { enumerable: true, get: function () { return structured_data_1.entityOf; } });
67
70
  Object.defineProperty(exports, "serialiseJsonLd", { enumerable: true, get: function () { return structured_data_1.serialiseJsonLd; } });
68
71
  Object.defineProperty(exports, "structuredDataGraph", { enumerable: true, get: function () { return structured_data_1.structuredDataGraph; } });
72
+ var social_meta_1 = require("./social-meta");
73
+ Object.defineProperty(exports, "socialMeta", { enumerable: true, get: function () { return social_meta_1.socialMeta; } });
74
+ Object.defineProperty(exports, "renderSocialMeta", { enumerable: true, get: function () { return social_meta_1.renderSocialMeta; } });
75
+ var views_2 = require("./views");
76
+ Object.defineProperty(exports, "VIEW_FOLDERS", { enumerable: true, get: function () { return views_2.VIEW_FOLDERS; } });
77
+ Object.defineProperty(exports, "VIEWS_TOKEN_SUBJECT", { enumerable: true, get: function () { return views_2.VIEWS_TOKEN_SUBJECT; } });
78
+ Object.defineProperty(exports, "scanViews", { enumerable: true, get: function () { return views_2.scanViews; } });
79
+ Object.defineProperty(exports, "viewRoots", { enumerable: true, get: function () { return views_2.viewRoots; } });
69
80
  /**
70
81
  * A Cee.ms site renderer: an Express app that renders published pages, and verified editor drafts, with the
71
82
  * site's Liquid templates.
@@ -81,6 +92,9 @@ class Ceems {
81
92
  site;
82
93
  storage;
83
94
  drafts;
95
+ /** The `site.json` the data file cache was filled for: publishing rewrites it, which empties the cache. */
96
+ siteSource;
97
+ dataFiles = new Map();
84
98
  constructor(config) {
85
99
  this.config = config;
86
100
  // set defaults
@@ -91,20 +105,20 @@ class Ceems {
91
105
  this.config.viewsPath = './views/';
92
106
  }
93
107
  if (this.config.cachePrefix === undefined) {
94
- this.config.cachePrefix = 'ceems/';
108
+ const environment = this.config.environment || process.env.CEEMS_ENVIRONMENT || 'development';
109
+ this.config.cachePrefix = environment + '/';
95
110
  }
96
111
  if (this.config.liquidCache === undefined) {
97
112
  this.config.liquidCache = true;
98
113
  }
99
114
  this.config.tags = this.config.tags || [];
100
115
  this.config.filters = this.config.filters || [];
101
- this.storage =
102
- this.config.cacheSource === interfaces_1.CacheSource.S3
103
- ? (0, storage_1.s3Storage)(this.config.cacheBucket || '', this.config.cacheRegion || process.env.AWS_REGION)
104
- : (0, storage_1.localStorage)(this.config.cacheFolder || './');
116
+ this.storage = this.storageFor(this.config);
105
117
  // One engine for the life of the process. Site data is passed per render, never through these options.
118
+ // Views can be grouped in `layouts/`, `modules/` and `partials/`, still named by file name alone.
119
+ const roots = (0, views_1.viewRoots)(this.config.viewsPath);
106
120
  this.engine = new liquidjs_1.Liquid({
107
- root: path_1.default.resolve(this.config.viewsPath),
121
+ root: roots,
108
122
  extname: '.liquid',
109
123
  cache: this.config.liquidCache,
110
124
  jsTruthy: true,
@@ -114,7 +128,7 @@ class Ceems {
114
128
  this.app = (0, express_1.default)();
115
129
  this.app.set('case sensitive routing', true);
116
130
  this.app.engine('liquid', this.engine.express());
117
- this.app.set('views', this.config.viewsPath);
131
+ this.app.set('views', roots);
118
132
  this.app.set('view engine', 'liquid');
119
133
  this.app.use(express_1.default.static(this.config.assets));
120
134
  this.app.use(express_1.default.json({ limit: this.config.parseLimit || '250kb' }));
@@ -122,6 +136,15 @@ class Ceems {
122
136
  // Drafts are registered before the published-site middleware: they never read or replace `this.site`.
123
137
  this.drafts = (0, draft_1.draftServiceFor)(this.config.preview);
124
138
  this.app.get('/draft/:pageId', (req, res) => this.handleDraft(req, res));
139
+ // The views' manifest, for the editor to suggest templates and module types from. Also before the
140
+ // published site: a new site has nothing published yet.
141
+ const views = {
142
+ secret: this.config.preview?.secret || process.env.CEEMS_PREVIEW_SECRET,
143
+ viewsPath: this.config.viewsPath,
144
+ globals: Object.keys(this.config.globals || {}),
145
+ };
146
+ this.app.options('/ceems/views', (0, views_1.viewsPreflightHandler)());
147
+ this.app.get('/ceems/views', (0, views_1.viewsHandler)(views));
125
148
  // load the published site map for every page request
126
149
  this.app.use((req, res, next) => {
127
150
  this.loadSite().then((site) => {
@@ -145,6 +168,12 @@ class Ceems {
145
168
  });
146
169
  }
147
170
  }
171
+ storageFor(config) {
172
+ if (config.cacheSource === interfaces_1.CacheSource.S3) {
173
+ return (0, storage_1.s3Storage)(config.cacheBucket || '', config.cacheRegion || process.env.AWS_REGION);
174
+ }
175
+ return (0, storage_1.localStorage)(config.cacheFolder || './');
176
+ }
148
177
  registerTags() {
149
178
  (0, tags_1.registerRegionTag)(this.engine);
150
179
  (0, tags_1.registerModuleTag)(this.engine);
@@ -155,6 +184,7 @@ class Ceems {
155
184
  (0, tags_1.registerImageUrlTag)(this.engine);
156
185
  (0, tags_1.registerBreadcrumbTag)(this.engine);
157
186
  (0, tags_1.registerStructuredDataTag)(this.engine);
187
+ (0, tags_1.registerSocialMetaTag)(this.engine);
158
188
  (0, filters_1.registerActiveFilter)(this.engine);
159
189
  (0, filters_1.registerSlugifyFilter)(this.engine);
160
190
  // custom tags and filters
@@ -167,13 +197,47 @@ class Ceems {
167
197
  }
168
198
  /** Loads the published `site.json`, remembers it as `this.site`, and returns it. */
169
199
  async loadSite() {
170
- const site = JSON.parse(await this.readPublished('pages/site.json'));
200
+ const source = await this.readPublished('pages/site.json');
201
+ if (source !== this.siteSource) {
202
+ this.dataFiles.clear();
203
+ this.siteSource = source;
204
+ }
205
+ const site = JSON.parse(source);
171
206
  // stored links in settings read as their address, as in pages
172
207
  if (site.settings)
173
- site.settings = (0, links_1.wrapLinks)(site.settings);
208
+ site.settings = (0, links_1.wrapLinks)(site.settings, (0, links_1.linkContextFor)(site));
174
209
  this.site = site;
175
210
  return site;
176
211
  }
212
+ /** A published data file, read once until the site is next published. `null` if it isn't published. */
213
+ dataFile(id) {
214
+ let file = this.dataFiles.get(id);
215
+ if (!file) {
216
+ file = this.readPublished('data/' + id + '.json').then((source) => JSON.parse(source), () => null);
217
+ this.dataFiles.set(id, file);
218
+ }
219
+ return file;
220
+ }
221
+ /**
222
+ * What a page's references resolve against: the site's pages and documents, and the rows of the data
223
+ * collections it points at, and of those their rows point at.
224
+ */
225
+ async linkContext(site, value) {
226
+ // collections whose referenced rows aren't all people from site.json
227
+ const needed = (rows, skip = new Set()) => [...rows].flatMap(([id, ids]) => skip.has(id) || [...ids].every((row) => site?.people?.[row]) ? [] : [id]);
228
+ const first = needed((0, links_1.referencedRows)(value));
229
+ let files = await Promise.all(first.map((id) => this.dataFile(id)));
230
+ const further = needed((0, links_1.referencedRows)([...files.map((file) => file?.rows), ...Object.values(site?.people ?? {})]), new Set(first));
231
+ if (further.length)
232
+ files = [...files, ...(await Promise.all(further.map((id) => this.dataFile(id))))];
233
+ return (0, links_1.linkContextFor)(site, files);
234
+ }
235
+ /** Wraps a page's references (see `wrapLinks`) and adds its byline as `page.authors`. */
236
+ resolvePage(page, site, context) {
237
+ const wrapped = (0, links_1.wrapLinks)(page, context);
238
+ wrapped.authors = (0, links_1.bylineAuthors)(wrapped, site, context);
239
+ return wrapped;
240
+ }
177
241
  /**
178
242
  * Loads the published page for the request's path (or the `404` page), ready for `render`. With
179
243
  * `loadPage` false, returns `page` as given (for custom routes that build their own page object).
@@ -184,7 +248,7 @@ class Ceems {
184
248
  const { path, pagination } = this.parsePath(req);
185
249
  const entry = site.pages[path];
186
250
  if (entry) {
187
- page = await this.loadPageFile(entry._id);
251
+ page = await this.loadPageFile(entry._id, site);
188
252
  page.fullpath = entry.url == 'home' ? '' : entry.url;
189
253
  page.path = page.fullpath.split('/');
190
254
  if (pagination)
@@ -194,7 +258,7 @@ class Ceems {
194
258
  res.status(404);
195
259
  const notFound = site.pages['404'];
196
260
  if (notFound) {
197
- page = await this.loadPageFile(notFound._id);
261
+ page = await this.loadPageFile(notFound._id, site);
198
262
  }
199
263
  }
200
264
  }
@@ -207,20 +271,28 @@ class Ceems {
207
271
  readPublished(key) {
208
272
  return this.storage.read(this.config.cachePrefix + key);
209
273
  }
210
- /** Reads `pages/<id>.json`. Stored links read as their address in templates (see `LinkDrop`). */
211
- async loadPageFile(id) {
212
- return (0, links_1.wrapLinks)(JSON.parse(await this.readPublished('pages/' + id + '.json')));
274
+ /**
275
+ * Reads `pages/<id>.json`. Stored links read as their address in templates (see `LinkDrop`), resolved
276
+ * against `site` (by default the last site loaded), and row references read as their rows (`RowDrop`).
277
+ */
278
+ async loadPageFile(id, site = this.site) {
279
+ const page = JSON.parse(await this.readPublished('pages/' + id + '.json'));
280
+ return this.resolvePage(page, site, await this.linkContext(site, page));
213
281
  }
214
282
  /** Synchronous local read, kept for custom tags. `filename` is a full path. */
215
283
  loadLocalFile(filename) {
216
- return (0, links_1.wrapLinks)(JSON.parse(fs_1.default.readFileSync(filename, 'utf8')));
284
+ return (0, links_1.wrapLinks)(JSON.parse(fs_1.default.readFileSync(filename, 'utf8')), {
285
+ pageIndex: this.site?.pageIndex,
286
+ documents: this.site?.documents,
287
+ });
217
288
  }
218
289
  /**
219
290
  * Reads and parses a published JSON file, kept for custom tags. `filename` is as published, such as
220
291
  * `data/<id>.json`; it is read under `cachePrefix`.
221
292
  */
222
293
  async loadS3File(filename) {
223
- return (0, links_1.wrapLinks)(JSON.parse(await this.readPublished(filename)));
294
+ const value = JSON.parse(await this.readPublished(filename));
295
+ return (0, links_1.wrapLinks)(value, await this.linkContext(this.site, value));
224
296
  }
225
297
  /** The site path for a request (`home` for `/`), and the blog page number if the URL ends in one. */
226
298
  parsePath(req) {
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,gDAAwB;AACxB,4CAAoB;AACpB,uCAAkC;AAClC,mCAAoC;AACpC,iDAAmC;A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