domma-cms 1.43.0 → 1.44.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/CHANGELOG.md +9 -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 +4 -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/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,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.44.0] - 2026-11-08
|
|
4
|
+
|
|
5
|
+
- **New self-hosted sites look like domma-cms.com.** What `npx domma-cms <name>` makes:
|
|
6
|
+
- 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.
|
|
7
|
+
- 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.
|
|
8
|
+
- Nunito Sans on the site and in the admin, and the **Atelier Dark** admin.
|
|
9
|
+
- 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.
|
|
10
|
+
- 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.
|
|
11
|
+
|
|
3
12
|
## [1.43.0] - 2026-11-08
|
|
4
13
|
|
|
5
14
|
- **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.9.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.9.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,8 @@ 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.
|
|
2412
2414
|
- 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
2415
|
- 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
2416
|
- 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
|
/*
|
|
@@ -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
|
-
}
|