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
20
docs/seo.md
20
docs/seo.md
|
|
@ -11,6 +11,14 @@ in `server/src/pageMeta.js`). It also serves `/sitemap.xml`.
|
|||
|
||||
## Where the words come from
|
||||
|
||||
Everything below can also be set in the admin, under **Panel → Site
|
||||
settings** (superadmins only): 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. A setting there wins; a
|
||||
blank one falls back to `site.json`. The indexing switch is per
|
||||
database, so the dev server can be off while production is on, from the
|
||||
same build.
|
||||
|
||||
| What | Where |
|
||||
| --- | --- |
|
||||
| Site name, address, default description | `site.json`: `title`, `url`, `description` (blank uses the front page's subhead) |
|
||||
|
|
@ -83,6 +91,18 @@ with it off it blocks everything.
|
|||
try_files /index.html =404;
|
||||
}
|
||||
|
||||
# From the API, so Site settings' indexing switch applies; the
|
||||
# build's own robots.txt if the API is down.
|
||||
location = /robots.txt {
|
||||
proxy_pass http://127.0.0.1:3001;
|
||||
proxy_intercept_errors on;
|
||||
error_page 500 502 503 504 = @file;
|
||||
}
|
||||
|
||||
location @file {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Uploads are bigger than the /api/ block's 64k limit allows.
|
||||
location = /api/admin/media {
|
||||
proxy_pass http://127.0.0.1:3001;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ what a dropdown in the admin editor says.
|
|||
| The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) |
|
||||
| The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) |
|
||||
| Navigation, page section titles, colours, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) |
|
||||
| A static page's title and intro (also its search title and description), the site's name, address and default preview image | `site.json` | editing `pages`, `title`, `url`, `openGraph.image`. See `docs/seo.md` |
|
||||
| A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` |
|
||||
| Uploaded images | disk + the `media` table | Admin → Tools → Media, or any image field. See `docs/media-uploads.md` |
|
||||
|
||||
The rule of thumb from `CLAUDE.md`: data belongs in the database,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue