domma-cms 1.43.0 → 1.44.1
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 +13 -0
- package/admin/js/lib/admin-theme.js +1 -1
- package/admin/js/lib/topbar-account.js +1 -1
- package/bin/cli.js +8 -2
- package/config/menus/footer.json +8 -0
- package/config/menus/main.json +141 -6
- package/docs/DommaFeatures.md +6 -2
- package/docs/configuration.md +1 -0
- package/package.json +1 -1
- package/scripts/seed.js +112 -129
- package/scripts/setup.js +4 -0
- package/scripts/starter-media/CREDITS.md +12 -0
- package/scripts/starter-media/colleagues-chatting-coffee.jpg +0 -0
- package/scripts/starter-media/colour-swatches.jpg +0 -0
- package/scripts/starter-media/maker-at-workbench.jpg +0 -0
- package/scripts/starter-media/packing-parcel-shop-desk.jpg +0 -0
- package/scripts/starter-media/team-planning-meeting.jpg +0 -0
- package/scripts/starter-media/woman-phone-desk.jpg +0 -0
- package/server/routes/api/theme.js +2 -1
- package/server/services/markdown.js +64 -41
- package/server/services/themeSettings.js +9 -1
- package/config/menus/sproj-1779696558011-menu.json +0 -17
- package/config/menus/sproj-1779696960337-menu.json +0 -18
- package/config/menus/sproj-1779696985353-menu.json +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.44.1] - 2026-11-08
|
|
4
|
+
|
|
5
|
+
- **A shortcode inside an effect, tabs or an accordion keeps its settings.** `[reveal]`, `[ambient]` and the other effects, `[tabs]`, `[accordion]`, `[carousel]` and the cards render their body before the shortcodes inside it run, and that turned the inner tag's quotes into `"` and its web addresses into links. So `[hero size="md"]` inside `[reveal]` got the class `hero-"md"`, `[embed url="https://…"]` said "Invalid embed URL", and `[spacer size="24" /]` was drawn at the default 40px. Tags with settings are now held back from that pass and put back as written (`markedBody()` in markdown.js). Effects also escape their own `data-fx-*` values.
|
|
6
|
+
|
|
7
|
+
## [1.44.0] - 2026-11-08
|
|
8
|
+
|
|
9
|
+
- **New self-hosted sites look like domma-cms.com.** What `npx domma-cms <name>` makes:
|
|
10
|
+
- The main menu is the segmented pill bar with card dropdowns and the pop entrance, with a brand pill, plus a **Tools** card linking to Domma's Tools and the Marketplace (and, for admins, the site's own Marketplace). The footer links to both too.
|
|
11
|
+
- Home, About and Contact are rewritten with photos (six CC0 pictures copied into `content/media/starter/`, credits in `scripts/starter-media/CREDITS.md`) and `[text]` gradient highlights.
|
|
12
|
+
- Nunito Sans on the site and in the admin, and the **Atelier Dark** admin.
|
|
13
|
+
- The side admin menu starts **off** (the top menu has everything). New theme.json key `adminSidebar` (default `true`, so existing sites keep it); each person's own choice still wins.
|
|
14
|
+
- Fixed for new sites: the Contact form said "Form not found" (the seed wrote forms to the old form-builder folder, not `content/forms/`), the navbar brand was empty, and three test menus (`sproj-*`) shipped in `config/menus/`. The home page's last section no longer puts a `[hero]` inside `[reveal]`, which printed the hero's settings as text.
|
|
15
|
+
|
|
3
16
|
## [1.43.0] - 2026-11-08
|
|
4
17
|
|
|
5
18
|
- **Self-hosted sites hear about new versions.** Once a day the site asks npm for the latest Domma CMS; when it is behind, the Super Admins get a notice (Notifications, "Domma CMS update available") saying which version and the command to run. A newer release replaces it and updating ends it. Hosted sites and managers are updated for them, so they never check. server.json `updateCheck: false` or `DOMMA_UPDATE_CHECK=0` turns it off (and ends a notice already shown). See `server/services/cmsUpdates.js`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fontFamilyValue as l,fontStylesheetHref as r,isFontStylesheet as f}from"../../../public/js/font-families.mjs?v=20261029-cms-fonts";import{syncThemeAwareLogos as y}from"./theme-aware-logo.js";const
|
|
1
|
+
import{fontFamilyValue as l,fontStylesheetHref as r,isFontStylesheet as f}from"../../../public/js/font-families.mjs?v=20261029-cms-fonts";import{syncThemeAwareLogos as y}from"./theme-aware-logo.js";import{setSidebarDefault as h}from"./topbar-account.js";const c="dm-custom-themes";function u(t={}){const n=(a,d)=>{let m=document.getElementById(a);if(!d){m?.remove();return}m||(m=document.createElement("link"),m.id=a,m.rel="stylesheet",document.head.appendChild(m)),m.href=d},e=f(t.stylesheet)?t.stylesheet:"";n("dm-licensed-fonts",e);const o=r(t.family,{stylesheet:e});n("dm-admin-font-link",o===e?"":o);let s=document.getElementById("dm-admin-font");if(!t.family){s?.remove();return}s||(s=document.createElement("style"),s.id="dm-admin-font",document.head.appendChild(s));const i=l(t.family);s.textContent=`body[class] { --dm-font-sans: ${i}; font-family: var(--dm-font-sans); }`}export function applyAdminTheme(t){const n=t?.dommaTheme||"charcoal-dark";Domma.theme.init({theme:n,persist:!1,target:document.body});let e=document.getElementById(c);t?.css?(e||(e=document.createElement("style"),e.id=c,document.head.appendChild(e)),e.textContent=t.css):e&&e.remove();const o=document.body;for(const s of[...o.classList])s.startsWith("dm-custom-")&&o.classList.remove(s);t?.customClass&&o.classList.add(t.customClass),y(),u(t?.font)}export async function refreshAdminTheme(t,n={}){try{const e=await t.theme.admin();applyAdminTheme(e,n),typeof e?.sidebar=="boolean"&&h(e.sidebar)}catch{applyAdminTheme({dommaTheme:"charcoal-dark"},n)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let
|
|
1
|
+
let c={};export function renderFrameworkVersions(o){o&&(c=o);for(const[e,s,a]of[["topbar-reactive-version","Reactive",c.reactive],["topbar-js-version","JS",globalThis.Domma?.version||c.js]]){const t=document.getElementById(e);t&&(t.textContent=a||"",t.parentElement.hidden=!a,t.hidden=!a)}}export function sidebarPreferenceKey(o){return"sidebar.visible."+(o?.id||"anonymous")}const d="sidebar.siteDefault";let i=!0;try{i=S.get(d)!==!1}catch{}let l=null;export function setSidebarDefault(o){i=o!==!1;try{S.set(d,i)}catch{}l?.()}export function wireAccountMenu(o){f("topbar-account"),f("topbar-versions-menu");const e=document.getElementById("topbar-show-sidebar");if(!e||e.dataset.wired)return;e.dataset.wired="1";const s=sidebarPreferenceKey(o),a=()=>{try{const r=S.get(s);return typeof r=="boolean"?r:null}catch{return null}},t=r=>{!r&&document.body.classList.contains("dm-sidebar-open")&&document.getElementById("topbar-sidebar-toggle")?.click(),document.body.classList.toggle("dm-sidebar-hidden",!r),e.checked=r};t(a()??i),l=()=>{a()===null&&t(i)},e.addEventListener("change",()=>{t(e.checked);try{S.set(s,e.checked)}catch{}})}const u=new Map;function f(o){const e=document.getElementById(o);if(!e||e.dataset.wired)return;e.dataset.wired="1";const s=e.querySelector("button"),a=e.querySelector(".topbar-account-menu"),t=n=>{n&&document.dispatchEvent(new CustomEvent("dm:topbar-menu-open",{detail:{owner:e}})),a.hidden=!n,s.setAttribute("aria-expanded",String(n))};s.addEventListener("click",()=>t(a.hidden)),s.addEventListener("keydown",n=>{n.key==="ArrowDown"&&(n.preventDefault(),t(!0),a.querySelector("a, input, button:not(:disabled)")?.focus())}),e.addEventListener("click",n=>{n.target.closest("a")&&t(!1)}),u.get(o)?.abort();const r=new AbortController;u.set(o,r),document.addEventListener("click",n=>{e.contains(n.target)||t(!1)},{signal:r.signal}),document.addEventListener("dm:topbar-menu-open",n=>{n.detail.owner!==e&&t(!1)},{signal:r.signal}),document.addEventListener("keydown",n=>{!n.defaultPrevented&&n.key==="Escape"&&!a.hidden&&(t(!1),s.focus(),n.preventDefault())},{signal:r.signal}),window.addEventListener("hashchange",()=>t(!1),{signal:r.signal})}
|
package/bin/cli.js
CHANGED
|
@@ -222,11 +222,17 @@ const DEFAULT_SITE_TITLE = 'My Site';
|
|
|
222
222
|
const DEFAULT_SITE = {
|
|
223
223
|
title: DEFAULT_SITE_TITLE,
|
|
224
224
|
tagline: 'Powered by Domma CMS',
|
|
225
|
+
// The navbar's brand pill (the renderer reads site.json brand; setup renames it with the title).
|
|
226
|
+
brand: {text: DEFAULT_SITE_TITLE, url: '/', icon: 'grid', enabled: true},
|
|
225
227
|
// The look a new site starts with. First boot lifts these into
|
|
226
228
|
// config/theme.json (migrateThemeConfig); Appearance > Theme changes them.
|
|
227
229
|
theme: 'dreamy-light',
|
|
228
|
-
adminTheme: '
|
|
229
|
-
fontFamily: '
|
|
230
|
+
adminTheme: 'admin-atelier-dark',
|
|
231
|
+
fontFamily: 'Nunito Sans',
|
|
232
|
+
adminFontFamily: 'Nunito Sans',
|
|
233
|
+
// The side admin menu starts hidden (the top menu has everything); each
|
|
234
|
+
// person can show it from the Versions panel.
|
|
235
|
+
adminSidebar: false,
|
|
230
236
|
seo: {
|
|
231
237
|
defaultTitle: 'My Site',
|
|
232
238
|
titleSeparator: ' | ',
|
package/config/menus/footer.json
CHANGED
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"text": "Resources",
|
|
12
12
|
"url": "/resources"
|
|
13
13
|
},
|
|
14
|
+
{
|
|
15
|
+
"text": "Tools",
|
|
16
|
+
"url": "https://domma-cms.com/tools"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"text": "Marketplace",
|
|
20
|
+
"url": "https://dcm.dommajs.org/marketplace"
|
|
21
|
+
},
|
|
14
22
|
{
|
|
15
23
|
"text": "Contact",
|
|
16
24
|
"url": "/contact"
|
package/config/menus/main.json
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"slug": "main",
|
|
3
3
|
"name": "Main navigation",
|
|
4
|
-
"description": "
|
|
5
|
-
"variant": "light",
|
|
4
|
+
"description": "The site's top menu: your pages, plus Domma's Tools and Marketplace.",
|
|
6
5
|
"position": "sticky",
|
|
6
|
+
"orientation": "horizontal",
|
|
7
|
+
"appearOnHover": true,
|
|
7
8
|
"highlight": {
|
|
8
|
-
"hover": "darken",
|
|
9
9
|
"active": "darken"
|
|
10
10
|
},
|
|
11
|
+
"entrance": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"animation": "pop",
|
|
14
|
+
"stagger": 40,
|
|
15
|
+
"duration": 150
|
|
16
|
+
},
|
|
17
|
+
"mobile": {
|
|
18
|
+
"hideBrand": true
|
|
19
|
+
},
|
|
20
|
+
"look": {
|
|
21
|
+
"bar": "segmented",
|
|
22
|
+
"brand": "pill",
|
|
23
|
+
"strip": "none",
|
|
24
|
+
"shrink": true,
|
|
25
|
+
"icons": "rainbow",
|
|
26
|
+
"dropdown": "cards",
|
|
27
|
+
"morph": true
|
|
28
|
+
},
|
|
11
29
|
"items": [
|
|
12
30
|
{
|
|
13
31
|
"text": "Home",
|
|
@@ -22,7 +40,114 @@
|
|
|
22
40
|
{
|
|
23
41
|
"text": "Resources",
|
|
24
42
|
"url": "/resources",
|
|
25
|
-
"icon": "book-open"
|
|
43
|
+
"icon": "book-open",
|
|
44
|
+
"panel": {
|
|
45
|
+
"heading": "Learn your way around",
|
|
46
|
+
"link": {
|
|
47
|
+
"text": "All resources",
|
|
48
|
+
"url": "/resources"
|
|
49
|
+
},
|
|
50
|
+
"columns": 2,
|
|
51
|
+
"feature": {
|
|
52
|
+
"tone": "light",
|
|
53
|
+
"eyebrow": "New here?",
|
|
54
|
+
"title": "The Domma CMS user manual",
|
|
55
|
+
"points": [
|
|
56
|
+
"Every screen, step by step",
|
|
57
|
+
"Shortcodes with examples"
|
|
58
|
+
],
|
|
59
|
+
"button": {
|
|
60
|
+
"text": "Open the manual",
|
|
61
|
+
"url": "https://domma-cms.com/spaces/domma-cms-user-manual"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"items": [
|
|
66
|
+
{
|
|
67
|
+
"text": "Typography",
|
|
68
|
+
"url": "/resources/typography",
|
|
69
|
+
"icon": "type",
|
|
70
|
+
"description": "Headings, text styles and lists."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"text": "Grid system",
|
|
74
|
+
"url": "/resources/grid",
|
|
75
|
+
"icon": "layout",
|
|
76
|
+
"description": "Columns and layouts for any page."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"text": "Cards",
|
|
80
|
+
"url": "/resources/cards",
|
|
81
|
+
"icon": "credit-card",
|
|
82
|
+
"description": "Boxes for features, prices and people."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"text": "Shortcodes",
|
|
86
|
+
"url": "/resources/shortcodes",
|
|
87
|
+
"icon": "code",
|
|
88
|
+
"description": "Every building block you can drop into a page."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"text": "Effects",
|
|
92
|
+
"url": "/resources/effects",
|
|
93
|
+
"icon": "zap",
|
|
94
|
+
"description": "Reveals, celebrations and moving text."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"text": "Interactive",
|
|
98
|
+
"url": "/resources/interactive",
|
|
99
|
+
"icon": "mouse-pointer",
|
|
100
|
+
"description": "Tabs, accordions, carousels and more."
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"text": "Tools",
|
|
106
|
+
"url": "https://domma-cms.com/tools",
|
|
107
|
+
"icon": "package",
|
|
108
|
+
"panel": {
|
|
109
|
+
"heading": "Add more to your site",
|
|
110
|
+
"link": {
|
|
111
|
+
"text": "See every Tool",
|
|
112
|
+
"url": "https://domma-cms.com/tools"
|
|
113
|
+
},
|
|
114
|
+
"columns": 1,
|
|
115
|
+
"feature": {
|
|
116
|
+
"tone": "accent",
|
|
117
|
+
"eyebrow": "Domma Marketplace",
|
|
118
|
+
"title": "Tools for your own server",
|
|
119
|
+
"points": [
|
|
120
|
+
"Bought once, yours to keep",
|
|
121
|
+
"Updates with one click",
|
|
122
|
+
"Installed from your admin"
|
|
123
|
+
],
|
|
124
|
+
"button": {
|
|
125
|
+
"text": "Visit the Marketplace",
|
|
126
|
+
"url": "https://dcm.dommajs.org/marketplace"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"items": [
|
|
131
|
+
{
|
|
132
|
+
"text": "All Tools",
|
|
133
|
+
"url": "https://domma-cms.com/tools",
|
|
134
|
+
"icon": "grid",
|
|
135
|
+
"description": "Shops, bookings, invoices, mail and more."
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"text": "Marketplace",
|
|
139
|
+
"url": "https://dcm.dommajs.org/marketplace",
|
|
140
|
+
"icon": "shopping-bag",
|
|
141
|
+
"description": "Buy Tools for this site, priced for self-hosting."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"text": "Your Marketplace",
|
|
145
|
+
"url": "/admin/#/plugins",
|
|
146
|
+
"icon": "settings",
|
|
147
|
+
"description": "Install, switch on and update Tools in your admin.",
|
|
148
|
+
"visibility": "admin"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
26
151
|
},
|
|
27
152
|
{
|
|
28
153
|
"text": "Contact",
|
|
@@ -31,9 +156,19 @@
|
|
|
31
156
|
}
|
|
32
157
|
],
|
|
33
158
|
"meta": {
|
|
34
|
-
"createdAt": "2026-
|
|
35
|
-
"updatedAt": "2026-
|
|
159
|
+
"createdAt": "2026-11-08T00:00:00.000Z",
|
|
160
|
+
"updatedAt": "2026-11-08T00:00:00.000Z",
|
|
36
161
|
"bundled": false,
|
|
37
162
|
"presetOwner": null
|
|
163
|
+
},
|
|
164
|
+
"style": {
|
|
165
|
+
"fontFamily": "Nunito Sans",
|
|
166
|
+
"fontSize": "16px",
|
|
167
|
+
"fontWeight": "500",
|
|
168
|
+
"letterSpacing": "0em",
|
|
169
|
+
"iconSize": "16px"
|
|
170
|
+
},
|
|
171
|
+
"dock": {
|
|
172
|
+
"hideOnScroll": true
|
|
38
173
|
}
|
|
39
174
|
}
|
package/docs/DommaFeatures.md
CHANGED
|
@@ -74,7 +74,7 @@ Code was treated as the truth. Where docs disagree with it, the disagreement is
|
|
|
74
74
|
| `shopping-cart-pro` | paid | 0.3.2 | More for the Shop: discount codes (other Tools such as Prize Wheel can make single-use ones), shipping zones with rates by weight or order value, tax by country and class, branded order emails from confirmation to dispatch, and Insights - takings by week, best sellers, repeat customers and abandoned checkouts you can nudge. Adds to the free Shopping Cart; a lapsed licence leaves the Cart and every order just as they were. |
|
|
75
75
|
| `sliding-puzzle` | paid (giftable) | 1.0.0 | The tile-sliding puzzle, 3x3 to 6x6, numbers or a Media picture. Same board for everyone, a new board each go, or a daily puzzle; every move checked by the server. Fewest moves or fastest time wins. |
|
|
76
76
|
| `social-media-pro` | paid | 0.4.0 | How the site looks when it is shared, and posting it: share cards per page for Facebook, X, LinkedIn, WhatsApp and Slack with previews; a share image drawn for every page that has none, in the site's colours; share and follow buttons; posting to Bluesky, Mastodon and LinkedIn (through the site's own LinkedIn app, with a reminder before its 60-day sign-in runs out) - now, scheduled, or drafted automatically for every new blog post or page - with links tagged for Analytics and the posts on the Calendar; and LinkedIn conversions - chosen forms reported to LinkedIn's Conversions API when a visitor who accepted marketing cookies sends one. Sold with SEO Pro. |
|
|
77
|
-
| `surveys` | paid | 1.
|
|
77
|
+
| `surveys` | paid | 1.10.0 | Targeted surveys over the Forms engine: shared audiences, tokenised invites, reminders, and per-survey statistics. |
|
|
78
78
|
| `sweepstake` | paid (giftable) | 1.0.0 | Office, pub and club sweepstakes for any event: picks, entry fee and prizes, entrants by name with paid ticks, and one recorded, repeatable draw revealed live on the page, then who has what and the money. |
|
|
79
79
|
| `theme-roller` | paid | 1.1.3 | Make your own themes: start from any built-in theme, change its colours, fonts, spacing and borders with a live preview, and save it. Saved themes join the built-in ones everywhere a theme is chosen - the site, the admin, day and night, a region of a page. Needs Domma CMS 0.73 or later to use them. |
|
|
80
80
|
| `timeline` | paid (giftable) | 1.0.0 | Put events in date order: all at once (Sort) or one at a time into a growing timeline with lives (Place). Years, months or full dates, BC too; dates stay on the server until a card is placed. Shortcode `[timeline-game]`. |
|
|
@@ -2399,7 +2399,7 @@ Control how every page looks when it is shared, and post it. Social Media Pro ed
|
|
|
2399
2399
|
|
|
2400
2400
|
### Surveys (`surveys`)
|
|
2401
2401
|
|
|
2402
|
-
Tier: paid (closed source) · Version: 1.
|
|
2402
|
+
Tier: paid (closed source) · Version: 1.10.0 · Requires: nothing declared; collections declare MongoDB (`storage.adapter: "mongodb"`) and fall back to files when `config/connections.json` is absent · Uses: `contacts` ("Import an audience from Contacts"); notes say core 0.88 · Built over core Forms
|
|
2403
2403
|
|
|
2404
2404
|
Targeted surveys on top of the Forms engine. Pick any form, choose an audience from your own contact list and groups, send tokenised email invitations and reminders, and watch response rates and per-question statistics - identified or anonymous. Surveys can also be embedded in any page or opened from a hosted survey page with a code.
|
|
2405
2405
|
|
|
@@ -2409,6 +2409,10 @@ Targeted surveys on top of the Forms engine. Pick any form, choose an audience f
|
|
|
2409
2409
|
- Audience (`#/plugins/surveys/audience`): contacts (name, email, groups) with search, add, copy email, delete (contacts cannot be edited once added); named groups (no rename, and no delete-group route); "Import from Contacts" (your own core Contacts; hidden when the Contacts Tool is off).
|
|
2410
2410
|
- Invitations: one 8-character code per recipient (e.g. `ABCD-EFGH`, SHA-256 hashed, never stored in plain text), sent through the site's SMTP; one response per invite. Links are built on the Site URL setting (`site.baseUrl`), else the old `site.url`, else the request's address (1.4.4).
|
|
2411
2411
|
- Hosted page `/survey/:slug` (token in `?t=` or typed code), 404 unknown / 403 before its Opens day / 410 closed; submit at `POST /api/plugins/surveys/submit/:slug`.
|
|
2412
|
+
- **Theme per survey (1.9.0)** - Survey page > Theme picks the hosted page's colour theme (any built-in palette or a Theme Roller custom theme); "Use site theme" follows Content > Theme. Before 1.9.0 the hosted page ignored the site theme entirely. Embeds take the host page's theme. Stored as `theme` on the survey (theme id or blank) and carried by JSON export/import.
|
|
2413
|
+
- **Wizard steps scroll to the top (1.9.0)** - Next, Back and logic step jumps on a multi-page survey jump to the top of the hosted page, or to the top of an embedded survey (clear of a sticky navbar), so the next step starts at its first question.
|
|
2414
|
+
- **Results by section and view switches (1.10.0)** - Results' Show card: Split into sections (the form's wizard pages, each with title, description and "N questions · M answered", plus Jump to buttons), Hide questions nobody answered, Show free-text answers. Kept on the survey (`results`), `PUT /api/plugins/surveys/surveys/:slug/results-view`; the cog's Split results into sections (`resultsBySection`, on) is the starting point. Read-only users' flips stay on screen only.
|
|
2415
|
+
- **Results exports (1.10.0)** - Export JSON is a full report (`format: domma-surveys-results`, v1: survey, summary, sections or questions with counts/percentages/averages, every response keyed by question label) instead of a bare array of rows. Export CSV adds Submitted and heads columns with question labels (`Section: Question` when split); headings are formula-defused like cells.
|
|
2412
2416
|
- Opens/Closes are days in the site's time zone (`timeZone` setting, default `Europe/London`): a survey takes answers from the start of its Opens day to the END of its Closes day. The hosted page, submissions, scheduler reminders, Send (409 once closed), the list chip, the badge and the closing notices all use the same rule (1.4.4).
|
|
2413
2417
|
- Shortcode `[survey slug="..." /]` - embeds the survey on any page; Copy embed shortcode copies exactly this, and the page gets the survey script added automatically (1.4.4).
|
|
2414
2418
|
- Results (`#/plugins/surveys/results/:slug`): invited, answered, response rate, per-question aggregates (only this survey's responses, tagged `survey:<slug>`); Export CSV and Export JSON; anonymous flag.
|
package/docs/configuration.md
CHANGED
|
@@ -424,6 +424,7 @@ Created on first boot by a one-shot migration out of `config/site.json`.
|
|
|
424
424
|
|---|---|
|
|
425
425
|
| `theme` | Public site theme id |
|
|
426
426
|
| `adminTheme` | Admin panel theme id (admin-chrome themes are only offered here) |
|
|
427
|
+
| `adminSidebar` | Whether the side admin menu shows for someone who has not chosen (default `true`; new self-hosted sites start with `false`). Each person's own "Show side admin menu" choice, under Versions in the top bar, always wins. A new site gets it from `site.json` `adminSidebar` on first boot |
|
|
427
428
|
| `baseTheme` | Set by the Theme Roller plugin when a generated theme is active. `theme` then names the custom theme and `baseTheme` the built-in one Domma's engine is given; the picker is disabled while it is set. |
|
|
428
429
|
| `autoTheme` | Day/night pair, switched on each visitor's local time. Ignored when a page pins its own theme, and unavailable with a Theme Roller theme. |
|
|
429
430
|
| `font.family` / `font.size` | Public site body font and root size |
|
package/package.json
CHANGED
package/scripts/seed.js
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* Safe to run multiple times - overwrites seed paths only.
|
|
6
6
|
* Run: npm run seed
|
|
7
7
|
*/
|
|
8
|
-
import {mkdir, writeFile} from 'node:fs/promises';
|
|
8
|
+
import {copyFile, mkdir, readdir, writeFile} from 'node:fs/promises';
|
|
9
|
+
import {constants as fsConstants} from 'node:fs';
|
|
9
10
|
import path from 'node:path';
|
|
10
11
|
import {fileURLToPath} from 'node:url';
|
|
11
12
|
|
|
@@ -14,8 +15,9 @@ const ROOT = path.resolve(__dirname, '..');
|
|
|
14
15
|
|
|
15
16
|
const PAGES_DIR = path.join(ROOT, 'content', 'pages');
|
|
16
17
|
const COLLECTIONS_DIR = path.join(ROOT, 'content', 'collections');
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
// Forms are core: content/forms/<slug>.json (services/forms.js FORMS_DIR). The old
|
|
19
|
+
// form-builder plugin path left every fresh site's Contact form "not found".
|
|
20
|
+
const FORMS_DIR = path.join(ROOT, 'content', 'forms');
|
|
19
21
|
const NAV_CFG = path.join(ROOT, 'config', 'navigation.json');
|
|
20
22
|
|
|
21
23
|
const now = new Date().toISOString();
|
|
@@ -66,109 +68,101 @@ const PAGES = [
|
|
|
66
68
|
},
|
|
67
69
|
body: `[hero fullwidth="true" variant="dark" size="lg" align="left" twinkle twinkle-count="30" blobs]
|
|
68
70
|
|
|
69
|
-
<span class="hero-label">
|
|
71
|
+
<span class="hero-label">Your new website</span>
|
|
70
72
|
|
|
71
|
-
# [
|
|
73
|
+
# [text bold="true"]Your [text gradient="fire" words="true"]website[/text], ready to make your [text gradient="fire" words="true"]own[/text].[/text]
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
[text size="lg" words="true" weight="semibold"][text gradient="fire" words="true"]Pages[/text], [text gradient="fire" words="true"]menus[/text], [text gradient="fire" words="true"]forms[/text] and [text gradient="fire" words="true"]Tools[/text], all in one admin. Change any word on this page from there - nothing here is set in stone.[/text]
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
[button href="/admin/" size="lg" icon-after="arrow-right"]Sign in to the admin[/button] [button href="https://domma-cms.com/tools" variant="outline" size="lg" icon="package"]Browse Tools[/button]
|
|
76
78
|
|
|
77
79
|
[/hero]
|
|
78
80
|
|
|
79
|
-
[
|
|
81
|
+
[spacer size="32" /]
|
|
80
82
|
|
|
81
|
-
[
|
|
83
|
+
[reveal animation="slide-up"]
|
|
84
|
+
[grid cols="2" gap="6"]
|
|
82
85
|
|
|
83
86
|
[col]
|
|
84
|
-
[
|
|
85
|
-
[counter to="25" suffix="+" /]
|
|
86
|
-
**Shortcodes**
|
|
87
|
-
Powerful content blocks built right in.
|
|
88
|
-
[/card]
|
|
87
|
+
[image src="/media/starter/maker-at-workbench.jpg" alt="A maker working at a wooden workbench" radius="lg" shadow="md" /]
|
|
89
88
|
[/col]
|
|
90
89
|
|
|
91
90
|
[col]
|
|
92
|
-
[
|
|
93
|
-
[counter to="22" suffix="" /]
|
|
94
|
-
**Themes**
|
|
95
|
-
Light and dark colour schemes, zero configuration.
|
|
96
|
-
[/card]
|
|
97
|
-
[/col]
|
|
91
|
+
[text size="sm" transform="upper" spacing="wider" color="primary" bold]Start here[/text]
|
|
98
92
|
|
|
99
|
-
[
|
|
100
|
-
[card]
|
|
101
|
-
[counter to="3" suffix="" /]
|
|
102
|
-
**Plugins**
|
|
103
|
-
Extend with effects, analytics, and form handling.
|
|
104
|
-
[/card]
|
|
105
|
-
[/col]
|
|
93
|
+
## Three steps to a site that's [text gradient="sunset" words="true"]yours[/text]
|
|
106
94
|
|
|
107
|
-
[
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
**
|
|
111
|
-
|
|
112
|
-
|
|
95
|
+
[text size="lg" color="muted"]Most people have a site they're happy with in an afternoon.[/text]
|
|
96
|
+
|
|
97
|
+
1. **Sign in** at [/admin](/admin/) with the account you made during setup.
|
|
98
|
+
2. **Change the words and pictures** on Home, About and Contact. Every page is edited with a live preview.
|
|
99
|
+
3. **Pick your look** under Content > Theme: colours, fonts and the menu style.
|
|
100
|
+
|
|
101
|
+
[button href="/admin/" icon="arrow-right"]Open the admin[/button]
|
|
113
102
|
[/col]
|
|
114
103
|
|
|
115
104
|
[/grid]
|
|
116
|
-
|
|
117
105
|
[/reveal]
|
|
118
106
|
|
|
119
|
-
|
|
107
|
+
[spacer size="32" /]
|
|
108
|
+
|
|
109
|
+
[center]
|
|
110
|
+
## Everything is [text gradient="ocean" words="true"]built in[/text]
|
|
111
|
+
[/center]
|
|
120
112
|
|
|
121
|
-
[reveal animation="slide-up" delay="
|
|
113
|
+
[reveal animation="slide-up" delay="100"]
|
|
122
114
|
[grid cols="3" gap="4"]
|
|
123
115
|
|
|
124
116
|
[col]
|
|
125
|
-
[card title="
|
|
126
|
-
Write
|
|
117
|
+
[card title="Pages that look good" image="/media/starter/colour-swatches.jpg" image-alt="Paint colour swatches fanned out" hover]
|
|
118
|
+
Write in plain words, then drop in building blocks: heroes, cards, galleries, tabs and more. [text bold]Dozens of building blocks and themes[/text] come with every site.
|
|
127
119
|
[/card]
|
|
128
120
|
[/col]
|
|
129
121
|
|
|
130
122
|
[col]
|
|
131
|
-
[card title="
|
|
132
|
-
|
|
123
|
+
[card title="Forms and enquiries" image="/media/starter/woman-phone-desk.jpg" image-alt="A woman at her desk checking her phone" hover]
|
|
124
|
+
Contact, booking and sign-up forms without code. Every answer lands in your admin, and you can be emailed each time.
|
|
133
125
|
[/card]
|
|
134
126
|
[/col]
|
|
135
127
|
|
|
136
128
|
[col]
|
|
137
|
-
[card title="
|
|
138
|
-
Add
|
|
129
|
+
[card title="Tools when you need them" image="/media/starter/packing-parcel-shop-desk.jpg" image-alt="Packing a parcel on a shop desk" hover]
|
|
130
|
+
Add a shop, invoices, bookings, a blog or email from the Marketplace. Buy once, keep it for good, and update with a click.
|
|
139
131
|
[/card]
|
|
140
132
|
[/col]
|
|
141
133
|
|
|
142
134
|
[/grid]
|
|
143
135
|
[/reveal]
|
|
144
136
|
|
|
145
|
-
[spacer size="
|
|
137
|
+
[spacer size="32" /]
|
|
138
|
+
|
|
139
|
+
[text size="2xl" align="center" weight="semibold" light-up]Your content lives in plain files on [text gradient="forest" shine="hover"]your own server[/text]. It was yours before you installed Domma CMS, and it stays yours.[/text]
|
|
140
|
+
|
|
141
|
+
[spacer size="32" /]
|
|
146
142
|
|
|
147
|
-
[reveal animation="slide-up" delay="200"]
|
|
148
143
|
[hero variant="gradient-purple" size="md" fullwidth="true"]
|
|
149
144
|
|
|
150
|
-
## Ready to
|
|
145
|
+
## Ready to add [text gradient="candy" shine="sweep"]more[/text]?
|
|
151
146
|
|
|
152
147
|
[grid cols="2" gap="3"]
|
|
153
148
|
|
|
154
149
|
[col]
|
|
155
150
|
[ambient color="#a855f7"]
|
|
156
|
-
**[
|
|
157
|
-
|
|
151
|
+
**[See every Tool →](https://domma-cms.com/tools)**
|
|
152
|
+
Shops, bookings, invoices, mail and more - switch on what you need.
|
|
158
153
|
[/ambient]
|
|
159
154
|
[/col]
|
|
160
155
|
|
|
161
156
|
[col]
|
|
162
157
|
[ambient color="#6366f1"]
|
|
163
|
-
**[
|
|
164
|
-
|
|
158
|
+
**[Visit the Marketplace →](https://dcm.dommajs.org/marketplace)**
|
|
159
|
+
Tools for self-hosted sites, bought once and yours to keep.
|
|
165
160
|
[/ambient]
|
|
166
161
|
[/col]
|
|
167
162
|
|
|
168
163
|
[/grid]
|
|
169
164
|
|
|
170
165
|
[/hero]
|
|
171
|
-
[/reveal]
|
|
172
166
|
`
|
|
173
167
|
},
|
|
174
168
|
{
|
|
@@ -183,106 +177,81 @@ Guides, shortcode references, and plugin documentation.
|
|
|
183
177
|
},
|
|
184
178
|
body: `[hero variant="dark" size="lg" fullwidth="true" twinkle twinkle-count="30" blobs]
|
|
185
179
|
|
|
186
|
-
#
|
|
180
|
+
# [text bold="true"]About [text gradient="fire" words="true"]us[/text][/text]
|
|
187
181
|
|
|
188
|
-
[
|
|
182
|
+
[text size="xl" words="true" weight="semibold"]This is your About page. Tell visitors [text gradient="fire" words="true"]who you are[/text], [text gradient="fire" words="true"]what you do[/text] and why it matters - in your own words.[/text]
|
|
189
183
|
|
|
190
184
|
[/hero]
|
|
191
185
|
|
|
192
|
-
[spacer /]
|
|
193
|
-
|
|
194
|
-
## What Domma CMS gives you
|
|
186
|
+
[spacer size="32" /]
|
|
195
187
|
|
|
196
188
|
[reveal animation="slide-up"]
|
|
189
|
+
[grid cols="2" gap="6"]
|
|
197
190
|
|
|
198
|
-
[grid cols="3" gap="4"]
|
|
199
191
|
[col]
|
|
200
|
-
[
|
|
201
|
-
|
|
202
|
-
[/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
[/card]
|
|
192
|
+
[text size="sm" transform="upper" spacing="wider" color="primary" bold]Our story[/text]
|
|
193
|
+
|
|
194
|
+
## How it [text gradient="sunset" words="true"]started[/text]
|
|
195
|
+
|
|
196
|
+
Every business has a beginning worth telling. Replace this with yours: where you started, what you saw that others missed, and what you set out to do about it.
|
|
197
|
+
|
|
198
|
+
[text italic color="muted"]Tip: people trust a name and a face. A photo of you or your team does more than any paragraph.[/text]
|
|
208
199
|
[/col]
|
|
200
|
+
|
|
209
201
|
[col]
|
|
210
|
-
[
|
|
211
|
-
Analytics, smart forms, and visual effects - ready to enable with a toggle. Extend your site without touching a line of code.
|
|
212
|
-
[/card]
|
|
202
|
+
[image src="/media/starter/team-planning-meeting.jpg" alt="A team planning around a table" radius="lg" shadow="md" /]
|
|
213
203
|
[/col]
|
|
214
|
-
[/grid]
|
|
215
204
|
|
|
205
|
+
[/grid]
|
|
216
206
|
[/reveal]
|
|
217
207
|
|
|
218
|
-
[spacer /]
|
|
208
|
+
[spacer size="32" /]
|
|
219
209
|
|
|
220
|
-
##
|
|
210
|
+
## What we [text gradient="forest" words="true"]care about[/text]
|
|
221
211
|
|
|
222
|
-
[reveal animation="
|
|
212
|
+
[reveal animation="slide-up" delay="100"]
|
|
213
|
+
[grid cols="3" gap="4"]
|
|
223
214
|
|
|
224
|
-
[grid cols="4" gap="4"]
|
|
225
215
|
[col]
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
Shortcodes
|
|
231
|
-
|
|
232
|
-
</div>
|
|
216
|
+
[card title="Doing it properly" icon="check-circle" icon-layout="stacked" hover]
|
|
217
|
+
Say what you stand for. Customers remember a business that does what it says.
|
|
218
|
+
[/card]
|
|
233
219
|
[/col]
|
|
234
|
-
[col]
|
|
235
|
-
<div style="text-align:center;padding:1.5rem 0">
|
|
236
|
-
|
|
237
|
-
## [counter to="22" /]
|
|
238
|
-
|
|
239
|
-
Themes
|
|
240
220
|
|
|
241
|
-
</div>
|
|
242
|
-
[/col]
|
|
243
221
|
[col]
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
Plugins
|
|
249
|
-
|
|
250
|
-
</div>
|
|
222
|
+
[card title="Real people" icon="users" icon-layout="stacked" hover]
|
|
223
|
+
Introduce the people behind the name - who answers the phone, who does the work.
|
|
224
|
+
[/card]
|
|
251
225
|
[/col]
|
|
252
|
-
[col]
|
|
253
|
-
<div style="text-align:center;padding:1.5rem 0">
|
|
254
|
-
|
|
255
|
-
## [counter to="100" suffix="%" /]
|
|
256
|
-
|
|
257
|
-
Markdown
|
|
258
226
|
|
|
259
|
-
|
|
227
|
+
[col]
|
|
228
|
+
[card title="Close to home" icon="map-pin" icon-layout="stacked" hover]
|
|
229
|
+
Where you are and who you serve. Local customers look for exactly this.
|
|
230
|
+
[/card]
|
|
260
231
|
[/col]
|
|
261
|
-
[/grid]
|
|
262
232
|
|
|
233
|
+
[/grid]
|
|
263
234
|
[/reveal]
|
|
264
235
|
|
|
265
|
-
[spacer /]
|
|
266
|
-
|
|
267
|
-
[breathe]
|
|
268
|
-
## Our philosophy
|
|
269
|
-
[/breathe]
|
|
236
|
+
[spacer size="32" /]
|
|
270
237
|
|
|
271
|
-
[reveal animation="
|
|
238
|
+
[reveal animation="fade"]
|
|
239
|
+
[grid cols="2" gap="6"]
|
|
272
240
|
|
|
273
|
-
|
|
241
|
+
[col]
|
|
242
|
+
[image src="/media/starter/colleagues-chatting-coffee.jpg" alt="Two colleagues chatting over coffee" radius="lg" shadow="md" /]
|
|
243
|
+
[/col]
|
|
274
244
|
|
|
275
|
-
[
|
|
245
|
+
[col]
|
|
246
|
+
## Let's [text gradient="ocean" words="true"]talk[/text]
|
|
276
247
|
|
|
277
|
-
[
|
|
248
|
+
[text size="lg"]Whether you have a question or you're ready to start, we'd like to hear from you.[/text]
|
|
278
249
|
|
|
279
|
-
[
|
|
280
|
-
[
|
|
281
|
-
Domma ships with 25 shortcodes covering layout, animation, interactivity, and more - all usable straight from the Markdown editor.
|
|
250
|
+
[button href="/contact" icon="mail"]Get in touch[/button]
|
|
251
|
+
[/col]
|
|
282
252
|
|
|
283
|
-
[
|
|
284
|
-
[/
|
|
285
|
-
[/breathe]
|
|
253
|
+
[/grid]
|
|
254
|
+
[/reveal]
|
|
286
255
|
`
|
|
287
256
|
},
|
|
288
257
|
{
|
|
@@ -297,9 +266,9 @@ Domma ships with 25 shortcodes covering layout, animation, interactivity, and mo
|
|
|
297
266
|
},
|
|
298
267
|
body: `[hero variant="dark" size="lg" fullwidth="true" twinkle twinkle-count="50" blobs]
|
|
299
268
|
|
|
300
|
-
# Get in
|
|
269
|
+
# [text bold="true"]Get in [text gradient="fire" words="true"]touch[/text][/text]
|
|
301
270
|
|
|
302
|
-
[
|
|
271
|
+
[text size="xl" words="true" weight="semibold"]We'd love to [text gradient="fire" words="true"]hear from you[/text]. Send us a message and we'll get back to you shortly.[/text]
|
|
303
272
|
|
|
304
273
|
[/hero]
|
|
305
274
|
|
|
@@ -310,13 +279,15 @@ Domma ships with 25 shortcodes covering layout, animation, interactivity, and mo
|
|
|
310
279
|
[col]
|
|
311
280
|
|
|
312
281
|
[reveal animation="fade-up"]
|
|
313
|
-
[card title="Contact
|
|
282
|
+
[card title="Contact information" image="/media/starter/woman-phone-desk.jpg" image-alt="A woman at her desk checking her phone"]
|
|
314
283
|
|
|
315
284
|
<p><span data-icon="mail"></span> <strong>Email</strong><br>hello@example.com</p>
|
|
316
285
|
|
|
317
286
|
<p><span data-icon="phone"></span> <strong>Phone</strong><br>+44 20 0000 0000</p>
|
|
318
287
|
|
|
319
|
-
<p><span data-icon="clock"></span> <strong>
|
|
288
|
+
<p><span data-icon="clock"></span> <strong>Opening hours</strong><br>Monday - Friday, 9am - 5pm</p>
|
|
289
|
+
|
|
290
|
+
[text size="sm" color="muted"]Change these details in the page editor - they're only examples.[/text]
|
|
320
291
|
|
|
321
292
|
[/card]
|
|
322
293
|
[/reveal]
|
|
@@ -329,7 +300,7 @@ Domma ships with 25 shortcodes covering layout, animation, interactivity, and mo
|
|
|
329
300
|
|
|
330
301
|
[reveal animation="fade-up"]
|
|
331
302
|
|
|
332
|
-
[card title="Send
|
|
303
|
+
[card title="Send us a message"]
|
|
333
304
|
|
|
334
305
|
<div data-form="enquiries"></div>
|
|
335
306
|
|
|
@@ -1958,6 +1929,25 @@ for (const page of PAGES) {
|
|
|
1958
1929
|
console.log(` ✓ ${urlLabel || '/'}`);
|
|
1959
1930
|
}
|
|
1960
1931
|
|
|
1932
|
+
// Starter photos (CC0, see scripts/starter-media/CREDITS.md) for the pages above.
|
|
1933
|
+
// Never over a file already there: a site re-seeding keeps its own pictures.
|
|
1934
|
+
{
|
|
1935
|
+
const from = path.join(__dirname, 'starter-media');
|
|
1936
|
+
const to = path.join(ROOT, 'content', 'media', 'starter');
|
|
1937
|
+
let copied = 0;
|
|
1938
|
+
try {
|
|
1939
|
+
await mkdir(to, {recursive: true});
|
|
1940
|
+
for (const name of await readdir(from)) {
|
|
1941
|
+
if (!/\.(jpe?g|png|webp)$/i.test(name)) continue;
|
|
1942
|
+
try { await copyFile(path.join(from, name), path.join(to, name), fsConstants.COPYFILE_EXCL); copied++; }
|
|
1943
|
+
catch { /* already there */ }
|
|
1944
|
+
}
|
|
1945
|
+
console.log(` ✓ starter photos (${copied} new)`);
|
|
1946
|
+
} catch (err) {
|
|
1947
|
+
console.log(` ⚠ starter photos not copied: ${err.message}`);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1961
1951
|
process.stdout.write(' Updating navigation…');
|
|
1962
1952
|
await writeFile(NAV_CFG, JSON.stringify(SEED_NAV, null, 4) + '\n', 'utf8');
|
|
1963
1953
|
console.log(' done.');
|
|
@@ -1976,15 +1966,8 @@ for (const col of COLLECTIONS) {
|
|
|
1976
1966
|
}
|
|
1977
1967
|
|
|
1978
1968
|
await mkdir(FORMS_DIR, {recursive: true});
|
|
1979
|
-
await mkdir(SUBS_DIR, {recursive: true});
|
|
1980
1969
|
for (const form of FORMS) {
|
|
1981
1970
|
await writeFile(path.join(FORMS_DIR, `${form.slug}.json`), JSON.stringify(form.data, null, 4) + '\n', 'utf8');
|
|
1982
|
-
// Only initialise submissions file if it doesn't already exist
|
|
1983
|
-
const subsFile = path.join(SUBS_DIR, `${form.slug}.json`);
|
|
1984
|
-
try {
|
|
1985
|
-
await writeFile(subsFile, '[]\n', {encoding: 'utf8', flag: 'wx'});
|
|
1986
|
-
} catch { /* already exists */
|
|
1987
|
-
}
|
|
1988
1971
|
const colSlug = form.data.actions?.collection?.slug ?? '-';
|
|
1989
1972
|
console.log(` ✓ form: ${form.slug} → collection: ${colSlug}`);
|
|
1990
1973
|
}
|
package/scripts/setup.js
CHANGED
|
@@ -256,6 +256,10 @@ section('4. Site Identity');
|
|
|
256
256
|
if (siteTitle && site.smtp && (!site.smtp.fromName || site.smtp.fromName === previousTitle)) {
|
|
257
257
|
site.smtp.fromName = siteTitle;
|
|
258
258
|
}
|
|
259
|
+
// The navbar brand shows the site's name: rename it too, unless someone changed it.
|
|
260
|
+
if (siteTitle && site.brand && (!site.brand.text || site.brand.text === previousTitle)) {
|
|
261
|
+
site.brand.text = siteTitle;
|
|
262
|
+
}
|
|
259
263
|
await writeFile(SITE_CONFIG, JSON.stringify(site, null, 4) + '\n', 'utf8');
|
|
260
264
|
|
|
261
265
|
const nav = JSON.parse(await readFile(NAV_CONFIG, 'utf8'));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Starter photos
|
|
2
|
+
|
|
3
|
+
Copied into a new site's content/media/starter/ by scripts/seed.js. All are CC0 (public domain).
|
|
4
|
+
|
|
5
|
+
| File | Photographer | Source | Licence |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| maker-at-workbench.jpg | m0851 m0851 | https://commons.wikimedia.org/wiki/File:Craft_project_(Unsplash).jpg | CC0 (Wikimedia Commons) |
|
|
8
|
+
| colour-swatches.jpg | Markus Spiske | https://stocksnap.io/photo/colors-colours-P3GRWHODKN | CC0 (StockSnap) |
|
|
9
|
+
| woman-phone-desk.jpg | Kristin Hardwick | https://stocksnap.io/photo/browsing-smartphone-JXOLOKSWX2 | CC0 (StockSnap) |
|
|
10
|
+
| packing-parcel-shop-desk.jpg | Bench Accounting | https://stocksnap.io/photo/box-boxes-WP1KHDXGOY | CC0 (StockSnap) |
|
|
11
|
+
| team-planning-meeting.jpg | Direct Media | https://stocksnap.io/photo/business-team-W6PNBNYHM6 | CC0 (StockSnap) |
|
|
12
|
+
| colleagues-chatting-coffee.jpg | Direct Media | https://stocksnap.io/photo/business-women-BOWOZQBREK | CC0 (StockSnap) |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -123,7 +123,8 @@ export async function themeRoutes(fastify, opts = {}) {
|
|
|
123
123
|
const id = asked || saved;
|
|
124
124
|
const {dommaTheme, customClass} = resolveThemeClasses(id, cfg);
|
|
125
125
|
return {theme: id, dommaTheme, customClass, css: customClass ? compileCustomThemeCss([id]) : '',
|
|
126
|
-
font: {family: cfg.font?.adminFamily || '', stylesheet: cfg.font?.stylesheet || ''}
|
|
126
|
+
font: {family: cfg.font?.adminFamily || '', stylesheet: cfg.font?.stylesheet || ''},
|
|
127
|
+
sidebar: cfg.adminSidebar !== false};
|
|
127
128
|
});
|
|
128
129
|
|
|
129
130
|
/*
|
|
@@ -2097,6 +2097,29 @@ export function scrubCodeRegions(markdown, preserveIndented = false) {
|
|
|
2097
2097
|
return {scrubbed, restore};
|
|
2098
2098
|
}
|
|
2099
2099
|
|
|
2100
|
+
/**
|
|
2101
|
+
* marked.parse for a shortcode's BODY while later shortcodes inside it have not
|
|
2102
|
+
* run yet. Marked reads their tags as text: quotes become " and a URL turns
|
|
2103
|
+
* into a link, so [hero size="md"] inside [reveal] (or [tabs], [accordion], ...)
|
|
2104
|
+
* reached the hero as size="md" - class hero-"md" - and an
|
|
2105
|
+
* [embed url="https://..."] arrived as an <a> tag and was refused. Every tag
|
|
2106
|
+
* that carries attributes is held out of marked and put back exactly as written;
|
|
2107
|
+
* code spans and fences are left to marked, so an example tag there still shows
|
|
2108
|
+
* as code. Bare tags ([/hero], [center]) are left alone - marked does not change them.
|
|
2109
|
+
*/
|
|
2110
|
+
let shieldCallId = 0;
|
|
2111
|
+
const ATTR_TAG = /\[\/?[a-z][\w-]*\s[^\]\n]*=[^\]\n]*\](?![(\[:])/gi;
|
|
2112
|
+
function markedBody(md) {
|
|
2113
|
+
const text = String(md ?? '');
|
|
2114
|
+
if (!text.includes('=')) return marked.parse(text);
|
|
2115
|
+
const id = ++shieldCallId;
|
|
2116
|
+
const held = [];
|
|
2117
|
+
const {scrubbed, restore} = scrubCodeRegions(text);
|
|
2118
|
+
const shielded = restore(scrubbed.replace(ATTR_TAG, (tag) => { held.push(tag); return `DMSCT${id}x${held.length - 1}x`; }));
|
|
2119
|
+
if (!held.length) return marked.parse(text);
|
|
2120
|
+
return marked.parse(shielded).replace(new RegExp(`DMSCT${id}x(\\d+)x`, 'g'), (_, i) => held[Number(i)]);
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2100
2123
|
/**
|
|
2101
2124
|
* Run all plugin-registered shortcode handlers against the markdown string.
|
|
2102
2125
|
* Self-closing ([name attrs /]) and wrapping ([name attrs]...[/name]) forms are both supported.
|
|
@@ -2229,7 +2252,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2229
2252
|
// Native hover fireworks need a hit target; the base decoration ignores pointer events.
|
|
2230
2253
|
const style = hover ? ' style="pointer-events:auto;--dm-fw-size:var(--dm-fw-particle-size)"' : '';
|
|
2231
2254
|
const particles = hover ? '' : '<div class="firework-launch"></div><div class="firework-particles"></div>';
|
|
2232
|
-
const innerHtml = body === null ? '' :
|
|
2255
|
+
const innerHtml = body === null ? '' : markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2233
2256
|
return `<div class="${classes.join(' ')}"${style}>${particles}${innerHtml}</div>\n`;
|
|
2234
2257
|
});
|
|
2235
2258
|
|
|
@@ -2253,7 +2276,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2253
2276
|
if (!hasActions) {
|
|
2254
2277
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2255
2278
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2256
|
-
const innerHtml =
|
|
2279
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2257
2280
|
return `<div class="dm-fx-scribe"${dataAttrs}${styleAttrs}>${innerHtml}</div>\n`;
|
|
2258
2281
|
}
|
|
2259
2282
|
const actions = [];
|
|
@@ -2290,10 +2313,10 @@ function processEffectsBlocks(markdown) {
|
|
|
2290
2313
|
apply(name, (attrStr, body) => {
|
|
2291
2314
|
if (body === null) return '';
|
|
2292
2315
|
const attrs = parseShortcodeAttrs(attrStr);
|
|
2293
|
-
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${v}"`).join('');
|
|
2316
|
+
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${escapeAttr(String(v))}"`).join('');
|
|
2294
2317
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2295
2318
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2296
|
-
const innerHtml =
|
|
2319
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2297
2320
|
return `<div class="dm-fx-${name}"${dataAttrs}>${innerHtml}</div>\n`;
|
|
2298
2321
|
});
|
|
2299
2322
|
}
|
|
@@ -2310,7 +2333,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2310
2333
|
}
|
|
2311
2334
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2312
2335
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2313
|
-
const innerHtml =
|
|
2336
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2314
2337
|
return `<div class="dm-fx-ticker-tape" data-fx-mode="container"${dataAttrs}>${innerHtml}</div>\n`;
|
|
2315
2338
|
});
|
|
2316
2339
|
|
|
@@ -2328,7 +2351,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2328
2351
|
}
|
|
2329
2352
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2330
2353
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2331
|
-
const innerHtml =
|
|
2354
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2332
2355
|
return `<div class="dm-fx-${name}" data-fx-mode="container"${dataAttrs}>${innerHtml}</div>\n`;
|
|
2333
2356
|
});
|
|
2334
2357
|
}
|
|
@@ -2341,7 +2364,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2341
2364
|
if (attrs.duration) classes.push(`animate-duration-${attrs.duration}`);
|
|
2342
2365
|
if (attrs.delay) classes.push(`animate-delay-${attrs.delay}`);
|
|
2343
2366
|
if (attrs.repeat) classes.push(`animate-${attrs.repeat}`);
|
|
2344
|
-
return `<div class="${classes.join(' ')}">${
|
|
2367
|
+
return `<div class="${classes.join(' ')}">${markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))))}</div>\n`;
|
|
2345
2368
|
});
|
|
2346
2369
|
|
|
2347
2370
|
apply('ambient', (attrStr, body) => {
|
|
@@ -2351,7 +2374,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2351
2374
|
if (attrs.type) classes.push(`bg-ambient-${attrs.type}`);
|
|
2352
2375
|
if (attrs.speed) classes.push(`bg-ambient-${attrs.speed}`);
|
|
2353
2376
|
if (attrs.intensity) classes.push(`bg-ambient-${attrs.intensity}`);
|
|
2354
|
-
return `<div class="${classes.join(' ')}">${
|
|
2377
|
+
return `<div class="${classes.join(' ')}">${markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))))}</div>\n`;
|
|
2355
2378
|
});
|
|
2356
2379
|
|
|
2357
2380
|
return restore(result);
|
|
@@ -2423,7 +2446,7 @@ function processGridBlocks(markdown) {
|
|
|
2423
2446
|
// processCardBlocks, which creates its own empty store and fails to
|
|
2424
2447
|
// decode them, producing the literal string "undefined" in place of
|
|
2425
2448
|
// whatever was in <pre>, ``` fences, or `inline code`.
|
|
2426
|
-
return `<div${cls}${id}${injected.effectDataAttrs}>${
|
|
2449
|
+
return `<div${cls}${id}${injected.effectDataAttrs}>${markedBody(processCardBlocks(processInlineShortcodes(restore(body.trim()))))}</div>`;
|
|
2427
2450
|
}
|
|
2428
2451
|
);
|
|
2429
2452
|
|
|
@@ -2819,7 +2842,7 @@ const LAYOUT_RENDERERS = {};
|
|
|
2819
2842
|
|
|
2820
2843
|
LAYOUT_RENDERERS['basic'] = (attrs, body) => {
|
|
2821
2844
|
const im = cardImageParts(attrs, body, marked);
|
|
2822
|
-
const bodyHtml =
|
|
2845
|
+
const bodyHtml = markedBody(im.body.trim());
|
|
2823
2846
|
return `${cardRoot(attrs)}${im.media}${im.wrapBody(bodyHtml)}${cardFooterAttr(attrs)}</div>\n`;
|
|
2824
2847
|
};
|
|
2825
2848
|
|
|
@@ -2827,7 +2850,7 @@ LAYOUT_RENDERERS['header-body'] = (attrs, body) => {
|
|
|
2827
2850
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2828
2851
|
const hdr = title ? `<div class="card-header"><div class="card-title">${escapeAttr(title)}</div></div>` : '';
|
|
2829
2852
|
const im = cardImageParts(attrs, body, marked);
|
|
2830
|
-
const bodyHtml =
|
|
2853
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(im.body.trim())));
|
|
2831
2854
|
return `${cardRoot(attrs)}${im.media}${hdr}${im.wrapBody(bodyHtml)}${cardFooterAttr(attrs)}</div>\n`;
|
|
2832
2855
|
};
|
|
2833
2856
|
|
|
@@ -2836,7 +2859,7 @@ LAYOUT_RENDERERS['header-body-footer'] = (attrs, body) => {
|
|
|
2836
2859
|
const footer = typeof attrs.footer === 'string' ? attrs.footer.trim() : '';
|
|
2837
2860
|
const hdr = title ? `<div class="card-header"><div class="card-title">${escapeAttr(title)}</div></div>` : '';
|
|
2838
2861
|
const im = cardImageParts(attrs, body, marked);
|
|
2839
|
-
const bodyHtml =
|
|
2862
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(im.body.trim())));
|
|
2840
2863
|
const ftr = footer ? `<div class="card-footer">${escapeAttr(footer)}</div>` : '';
|
|
2841
2864
|
return `${cardRoot(attrs)}${im.media}${hdr}${im.wrapBody(bodyHtml)}${ftr}</div>\n`;
|
|
2842
2865
|
};
|
|
@@ -2844,7 +2867,7 @@ LAYOUT_RENDERERS['header-body-footer'] = (attrs, body) => {
|
|
|
2844
2867
|
LAYOUT_RENDERERS['no-header-footer'] = (attrs, body) => {
|
|
2845
2868
|
const footer = typeof attrs.footer === 'string' ? attrs.footer.trim() : '';
|
|
2846
2869
|
const im = cardImageParts(attrs, body, marked);
|
|
2847
|
-
const bodyHtml =
|
|
2870
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(im.body.trim())));
|
|
2848
2871
|
const ftr = footer ? `<div class="card-footer">${escapeAttr(footer)}</div>` : '';
|
|
2849
2872
|
return `${cardRoot(attrs)}${im.media}${im.wrapBody(bodyHtml)}${ftr}</div>\n`;
|
|
2850
2873
|
};
|
|
@@ -2855,7 +2878,7 @@ LAYOUT_RENDERERS['icon-top'] = (attrs, body) => {
|
|
|
2855
2878
|
const icon = typeof attrs.icon === 'string' ? attrs.icon.trim() : '';
|
|
2856
2879
|
const iconHtml = icon ? `<span data-icon="${escapeAttr(icon)}" class="card-icon"></span>` : '';
|
|
2857
2880
|
const subHtml = subtitle ? `<div class="card-subtitle">${escapeAttr(subtitle)}</div>` : '';
|
|
2858
|
-
const bodyHtml =
|
|
2881
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2859
2882
|
const ih = cardIconHeaderAttrs(attrs);
|
|
2860
2883
|
return `${cardRoot(attrs)}
|
|
2861
2884
|
<div class="card-header card-header-icon-stacked${ih.cls}"${ih.style}>
|
|
@@ -2870,7 +2893,7 @@ LAYOUT_RENDERERS['icon-inline'] = (attrs, body) => {
|
|
|
2870
2893
|
const icon = typeof attrs.icon === 'string' ? attrs.icon.trim() : '';
|
|
2871
2894
|
const iconHtml = icon ? `<span data-icon="${escapeAttr(icon)}"></span>` : '';
|
|
2872
2895
|
const subHtml = subtitle ? `<div class="card-subtitle">${escapeAttr(subtitle)}</div>` : '';
|
|
2873
|
-
const bodyHtml =
|
|
2896
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2874
2897
|
const ih = cardIconHeaderAttrs(attrs);
|
|
2875
2898
|
return `${cardRoot(attrs)}
|
|
2876
2899
|
<div class="card-header card-header-icon-inline${ih.cls}"${ih.style}>
|
|
@@ -2882,13 +2905,13 @@ LAYOUT_RENDERERS['icon-inline'] = (attrs, body) => {
|
|
|
2882
2905
|
LAYOUT_RENDERERS['image-top'] = (attrs, body) => {
|
|
2883
2906
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2884
2907
|
const hdr = title ? `<div class="card-header"><div class="card-title">${escapeAttr(title)}</div></div>` : '';
|
|
2885
|
-
const bodyHtml =
|
|
2908
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2886
2909
|
return `${cardRoot(attrs)}<div class="card-img-top"${imgStyle(attrs)}></div>${hdr}<div class="card-body">${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
2887
2910
|
};
|
|
2888
2911
|
|
|
2889
2912
|
LAYOUT_RENDERERS['image-overlay'] = (attrs, body) => {
|
|
2890
2913
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2891
|
-
const bodyHtml =
|
|
2914
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2892
2915
|
return `${cardRoot(attrs)}
|
|
2893
2916
|
<div class="card-img-overlay"${imgStyle(attrs)}>
|
|
2894
2917
|
<div class="card-overlay-text"><div class="card-title">${escapeAttr(title)}</div></div>
|
|
@@ -2898,14 +2921,14 @@ LAYOUT_RENDERERS['image-overlay'] = (attrs, body) => {
|
|
|
2898
2921
|
|
|
2899
2922
|
LAYOUT_RENDERERS['thumb-left'] = (attrs, body) => {
|
|
2900
2923
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2901
|
-
const bodyHtml =
|
|
2924
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2902
2925
|
return `${cardRoot(attrs, ['card-layout-thumb-left'])}<div class="card-img-left"${imgStyle(attrs)}></div>
|
|
2903
2926
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
2904
2927
|
};
|
|
2905
2928
|
|
|
2906
2929
|
LAYOUT_RENDERERS['thumb-right'] = (attrs, body) => {
|
|
2907
2930
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2908
|
-
const bodyHtml =
|
|
2931
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2909
2932
|
return `${cardRoot(attrs, ['card-layout-thumb-right'])}
|
|
2910
2933
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div>
|
|
2911
2934
|
<div class="card-img-right"${imgStyle(attrs)}></div></div>\n`;
|
|
@@ -2913,14 +2936,14 @@ LAYOUT_RENDERERS['thumb-right'] = (attrs, body) => {
|
|
|
2913
2936
|
|
|
2914
2937
|
LAYOUT_RENDERERS['wide-left-image'] = (attrs, body) => {
|
|
2915
2938
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2916
|
-
const bodyHtml =
|
|
2939
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2917
2940
|
return `${cardRoot(attrs, ['card-layout-horizontal'])}<div class="card-img-wide"${imgStyle(attrs)}></div>
|
|
2918
2941
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}${cardFooterAttr(attrs)}</div></div>\n`;
|
|
2919
2942
|
};
|
|
2920
2943
|
|
|
2921
2944
|
LAYOUT_RENDERERS['full-bg'] = (attrs, body) => {
|
|
2922
2945
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2923
|
-
const bodyHtml =
|
|
2946
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2924
2947
|
return `${cardRoot(attrs, ['dm-card-full-bg'])}<div class="card-img-top"${imgStyle(attrs)}></div>
|
|
2925
2948
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
2926
2949
|
};
|
|
@@ -2928,7 +2951,7 @@ LAYOUT_RENDERERS['full-bg'] = (attrs, body) => {
|
|
|
2928
2951
|
LAYOUT_RENDERERS['split-half'] = (attrs, body) => {
|
|
2929
2952
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2930
2953
|
const gradient = typeof attrs.gradient === 'string' ? attrs.gradient.trim() : 'indigo';
|
|
2931
|
-
const bodyHtml =
|
|
2954
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2932
2955
|
return `${cardRoot(attrs, ['card-layout-split'])}<div class="card-split-left card-gradient-${escapeAttr(gradient)}"${imgStyle(attrs)}></div>
|
|
2933
2956
|
<div class="card-split-right"><div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div></div></div>\n`;
|
|
2934
2957
|
};
|
|
@@ -2944,7 +2967,7 @@ LAYOUT_RENDERERS['avatar-profile'] = (attrs, body) => {
|
|
|
2944
2967
|
const tags = typeof attrs.tags === 'string' ? attrs.tags.split(',').map(t => t.trim()).filter(Boolean) : [];
|
|
2945
2968
|
const tagHtml = tags.length ? `<div class="card-tag-pills">${tags.map(t => `<span class="card-pill">${escapeAttr(t)}</span>`).join('')}</div>` : '';
|
|
2946
2969
|
const iconHtml = icon ? `<span data-icon="${icon}"></span>` : '';
|
|
2947
|
-
const bodyHtml = body.trim() ? `<div class="card-body">${
|
|
2970
|
+
const bodyHtml = body.trim() ? `<div class="card-body">${markedBody(body.trim())}</div>` : '';
|
|
2948
2971
|
return `${cardRoot(attrs)}<div class="card-avatar-wrap">
|
|
2949
2972
|
<div class="card-avatar">${iconHtml}</div>
|
|
2950
2973
|
${title ? `<div class="card-title">${title}</div>` : ''}
|
|
@@ -2969,7 +2992,7 @@ LAYOUT_RENDERERS['stat-metric'] = (attrs, _body) => {
|
|
|
2969
2992
|
LAYOUT_RENDERERS['quote-testimonial'] = (attrs, body) => {
|
|
2970
2993
|
const author = escapeAttr(attrs.title || '');
|
|
2971
2994
|
const role = escapeAttr(attrs.subtitle || '');
|
|
2972
|
-
const bodyHtml = body.trim() ?
|
|
2995
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
2973
2996
|
return `${cardRoot(attrs)}<span class="card-quote-mark">\u201c</span>
|
|
2974
2997
|
<div class="card-quote-text">${bodyHtml}</div>
|
|
2975
2998
|
<div class="card-footer card-quote-attr">
|
|
@@ -2983,7 +3006,7 @@ LAYOUT_RENDERERS['callout'] = (attrs, body) => {
|
|
|
2983
3006
|
const defaults = {info: '💡', warn: '⚠️', success: '✅', error: '❌'};
|
|
2984
3007
|
const icon = escapeAttr(attrs.icon || defaults[type] || '💡');
|
|
2985
3008
|
const title = escapeAttr(attrs.title || '');
|
|
2986
|
-
const bodyHtml =
|
|
3009
|
+
const bodyHtml = markedBody(body.trim());
|
|
2987
3010
|
return `${cardRoot(attrs, ['card-callout', type])}<div class="card-callout-inner card-body">
|
|
2988
3011
|
<div class="card-callout-icon"><span data-icon="${icon}"></span></div>
|
|
2989
3012
|
<div>${title ? `<div class="card-title">${title}</div>` : ''}${bodyHtml}</div>
|
|
@@ -2993,7 +3016,7 @@ LAYOUT_RENDERERS['callout'] = (attrs, body) => {
|
|
|
2993
3016
|
LAYOUT_RENDERERS['video-media'] = (attrs, body) => {
|
|
2994
3017
|
const title = escapeAttr(attrs.title || '');
|
|
2995
3018
|
const duration = escapeAttr(attrs.duration || '');
|
|
2996
|
-
const bodyHtml = body.trim() ?
|
|
3019
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
2997
3020
|
const dur = duration ? `<div class="card-video-duration">${duration}</div>` : '';
|
|
2998
3021
|
return `${cardRoot(attrs)}<div class="card-video-thumb"${imgStyle(attrs)}>
|
|
2999
3022
|
<div class="card-play-btn">\u25B6</div>${dur}
|
|
@@ -3004,7 +3027,7 @@ LAYOUT_RENDERERS['video-media'] = (attrs, body) => {
|
|
|
3004
3027
|
LAYOUT_RENDERERS['location-map'] = (attrs, body) => {
|
|
3005
3028
|
const address = escapeAttr(attrs.address || '');
|
|
3006
3029
|
const title = escapeAttr(attrs.title || '');
|
|
3007
|
-
const bodyHtml = body.trim() ?
|
|
3030
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3008
3031
|
return `${cardRoot(attrs)}<div class="card-map-placeholder">
|
|
3009
3032
|
<div class="card-map-grid"></div><div class="card-map-pin">📍</div>
|
|
3010
3033
|
</div>${title || address ? `<div class="card-body">${title ? `<div class="card-title">${title}</div>` : ''}${address ? `<div class="card-subtitle">${address}</div>` : ''}${bodyHtml}</div>` : ''}</div>\n`;
|
|
@@ -3014,7 +3037,7 @@ LAYOUT_RENDERERS['step-numbered'] = (attrs, body) => {
|
|
|
3014
3037
|
const step = escapeAttr(String(attrs.step || '1'));
|
|
3015
3038
|
const title = escapeAttr(attrs.title || '');
|
|
3016
3039
|
const gradient = escapeAttr(attrs.gradient || 'indigo');
|
|
3017
|
-
const bodyHtml = body.trim() ?
|
|
3040
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3018
3041
|
return `${cardRoot(attrs)}<div class="card-step-bg card-gradient-${gradient}">
|
|
3019
3042
|
<div class="card-step-badge">${step}</div>
|
|
3020
3043
|
<div class="card-step-ghost">${step}</div>
|
|
@@ -3026,7 +3049,7 @@ LAYOUT_RENDERERS['corner-badge'] = (attrs, body) => {
|
|
|
3026
3049
|
const badge = escapeAttr(attrs.badge || 'New');
|
|
3027
3050
|
const title = escapeAttr(attrs.title || '');
|
|
3028
3051
|
const icon = escapeAttr(attrs.icon || '');
|
|
3029
|
-
const bodyHtml = body.trim() ?
|
|
3052
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3030
3053
|
return `${cardRoot(attrs, ['card-corner-badge-wrap'])}<span class="card-corner-badge">${badge}</span>
|
|
3031
3054
|
${icon ? `<div style="display:flex;justify-content:center;padding:18px 16px 4px"><span data-icon="${icon}" style="font-size:2rem"></span></div>` : ''}
|
|
3032
3055
|
<div class="card-body" style="text-align:center">${title ? `<div class="card-title">${title}</div>` : ''}${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
@@ -3037,7 +3060,7 @@ LAYOUT_RENDERERS['badge-band'] = (attrs, body) => {
|
|
|
3037
3060
|
const icon = escapeAttr(attrs.icon || '');
|
|
3038
3061
|
const gradient = escapeAttr(attrs.gradient || 'indigo');
|
|
3039
3062
|
const title = escapeAttr(attrs.title || '');
|
|
3040
|
-
const bodyHtml = body.trim() ?
|
|
3063
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3041
3064
|
return `${cardRoot(attrs)}<div class="card-badge-band card-gradient-${gradient}">
|
|
3042
3065
|
<span class="card-badge-band-label">${badge}</span>
|
|
3043
3066
|
${icon ? `<span class="card-badge-band-icon" data-icon="${icon}"></span>` : ''}
|
|
@@ -3047,7 +3070,7 @@ LAYOUT_RENDERERS['badge-band'] = (attrs, body) => {
|
|
|
3047
3070
|
|
|
3048
3071
|
LAYOUT_RENDERERS['glass-gradient-border'] = (attrs, body) => {
|
|
3049
3072
|
const title = escapeAttr(attrs.title || '');
|
|
3050
|
-
const bodyHtml =
|
|
3073
|
+
const bodyHtml = markedBody(body.trim());
|
|
3051
3074
|
return `<div class="card-glass-outer mb-4">
|
|
3052
3075
|
<div class="card-glass-inner">
|
|
3053
3076
|
${title ? `<div class="card-title">${title}</div>` : ''}<div>${bodyHtml}</div>
|
|
@@ -3060,7 +3083,7 @@ LAYOUT_RENDERERS['rating-review'] = (attrs, body) => {
|
|
|
3060
3083
|
const author = escapeAttr(attrs.title || '');
|
|
3061
3084
|
const role = escapeAttr(attrs.subtitle || '');
|
|
3062
3085
|
const verified = 'verified' in attrs;
|
|
3063
|
-
const bodyHtml = body.trim() ?
|
|
3086
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3064
3087
|
return `${cardRoot(attrs)}<span class="card-stars">${stars}</span>
|
|
3065
3088
|
<div class="card-quote-text">${bodyHtml}</div>
|
|
3066
3089
|
<div class="card-footer card-quote-attr">
|
|
@@ -3074,7 +3097,7 @@ LAYOUT_RENDERERS['tag-cloud'] = (attrs, body) => {
|
|
|
3074
3097
|
const title = escapeAttr(attrs.title || '');
|
|
3075
3098
|
const tagAttr = typeof attrs.tags === 'string' ? attrs.tags.split(',').map(t => t.trim()).filter(Boolean) : [];
|
|
3076
3099
|
const tagHtml = tagAttr.map((t, i) => `<span class="card-tag" style="${tagColorStyle(i)}">${escapeAttr(t)}</span>`).join('');
|
|
3077
|
-
const bodyHtml = body.trim() ?
|
|
3100
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3078
3101
|
return `${cardRoot(attrs)}${title ? `<div class="card-header"><div class="card-title">${title}</div></div>` : ''}
|
|
3079
3102
|
<div class="card-tag-cloud">${tagHtml}${bodyHtml}</div></div>\n`;
|
|
3080
3103
|
};
|
|
@@ -3083,7 +3106,7 @@ LAYOUT_RENDERERS['timeline-entry'] = (attrs, body) => {
|
|
|
3083
3106
|
const date = escapeAttr(attrs.subtitle || '');
|
|
3084
3107
|
const title = escapeAttr(attrs.title || '');
|
|
3085
3108
|
const tag = escapeAttr(attrs.badge || '');
|
|
3086
|
-
const bodyHtml = body.trim() ?
|
|
3109
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3087
3110
|
return `${cardRoot(attrs)}<div class="card-timeline-row">
|
|
3088
3111
|
<div class="card-timeline-side"><div class="card-timeline-dot"></div><div class="card-timeline-line"></div></div>
|
|
3089
3112
|
<div class="card-timeline-body">
|
|
@@ -3509,7 +3532,7 @@ function processTabsBlocks(markdown) {
|
|
|
3509
3532
|
// so fenced code blocks render as <pre><code> rather than surviving as raw text
|
|
3510
3533
|
// that would confuse subsequent scrubCodeRegions calls.
|
|
3511
3534
|
const restoredBody = restore(tabBody.trim());
|
|
3512
|
-
const bodyHtml =
|
|
3535
|
+
const bodyHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restoredBody))));
|
|
3513
3536
|
const icon = tabAttrs.icon ? tabAttrs.icon.trim() : '';
|
|
3514
3537
|
items.push({title, icon, paneId, bodyHtml, first: tabIdx === 1});
|
|
3515
3538
|
});
|
|
@@ -3564,7 +3587,7 @@ function processAccordionBlocks(markdown) {
|
|
|
3564
3587
|
body.replace(/\[item([^\]]*)\]([\s\S]*?)\[\/item\]/gi, (__, itemAttr, itemBody) => {
|
|
3565
3588
|
const itemAttrs = parseShortcodeAttrs(itemAttr);
|
|
3566
3589
|
const title = itemAttrs.title || 'Item';
|
|
3567
|
-
const bodyHtml =
|
|
3590
|
+
const bodyHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(itemBody.trim())))));
|
|
3568
3591
|
items += (
|
|
3569
3592
|
`<div class="accordion-item">\n` +
|
|
3570
3593
|
` <h3 class="accordion-header"><button class="accordion-button" type="button">${escapeAttr(title)}` +
|
|
@@ -3637,7 +3660,7 @@ function processCarouselBlocks(markdown) {
|
|
|
3637
3660
|
if (slideAttrs.image) {
|
|
3638
3661
|
inner += `<img src="${escapeAttr(slideAttrs.image)}" alt="${escapeAttr(slideAttrs.title || '')}">\n`;
|
|
3639
3662
|
}
|
|
3640
|
-
const contentHtml =
|
|
3663
|
+
const contentHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(slideBody.trim())))));
|
|
3641
3664
|
if (slideAttrs.title || slideBody.trim()) {
|
|
3642
3665
|
inner += `<div class="carousel-slide-content">`;
|
|
3643
3666
|
if (slideAttrs.title) inner += `<h2 class="carousel-slide-title">${escapeAttr(slideAttrs.title)}</h2>`;
|
|
@@ -3740,7 +3763,7 @@ function processTimelineBlocks(markdown) {
|
|
|
3740
3763
|
const status = ia.status ? ` data-status="${escapeAttr(ia.status)}"` : '';
|
|
3741
3764
|
// data-event-icon, never data-icon - see renderCollectionTimeline: the icon scanner would empty the item.
|
|
3742
3765
|
const icon = ia.icon ? ` data-event-icon="${escapeAttr(ia.icon)}"` : '';
|
|
3743
|
-
const descHtml =
|
|
3766
|
+
const descHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(itemBody.trim())))));
|
|
3744
3767
|
return `<div class="dm-progression-item"${date}${status}${icon}><div class="dm-progression-item-title">${title}</div><div class="dm-progression-item-body">${descHtml}</div></div>`;
|
|
3745
3768
|
}
|
|
3746
3769
|
);
|
|
@@ -4960,7 +4983,7 @@ function processHeroBlocks(markdown) {
|
|
|
4960
4983
|
inner += '<div class="hero-content">';
|
|
4961
4984
|
if (title) inner += `<h1 class="hero-title hero-title-responsive">${escapeAttr(title)}</h1>`;
|
|
4962
4985
|
if (tagline) inner += `<p class="hero-subtitle hero-subtitle-responsive">${escapeAttr(tagline)}</p>`;
|
|
4963
|
-
if (processedBody) inner += `<div class="hero-body">${
|
|
4986
|
+
if (processedBody) inner += `<div class="hero-body">${markedBody(processedBody)}</div>`;
|
|
4964
4987
|
inner += '</div>';
|
|
4965
4988
|
|
|
4966
4989
|
return `<div class="${classes.join(' ')}"${idAttr}${style}${injected.effectDataAttrs}>${inner}</div>\n`;
|
|
@@ -5026,7 +5049,7 @@ function processBannerBlocks(markdown) {
|
|
|
5026
5049
|
const titleHtml = title
|
|
5027
5050
|
? `<strong class="dm-banner__title">${escapeAttr(title)}</strong>\n `
|
|
5028
5051
|
: '';
|
|
5029
|
-
const bodyHtml =
|
|
5052
|
+
const bodyHtml = markedBody(body.trim());
|
|
5030
5053
|
const dismissHtml = dismissible
|
|
5031
5054
|
? `\n <button type="button" class="dm-banner__dismiss" aria-label="Dismiss">×</button>`
|
|
5032
5055
|
: '';
|
|
@@ -5055,7 +5078,7 @@ function processSlideoverBlocks(markdown) {
|
|
|
5055
5078
|
const trigger = escapeAttr(attrs.trigger || 'Open');
|
|
5056
5079
|
const size = escapeAttr(attrs.size || 'md');
|
|
5057
5080
|
const position = escapeAttr(attrs.position || 'right');
|
|
5058
|
-
const bodyHtml =
|
|
5081
|
+
const bodyHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
5059
5082
|
return (
|
|
5060
5083
|
`<button class="btn btn-link dm-so-trigger" data-so-target="${id}">${trigger}</button>\n` +
|
|
5061
5084
|
`<div class="dm-so-content" id="${id}" style="display:none" ` +
|
|
@@ -88,6 +88,10 @@ export function defaultThemeConfig() {
|
|
|
88
88
|
nightStart: '19:00'
|
|
89
89
|
},
|
|
90
90
|
font: {family: 'Roboto', size: 16},
|
|
91
|
+
// Whether the side admin menu shows for someone who has not chosen (the
|
|
92
|
+
// Versions panel's "Show side admin menu" is each person's own choice, kept
|
|
93
|
+
// in their browser). New self-hosted sites start with it off.
|
|
94
|
+
adminSidebar: true,
|
|
91
95
|
// The public theme switcher - a floating disc of theme dots. Off by
|
|
92
96
|
// default: a visitor-facing theme picker is a choice a site makes, not
|
|
93
97
|
// something it should acquire by upgrading.
|
|
@@ -414,7 +418,8 @@ export function themeConfigFromSite(site = {}) {
|
|
|
414
418
|
adminTheme: site.adminTheme,
|
|
415
419
|
baseTheme: site.baseTheme || null,
|
|
416
420
|
autoTheme: site.autoTheme,
|
|
417
|
-
font: {family: site.fontFamily, size: site.fontSize},
|
|
421
|
+
font: {family: site.fontFamily, size: site.fontSize, adminFamily: site.adminFontFamily},
|
|
422
|
+
adminSidebar: site.adminSidebar,
|
|
418
423
|
overrides: []
|
|
419
424
|
});
|
|
420
425
|
}
|
|
@@ -684,6 +689,9 @@ export function validateThemeConfig(input, {remembered = []} = {}) {
|
|
|
684
689
|
}
|
|
685
690
|
}
|
|
686
691
|
}
|
|
692
|
+
if (input.adminSidebar !== undefined && typeof input.adminSidebar !== 'boolean') {
|
|
693
|
+
errors.push('adminSidebar must be true or false');
|
|
694
|
+
}
|
|
687
695
|
if (input.font) {
|
|
688
696
|
if (input.font.stylesheet && !isFontStylesheet(input.font.stylesheet)) {
|
|
689
697
|
errors.push('Font stylesheet must be a CSS file under /public/fonts/, for example /public/fonts/brand.css');
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"slug": "sproj-1779696558011-menu",
|
|
3
|
-
"name": "Test menu",
|
|
4
|
-
"description": "",
|
|
5
|
-
"items": [
|
|
6
|
-
{
|
|
7
|
-
"text": "X",
|
|
8
|
-
"url": "/x"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"meta": {
|
|
12
|
-
"createdAt": "2026-05-25T08:09:18.015Z",
|
|
13
|
-
"updatedAt": "2026-05-25T08:09:18.015Z",
|
|
14
|
-
"bundled": true,
|
|
15
|
-
"presetOwner": "test-scaff-project"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"slug": "sproj-1779696960337-menu",
|
|
3
|
-
"name": "Test menu",
|
|
4
|
-
"description": "",
|
|
5
|
-
"items": [
|
|
6
|
-
{
|
|
7
|
-
"text": "X",
|
|
8
|
-
"url": "/x"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"meta": {
|
|
12
|
-
"createdAt": "2026-05-25T08:16:00.349Z",
|
|
13
|
-
"updatedAt": "2026-05-25T08:16:00.349Z",
|
|
14
|
-
"bundled": true,
|
|
15
|
-
"presetOwner": "test-scaff-project",
|
|
16
|
-
"project": "sproj-1779696960337"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"slug": "sproj-1779696985353-menu",
|
|
3
|
-
"name": "Test menu",
|
|
4
|
-
"description": "",
|
|
5
|
-
"items": [
|
|
6
|
-
{
|
|
7
|
-
"text": "X",
|
|
8
|
-
"url": "/x"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"meta": {
|
|
12
|
-
"createdAt": "2026-05-25T08:16:25.364Z",
|
|
13
|
-
"updatedAt": "2026-05-25T08:16:25.364Z",
|
|
14
|
-
"bundled": true,
|
|
15
|
-
"presetOwner": "test-scaff-project",
|
|
16
|
-
"project": "sproj-1779696985353"
|
|
17
|
-
}
|
|
18
|
-
}
|