Add Site settings: name, description, icons, page titles, indexing
Panel → Site settings (migration 035, superadmins only) edits the site's name, description, preview image, favicon and home-screen icon, each static page's title and intro, and whether search engines may list the site. Every value overrides site.json; a blank one falls back to it. The indexing switch is per database, so the dev server can be off while production is on from one build. The server merges the two (siteFor in pageMeta.js) for page metadata, the sitemap and a new /robots.txt route, and writes the merged wording into each page as window.__NGU_SITE__, which site.ts reads so headings match with no extra request. Entities can now require a higher role to save (writeRole), checked on both sides. Panel is a menu group with Accounts and server, and Site settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8ec34ea185
commit
47df7b1fe0
15 changed files with 393 additions and 32 deletions
|
|
@ -904,6 +904,47 @@ const communityPage = {
|
|||
],
|
||||
};
|
||||
|
||||
/* ── Site settings (035_site_settings.sql) ──────────────────────
|
||||
A singleton of overrides for what site.json says: name,
|
||||
description, preview image, icons, search indexing, and static
|
||||
pages' titles and intros. Superadmins only. pageMeta.js merges it
|
||||
over site.json. */
|
||||
const siteSettings = {
|
||||
key: "site_settings",
|
||||
table: "site_settings",
|
||||
idColumn: "id",
|
||||
idKind: "slug",
|
||||
singleton: "site",
|
||||
concurrency: "updated_at",
|
||||
writeRole: "superadmin",
|
||||
|
||||
list: {
|
||||
columns: ["id", "site_name", "updated_at"],
|
||||
filters: [],
|
||||
search: [],
|
||||
order: "id",
|
||||
},
|
||||
|
||||
columns: [
|
||||
text("site_name"),
|
||||
text("description"),
|
||||
text("preview_image"),
|
||||
text("favicon"),
|
||||
text("apple_touch_icon"),
|
||||
enumeration("indexing", ["on", "off"]),
|
||||
],
|
||||
|
||||
children: [
|
||||
{
|
||||
key: "pages",
|
||||
table: "site_setting_pages",
|
||||
owner: { column: "settings_id" },
|
||||
order: "sort_order",
|
||||
columns: [text("path", { required: true }), text("title"), text("description")],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const ENTITIES = {
|
||||
organizations,
|
||||
events,
|
||||
|
|
@ -914,6 +955,7 @@ export const ENTITIES = {
|
|||
front_page: frontPage,
|
||||
blog_posts: blogPosts,
|
||||
community_page: communityPage,
|
||||
site_settings: siteSettings,
|
||||
};
|
||||
|
||||
/* ── Options for the form's select inputs ────────────────────── */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue