@marktiderman/genesis-sites 0.7.6 → 0.8.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 +74 -8
- package/SKILL.md +10 -0
- package/dist/assets/form-island.da6c662a73.js +51 -0
- package/dist/assets/{islands.33a445f34e.js → islands.83aaf5e0df.js} +1 -1
- package/dist/assets/sites-forms.bac9a6aafd.css +10 -0
- package/dist/assets/sites-forms.css +1 -1
- package/dist/assets/sites.323090ba26.css +2 -0
- package/dist/assets/sites.css +1 -1
- package/dist/assets.generated-YGLB7VKL.js +3 -0
- package/dist/{assets.generated-LLUGUUWZ.js.map → assets.generated-YGLB7VKL.js.map} +1 -1
- package/dist/blocks.js +2 -1
- package/dist/blocks.js.map +1 -1
- package/dist/{chunk-IU6AI75R.js → chunk-6CXTOPYI.js} +343 -158
- package/dist/chunk-6CXTOPYI.js.map +1 -0
- package/dist/{chunk-7E3YGYVH.js → chunk-FMQTSXJN.js} +26 -12
- package/dist/chunk-FMQTSXJN.js.map +1 -0
- package/dist/{chunk-SMJMXQ3T.js → chunk-I767PDBR.js} +260 -62
- package/dist/chunk-I767PDBR.js.map +1 -0
- package/dist/chunk-MXV2HOJO.js +19 -0
- package/dist/chunk-MXV2HOJO.js.map +1 -0
- package/dist/{chunk-KY4ALBVH.js → chunk-QE7KS2JS.js} +65 -7
- package/dist/chunk-QE7KS2JS.js.map +1 -0
- package/dist/{chunk-VJ4HOFBA.js → chunk-YAMQ2JKO.js} +20 -9
- package/dist/chunk-YAMQ2JKO.js.map +1 -0
- package/dist/editor.d.ts +22 -14
- package/dist/editor.js +701 -157
- package/dist/editor.js.map +1 -1
- package/dist/handler-J5BCH2VW.js +10 -0
- package/dist/{handler-UMGSZY33.js.map → handler-J5BCH2VW.js.map} +1 -1
- package/dist/import.d.ts +3 -3
- package/dist/index.d.ts +51 -10
- package/dist/index.js +3 -3
- package/dist/redirects-BNSD9MKa.d.ts +43 -0
- package/dist/{registry-BIijndsq.d.ts → registry-BPn-tDlL.d.ts} +75 -0
- package/dist/sections.d.ts +86 -4
- package/dist/sections.js +2 -2
- package/dist/{store-BImtGmoF.d.ts → store-B_GMH42V.d.ts} +2 -2
- package/dist/supabase.d.ts +4 -4
- package/dist/supabase.js +3 -3
- package/dist/{templates-kA-jrnWA.d.ts → templates-CFSSG1iU.d.ts} +2 -2
- package/dist/templates.d.ts +3 -3
- package/dist/{theme-Cg-inpk5.d.ts → theme-Dw42GDI_.d.ts} +1 -1
- package/dist/web.d.ts +21 -11
- package/dist/web.js +5 -5
- package/migrations/0003_genesis_sites_post_dates.sql +117 -0
- package/migrations/tests/0003_genesis_sites_post_dates.test.sql +76 -0
- package/package.json +8 -4
- package/dist/assets/form-island.defb8daccc.js +0 -51
- package/dist/assets/sites-forms.aff23b5617.css +0 -10
- package/dist/assets/sites.5b3f64c627.css +0 -2
- package/dist/assets.generated-LLUGUUWZ.js +0 -3
- package/dist/chunk-7E3YGYVH.js.map +0 -1
- package/dist/chunk-IU6AI75R.js.map +0 -1
- package/dist/chunk-KY4ALBVH.js.map +0 -1
- package/dist/chunk-RLYO6VVP.js +0 -19
- package/dist/chunk-RLYO6VVP.js.map +0 -1
- package/dist/chunk-SMJMXQ3T.js.map +0 -1
- package/dist/chunk-VJ4HOFBA.js.map +0 -1
- package/dist/handler-UMGSZY33.js +0 -10
package/README.md
CHANGED
|
@@ -102,13 +102,18 @@ export async function handle(request: Request) {
|
|
|
102
102
|
`handleSiteRequest` answers `GET` and `HEAD` and returns `null` for anything it
|
|
103
103
|
doesn't own: another method, a reserved path (`/api`, `/_server`, `/auth`, and
|
|
104
104
|
`/_gs`, where it serves its own assets), an unknown path (or the site's 404 page
|
|
105
|
-
with `unknownPath: "not-found"`), or a site that isn't published.
|
|
105
|
+
with `unknownPath: "not-found"`), or a site that isn't published. The 404 page
|
|
106
|
+
is the site's page at `/404` (`NOT_FOUND_PATH`), made in the editor's Page not
|
|
107
|
+
found section from `notFoundPageDoc()` and edited like any page; it answers 404
|
|
108
|
+
with `noindex` at every unknown address and at `/404` itself, and stays out of
|
|
109
|
+
the sitemap. A site without one shows a built-in "Page not found". In order, it
|
|
106
110
|
serves:
|
|
107
111
|
|
|
108
112
|
1. its own content-hashed assets under `/_gs/` (immutable);
|
|
109
113
|
2. `robots.txt` and `sitemap.xml`;
|
|
110
|
-
3. the site's redirects, then a 308 to the one address of a page
|
|
111
|
-
trailing slash)
|
|
114
|
+
3. the site's exact redirects, then a 308 to the one address of a page
|
|
115
|
+
(lowercase, no trailing slash), then, where no page or post is, its prefix
|
|
116
|
+
redirects;
|
|
112
117
|
4. the page: streamed HTML from `renderToReadableStream`, with no hydration, an
|
|
113
118
|
inline theme `<style>`, a Content-Security-Policy, `Cache-Control: public,
|
|
114
119
|
max-age=0, s-maxage=31536000, stale-while-revalidate=86400` and
|
|
@@ -198,15 +203,15 @@ renders an empty list (or, for one post, not found) instead of failing the page.
|
|
|
198
203
|
|---|---|---|
|
|
199
204
|
| `nav` | simple, centered, minimal | Header with menu; Centred header; Landing page header |
|
|
200
205
|
| `hero` | centered, split, image-bg | Centred hero; Hero with image |
|
|
201
|
-
| `features` | grid, list, alternating | Three features; Feature list |
|
|
202
|
-
| `cta` | banner, card, split | Banner; Card |
|
|
206
|
+
| `features` | grid, list, alternating | Three features; Feature list; Included and not included |
|
|
207
|
+
| `cta` | banner, card, split, image-bg, sticky | Banner; Card; Phone bar |
|
|
203
208
|
| `testimonials` | grid, single | Quotes; One quote |
|
|
204
209
|
| `faq` | accordion, list | FAQ |
|
|
205
210
|
| `pricing` | cards, compact | Three plans |
|
|
206
211
|
| `logos` | row, grid | Logo row |
|
|
207
212
|
| `stats` | row, cards | Three numbers |
|
|
208
213
|
| `gallery` | grid, masonry | Photo grid |
|
|
209
|
-
| `rich-text` | narrow, wide | Text |
|
|
214
|
+
| `rich-text` | narrow, wide, split | Text |
|
|
210
215
|
| `form-embed` | card, split | Contact form; Form card |
|
|
211
216
|
| `footer` | simple, columns, minimal | Footer; Footer with columns |
|
|
212
217
|
| `schedule` | grid, agenda | Weekly timetable; Day by day |
|
|
@@ -223,6 +228,35 @@ a button and a note per step) and `numbered`; `pricing` takes plan `groups`
|
|
|
223
228
|
`tiers`; `logos` has a `trust-bar` variant (a short claim and badges), and an
|
|
224
229
|
item without an image is a text badge.
|
|
225
230
|
|
|
231
|
+
Section options:
|
|
232
|
+
|
|
233
|
+
- **Eyebrows**: a short line above the heading on every section with an
|
|
234
|
+
intro, `cta`, `faq`, `testimonials`, `gallery`, `logos`, `stats` and
|
|
235
|
+
`rich-text` included.
|
|
236
|
+
- **A highlighted phrase**: `headingAccent` on `hero`, `cta` and `rich-text`
|
|
237
|
+
sets the first place the heading contains it (any case) in the brand's
|
|
238
|
+
accent colour, or underlines it on an accent or inverse band. A phrase
|
|
239
|
+
the heading doesn't contain changes nothing. `withAccent` does the same in
|
|
240
|
+
a section of your own.
|
|
241
|
+
- **`hero`**: `stats`, two to five value and label pairs under the buttons.
|
|
242
|
+
- **`rich-text`**: `split` puts the eyebrow and heading in one column and the
|
|
243
|
+
copy in the other.
|
|
244
|
+
- **`cta`**: `image-bg` puts the band over an image behind a scrim (as the
|
|
245
|
+
hero's does; without an image it is the banner); `sticky` is a bar fixed to
|
|
246
|
+
the bottom of the screen on phones (heading and the first button, above the
|
|
247
|
+
safe area) and a band in the page on wider screens. Put it last on the page.
|
|
248
|
+
- **`features`**: `compare`, two lists side by side (`included`, with a tick,
|
|
249
|
+
and `excluded`, with a dash), with or instead of the items; and an `anchor`
|
|
250
|
+
per item for links straight to it. `pricing` plans take an `anchor` too.
|
|
251
|
+
- **`faq`**: answers are rich text (links, emphasis, lists). Version 1's
|
|
252
|
+
plain answers move on read: a blank line starts a paragraph and a single
|
|
253
|
+
line break stays a break (`answerToRichText`).
|
|
254
|
+
- **`nav`**: `tagline` under the site's name; `ctaShortLabel`, the button's
|
|
255
|
+
label below wide screens (the phone menu keeps the full one); and
|
|
256
|
+
`drawerContact` (phone, email, address) at the foot of the phone menu.
|
|
257
|
+
- **`footer`**: `cta`, a button under the line about you; `{year}` in
|
|
258
|
+
`copyright` is the current year.
|
|
259
|
+
|
|
226
260
|
- **`schedule`**: the week's sessions by time and day, with a host ("with …";
|
|
227
261
|
documents saved before version 2 keep an older key for it, which still
|
|
228
262
|
renders and moves into `host`), place, a note and a booking link per
|
|
@@ -415,12 +449,40 @@ site's setting when they publish a post.
|
|
|
415
449
|
Each page gets a title from the site's template (`%s · Riverside Works`), a
|
|
416
450
|
description, `robots`, a canonical URL from `origin`, and Open Graph and
|
|
417
451
|
Twitter tags. The home page carries `Organization` and `WebSite` JSON-LD, and
|
|
418
|
-
every page below it a `BreadcrumbList`. `
|
|
452
|
+
every page below it a `BreadcrumbList`. A site with `seo.localBusiness` (its
|
|
453
|
+
schema.org type, address, phone, email, founding date, geo and opening hours)
|
|
454
|
+
adds that business to the home page and the pages it lists in `pages` (a
|
|
455
|
+
contact page, say), with the organization's logo and links. A page with
|
|
456
|
+
visible `faq` sections carries one `FAQPage` of all their questions
|
|
457
|
+
(`localBusinessJsonLd`, `faqPageJsonLd`). The editor's Pages tab edits all of
|
|
458
|
+
this under Search and sharing; the share image is set per page in Publish. `sitemap.xml` lists the indexable
|
|
419
459
|
pages; `robots.txt` points at it, or disallows everything for a `noindex` site
|
|
420
460
|
and in preview. Moving a page (`store.movePage`) leaves a 301 from the old
|
|
421
461
|
path and rewrites older redirects to point at the new one, so there are no
|
|
422
462
|
chains.
|
|
423
463
|
|
|
464
|
+
Editors add their own redirects in the editor's Redirects section (Pages tab):
|
|
465
|
+
an old or short address, permanent (301) or temporary (302), to one of the
|
|
466
|
+
site's pages or landing pages, a place the host app publishes on the site's
|
|
467
|
+
address, or any other link. Pass those places as `SiteEditor`'s
|
|
468
|
+
`destinations` (`{ group: "Forms", label: "Feedback", path: "/f/feedback" }`).
|
|
469
|
+
The section refuses an address a page or another redirect has, the home page
|
|
470
|
+
and reserved paths, and a destination that redirects again; adding one points
|
|
471
|
+
earlier redirects to its address straight at its destination. The same rules
|
|
472
|
+
are exported for your own screens: `redirectFromProblems`,
|
|
473
|
+
`redirectToProblems`, `upsertRedirect`, `removeRedirect` and
|
|
474
|
+
`redirectDestinations`.
|
|
475
|
+
|
|
476
|
+
A redirect matches its old address only, or, with `match: "prefix"`, every
|
|
477
|
+
address under it too (`/people` takes `/people/ana`, never `/peoplex`): an
|
|
478
|
+
old section of a site, or tag and category archives. Pages and posts under it
|
|
479
|
+
still show, an exact redirect beats a prefix one, and the longest prefix wins.
|
|
480
|
+
With `keepRest: true` the rest of the address goes along
|
|
481
|
+
(`/blog/old/2019/post` → `/blog/2019/post`). A redirect to a site path keeps the
|
|
482
|
+
visitor's query string. `matchPrefixRedirect` and `isUnderPrefix` are exported;
|
|
483
|
+
a release refuses a prefix redirect from `/`, one into its own prefix (it would
|
|
484
|
+
redirect again), and `keepRest` on an exact one.
|
|
485
|
+
|
|
424
486
|
## Forms
|
|
425
487
|
|
|
426
488
|
A `form-embed` section names a form by slug. Your `forms` resolver says what
|
|
@@ -485,7 +547,11 @@ published post, `/rss.xml` is the feed, and every page links to it.
|
|
|
485
547
|
Moving a blog in: `importPosts(siteId, posts)` takes up to 500 posts once,
|
|
486
548
|
each with its slug and its old `publishedAt`. A slug the site already has is
|
|
487
549
|
skipped, and a post that fails a check comes in as a draft with its
|
|
488
|
-
`issues`, so nothing goes live unchecked.
|
|
550
|
+
`issues`, so nothing goes live unchecked. A date must be a real one from
|
|
551
|
+
1970 on, and a later one than now becomes now. A post imported as a draft
|
|
552
|
+
keeps its date (`imported_published_at`, migration
|
|
553
|
+
`0003_genesis_sites_post_dates.sql`) and goes live under it when first
|
|
554
|
+
published. Re-host its pictures first (see
|
|
489
555
|
Importing a site) and run `rewriteUrls` over each document.
|
|
490
556
|
|
|
491
557
|
Anon reads posts only through `genesis_sites.live_posts(site_id)` (the
|
package/SKILL.md
CHANGED
|
@@ -46,5 +46,15 @@ Then, as `genesis add` prints:
|
|
|
46
46
|
(`landing.directory`, `/go` by default), made in the editor's Landing pages section or with
|
|
47
47
|
`createLandingPage`; it is a page like any other, edited and published in the same editor and
|
|
48
48
|
release, never a second builder.
|
|
49
|
+
- A site's 404 page is its page at `/404` (`NOT_FOUND_PATH`), made in the editor's Page not found
|
|
50
|
+
section and edited with the site's sections. With `unknownPath: "not-found"`, an unknown path
|
|
51
|
+
shows it with status 404 and `noindex`; a site without one shows the built-in text. A host that
|
|
52
|
+
answers a miss in its own reserved paths can serve it too: `handleSiteRequest` on `/404`.
|
|
53
|
+
- A redirect is added in the editor's Redirects section, not by writing `site.redirects`: its
|
|
54
|
+
picker lists the site's pages and landing pages and what the host passes as `SiteEditor`'s
|
|
55
|
+
`destinations` (forms, offers, anything the app serves on the site's address), with no chains.
|
|
56
|
+
- An old section of a site (legacy `/people/*`, `/tag/*`) is one redirect with "This address and
|
|
57
|
+
everything under it" (`match: "prefix"`, optionally `keepRest`), not one per old page; pages
|
|
58
|
+
under it still show. There are no pattern redirects: list stray old addresses one by one.
|
|
49
59
|
|
|
50
60
|
Details: the package README and [docs/SITES.md](https://github.com/marktiderman/genesis/blob/main/docs/SITES.md).
|