Rotating words: {Next|Now} in titles and text cycles through its choices
Migration 084: site defaults for the motion (slide, flip, fade, type, mirror), direction and seconds per word in Site settings, and a hero's and a block's own. The hero's headline, section and band titles, headings, paragraphs, callouts and quotes rotate; menus, tab titles, search text and emails show the first word; less motion shows it still. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ab8dcdd608
commit
a10ff6d75f
30 changed files with 411 additions and 37 deletions
|
|
@ -100,6 +100,8 @@ export function siteFor(db) {
|
|||
...base.robots,
|
||||
index: row.indexing ? row.indexing === "on" : base.robots?.index !== false,
|
||||
},
|
||||
// Rotating words' defaults (084): blank is the app's own.
|
||||
words: { motion: row.word_motion ?? null, direction: row.word_direction ?? null, seconds: row.word_seconds ?? null },
|
||||
// The admin's colors (theme.js): only #rrggbb values and fixed
|
||||
// text, so safe inside <style>.
|
||||
themeCss: themeCss(db),
|
||||
|
|
@ -114,6 +116,7 @@ const forBrowser = (site, nav) => ({
|
|||
title: site.title,
|
||||
pages: site.pages,
|
||||
requestFiles: driveReady(),
|
||||
words: site.words,
|
||||
nav,
|
||||
});
|
||||
|
||||
|
|
@ -138,6 +141,8 @@ export function plainText(text) {
|
|||
const flat = String(text)
|
||||
.slice(0, 2000)
|
||||
.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
|
||||
// Rotating words ({Next|Now}, 084): the first.
|
||||
.replace(/\{([^{}|\n]+)(?:\|[^{}|\n]+)+\}/g, "$1")
|
||||
.replace(/\*\*(.+?)\*\*/g, "$1")
|
||||
.replace(/\*(.+?)\*/g, "$1")
|
||||
.replace(/\s+/g, " ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue