@geekity/cms 0.3.0 → 0.5.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/README.md +2217 -214
- package/admin/components/fields.njk +165 -0
- package/admin/layouts/base.njk +1 -1
- package/admin/layouts/settings-page.njk +26 -0
- package/admin/layouts/shell.njk +17 -3
- package/admin/pages/account/forgot.njk +47 -0
- package/admin/pages/account/login.njk +26 -0
- package/admin/pages/account/reset.njk +38 -0
- package/admin/pages/account/setup.njk +28 -0
- package/admin/pages/appearance/themes.njk +69 -0
- package/admin/pages/comments/all.njk +133 -0
- package/admin/{layouts/dashboard.njk → pages/dashboard/home.njk} +8 -15
- package/admin/{layouts/document-conflict.njk → pages/documents/conflict.njk} +1 -0
- package/admin/{layouts/document-editor.njk → pages/documents/editor.njk} +75 -59
- package/admin/{layouts/document-list.njk → pages/documents/list.njk} +19 -2
- package/admin/pages/documents/taxonomy.njk +95 -0
- package/admin/pages/federation/followers.njk +238 -0
- package/admin/pages/federation/settings.njk +77 -0
- package/admin/pages/media/library.njk +160 -0
- package/admin/pages/messages/all.njk +110 -0
- package/admin/pages/navigation/menus.njk +129 -0
- package/admin/{layouts → pages}/placeholder.njk +5 -1
- package/admin/pages/settings/discussion.njk +99 -0
- package/admin/pages/settings/email.njk +203 -0
- package/admin/pages/settings/general.njk +29 -0
- package/admin/pages/settings/permalinks.njk +50 -0
- package/admin/pages/settings/reading.njk +64 -0
- package/admin/pages/tools/content-index.njk +89 -0
- package/admin/pages/users/edit.njk +239 -0
- package/admin/pages/users/list.njk +51 -0
- package/admin/pages/users/new.njk +41 -0
- package/admin/static/admin.css +558 -3
- package/admin/static/copy.js +52 -0
- package/admin/static/editor.js +16 -16
- package/admin/static/slug.js +61 -0
- package/dist/access-log.d.ts +44 -0
- package/dist/access-log.d.ts.map +1 -0
- package/dist/access-log.js +71 -0
- package/dist/access-log.js.map +1 -0
- package/dist/admin/accounts.d.ts +413 -0
- package/dist/admin/accounts.d.ts.map +1 -0
- package/dist/admin/accounts.js +680 -0
- package/dist/admin/accounts.js.map +1 -0
- package/dist/admin/appearance.d.ts +80 -0
- package/dist/admin/appearance.d.ts.map +1 -0
- package/dist/admin/appearance.js +136 -0
- package/dist/admin/appearance.js.map +1 -0
- package/dist/admin/comments.d.ts +90 -0
- package/dist/admin/comments.d.ts.map +1 -0
- package/dist/admin/comments.js +244 -0
- package/dist/admin/comments.js.map +1 -0
- package/dist/admin/credentials.d.ts +26 -2
- package/dist/admin/credentials.d.ts.map +1 -1
- package/dist/admin/credentials.js +35 -2
- package/dist/admin/credentials.js.map +1 -1
- package/dist/admin/documents.d.ts +117 -10
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +328 -41
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/federation.d.ts +161 -50
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +235 -93
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/formatting.d.ts +20 -0
- package/dist/admin/formatting.d.ts.map +1 -0
- package/dist/admin/formatting.js +72 -0
- package/dist/admin/formatting.js.map +1 -0
- package/dist/admin/headers.d.ts +65 -0
- package/dist/admin/headers.d.ts.map +1 -0
- package/dist/admin/headers.js +104 -0
- package/dist/admin/headers.js.map +1 -0
- package/dist/admin/index.d.ts +38 -12
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +25 -7
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/media.d.ts +168 -0
- package/dist/admin/media.d.ts.map +1 -0
- package/dist/admin/media.js +295 -0
- package/dist/admin/media.js.map +1 -0
- package/dist/admin/menu.d.ts +79 -0
- package/dist/admin/menu.d.ts.map +1 -0
- package/dist/admin/menu.js +143 -0
- package/dist/admin/menu.js.map +1 -0
- package/dist/admin/messages.d.ts +80 -0
- package/dist/admin/messages.d.ts.map +1 -0
- package/dist/admin/messages.js +152 -0
- package/dist/admin/messages.js.map +1 -0
- package/dist/admin/navigation.d.ts +155 -0
- package/dist/admin/navigation.d.ts.map +1 -0
- package/dist/admin/navigation.js +292 -0
- package/dist/admin/navigation.js.map +1 -0
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +31 -7
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/recovery.d.ts +92 -0
- package/dist/admin/recovery.d.ts.map +1 -0
- package/dist/admin/recovery.js +229 -0
- package/dist/admin/recovery.js.map +1 -0
- package/dist/admin/routes.d.ts +0 -20
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +164 -105
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/session.d.ts +17 -3
- package/dist/admin/session.d.ts.map +1 -1
- package/dist/admin/session.js +19 -5
- package/dist/admin/session.js.map +1 -1
- package/dist/admin/settings-discussion.d.ts +37 -0
- package/dist/admin/settings-discussion.d.ts.map +1 -0
- package/dist/admin/settings-discussion.js +117 -0
- package/dist/admin/settings-discussion.js.map +1 -0
- package/dist/admin/settings-email.d.ts +54 -0
- package/dist/admin/settings-email.d.ts.map +1 -0
- package/dist/admin/settings-email.js +189 -0
- package/dist/admin/settings-email.js.map +1 -0
- package/dist/admin/settings-federation.d.ts +48 -0
- package/dist/admin/settings-federation.d.ts.map +1 -0
- package/dist/admin/settings-federation.js +123 -0
- package/dist/admin/settings-federation.js.map +1 -0
- package/dist/admin/settings-general.d.ts +12 -0
- package/dist/admin/settings-general.d.ts.map +1 -0
- package/dist/admin/settings-general.js +48 -0
- package/dist/admin/settings-general.js.map +1 -0
- package/dist/admin/settings-page.d.ts +119 -0
- package/dist/admin/settings-page.d.ts.map +1 -0
- package/dist/admin/settings-page.js +132 -0
- package/dist/admin/settings-page.js.map +1 -0
- package/dist/admin/settings-pages.d.ts +30 -0
- package/dist/admin/settings-pages.d.ts.map +1 -0
- package/dist/admin/settings-pages.js +43 -0
- package/dist/admin/settings-pages.js.map +1 -0
- package/dist/admin/settings-permalinks.d.ts +16 -0
- package/dist/admin/settings-permalinks.d.ts.map +1 -0
- package/dist/admin/settings-permalinks.js +32 -0
- package/dist/admin/settings-permalinks.js.map +1 -0
- package/dist/admin/settings-reading.d.ts +34 -0
- package/dist/admin/settings-reading.d.ts.map +1 -0
- package/dist/admin/settings-reading.js +49 -0
- package/dist/admin/settings-reading.js.map +1 -0
- package/dist/admin/settings.d.ts +339 -96
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +600 -308
- package/dist/admin/settings.js.map +1 -1
- package/dist/admin/store.d.ts +606 -152
- package/dist/admin/store.d.ts.map +1 -1
- package/dist/admin/store.js +863 -268
- package/dist/admin/store.js.map +1 -1
- package/dist/admin/taxonomy.d.ts +114 -0
- package/dist/admin/taxonomy.d.ts.map +1 -0
- package/dist/admin/taxonomy.js +289 -0
- package/dist/admin/taxonomy.js.map +1 -0
- package/dist/admin/templates.d.ts +46 -14
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +46 -14
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/throttle.d.ts +84 -0
- package/dist/admin/throttle.d.ts.map +1 -0
- package/dist/admin/throttle.js +143 -0
- package/dist/admin/throttle.js.map +1 -0
- package/dist/admin/tools.d.ts +111 -0
- package/dist/admin/tools.d.ts.map +1 -0
- package/dist/admin/tools.js +182 -0
- package/dist/admin/tools.js.map +1 -0
- package/dist/admin/uploads.d.ts +28 -2
- package/dist/admin/uploads.d.ts.map +1 -1
- package/dist/admin/uploads.js +43 -4
- package/dist/admin/uploads.js.map +1 -1
- package/dist/admin/users.d.ts +100 -13
- package/dist/admin/users.d.ts.map +1 -1
- package/dist/admin/users.js +412 -39
- package/dist/admin/users.js.map +1 -1
- package/dist/cache.d.ts +141 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +207 -0
- package/dist/cache.js.map +1 -0
- package/dist/cli.d.ts +14 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +429 -21
- package/dist/cli.js.map +1 -1
- package/dist/comments/akismet.d.ts +130 -0
- package/dist/comments/akismet.d.ts.map +1 -0
- package/dist/comments/akismet.js +274 -0
- package/dist/comments/akismet.js.map +1 -0
- package/dist/comments/conversation.d.ts +29 -0
- package/dist/comments/conversation.d.ts.map +1 -0
- package/dist/comments/conversation.js +60 -0
- package/dist/comments/conversation.js.map +1 -0
- package/dist/comments/form.d.ts +123 -0
- package/dist/comments/form.d.ts.map +1 -0
- package/dist/comments/form.js +79 -0
- package/dist/comments/form.js.map +1 -0
- package/dist/comments/index.d.ts +16 -0
- package/dist/comments/index.d.ts.map +1 -0
- package/dist/comments/index.js +10 -0
- package/dist/comments/index.js.map +1 -0
- package/dist/comments/markdown.d.ts +8 -0
- package/dist/comments/markdown.d.ts.map +1 -0
- package/dist/comments/markdown.js +85 -0
- package/dist/comments/markdown.js.map +1 -0
- package/dist/comments/moderate.d.ts +71 -0
- package/dist/comments/moderate.d.ts.map +1 -0
- package/dist/comments/moderate.js +88 -0
- package/dist/comments/moderate.js.map +1 -0
- package/dist/comments/policy.d.ts +57 -0
- package/dist/comments/policy.d.ts.map +1 -0
- package/dist/comments/policy.js +80 -0
- package/dist/comments/policy.js.map +1 -0
- package/dist/comments/records.d.ts +266 -0
- package/dist/comments/records.d.ts.map +1 -0
- package/dist/comments/records.js +487 -0
- package/dist/comments/records.js.map +1 -0
- package/dist/comments/routes.d.ts +60 -0
- package/dist/comments/routes.d.ts.map +1 -0
- package/dist/comments/routes.js +212 -0
- package/dist/comments/routes.js.map +1 -0
- package/dist/comments/submission.d.ts +297 -0
- package/dist/comments/submission.d.ts.map +1 -0
- package/dist/comments/submission.js +280 -0
- package/dist/comments/submission.js.map +1 -0
- package/dist/comments/viewer.d.ts +21 -0
- package/dist/comments/viewer.d.ts.map +1 -0
- package/dist/comments/viewer.js +45 -0
- package/dist/comments/viewer.js.map +1 -0
- package/dist/config.d.ts +225 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +121 -6
- package/dist/config.js.map +1 -1
- package/dist/contact/delivery.d.ts +60 -0
- package/dist/contact/delivery.d.ts.map +1 -0
- package/dist/contact/delivery.js +87 -0
- package/dist/contact/delivery.js.map +1 -0
- package/dist/contact/form.d.ts +130 -0
- package/dist/contact/form.d.ts.map +1 -0
- package/dist/contact/form.js +163 -0
- package/dist/contact/form.js.map +1 -0
- package/dist/contact/index.d.ts +17 -0
- package/dist/contact/index.d.ts.map +1 -0
- package/dist/contact/index.js +13 -0
- package/dist/contact/index.js.map +1 -0
- package/dist/contact/records.d.ts +124 -0
- package/dist/contact/records.d.ts.map +1 -0
- package/dist/contact/records.js +218 -0
- package/dist/contact/records.js.map +1 -0
- package/dist/contact/routes.d.ts +17 -0
- package/dist/contact/routes.d.ts.map +1 -0
- package/dist/contact/routes.js +127 -0
- package/dist/contact/routes.js.map +1 -0
- package/dist/contact/submission.d.ts +103 -0
- package/dist/contact/submission.d.ts.map +1 -0
- package/dist/contact/submission.js +166 -0
- package/dist/contact/submission.js.map +1 -0
- package/dist/content/document.d.ts +7 -2
- package/dist/content/document.d.ts.map +1 -1
- package/dist/content/document.js +1 -0
- package/dist/content/document.js.map +1 -1
- package/dist/content/index.d.ts +7 -2
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +4 -1
- package/dist/content/index.js.map +1 -1
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +24 -2
- package/dist/content/markdown.js.map +1 -1
- package/dist/content/parser.d.ts.map +1 -1
- package/dist/content/parser.js +11 -4
- package/dist/content/parser.js.map +1 -1
- package/dist/content/save.d.ts +5 -0
- package/dist/content/save.d.ts.map +1 -1
- package/dist/content/save.js +44 -1
- package/dist/content/save.js.map +1 -1
- package/dist/content/schedule.d.ts +125 -0
- package/dist/content/schedule.d.ts.map +1 -0
- package/dist/content/schedule.js +207 -0
- package/dist/content/schedule.js.map +1 -0
- package/dist/content/search.d.ts +64 -0
- package/dist/content/search.d.ts.map +1 -0
- package/dist/content/search.js +136 -0
- package/dist/content/search.js.map +1 -0
- package/dist/content/store.d.ts +220 -7
- package/dist/content/store.d.ts.map +1 -1
- package/dist/content/store.js +392 -67
- package/dist/content/store.js.map +1 -1
- package/dist/content/sync.d.ts +7 -1
- package/dist/content/sync.d.ts.map +1 -1
- package/dist/content/sync.js +18 -10
- package/dist/content/sync.js.map +1 -1
- package/dist/content/time.d.ts +56 -0
- package/dist/content/time.d.ts.map +1 -0
- package/dist/content/time.js +141 -0
- package/dist/content/time.js.map +1 -0
- package/dist/content/writer.d.ts.map +1 -1
- package/dist/content/writer.js +3 -0
- package/dist/content/writer.js.map +1 -1
- package/dist/env.d.ts +70 -5
- package/dist/env.d.ts.map +1 -1
- package/dist/federation/actor.d.ts +95 -41
- package/dist/federation/actor.d.ts.map +1 -1
- package/dist/federation/actor.js +180 -53
- package/dist/federation/actor.js.map +1 -1
- package/dist/federation/article.d.ts +44 -17
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +98 -46
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/delivery.d.ts +63 -15
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +154 -80
- package/dist/federation/delivery.js.map +1 -1
- package/dist/federation/federation.d.ts +22 -17
- package/dist/federation/federation.d.ts.map +1 -1
- package/dist/federation/federation.js +98 -77
- package/dist/federation/federation.js.map +1 -1
- package/dist/federation/followers.d.ts +3 -2
- package/dist/federation/followers.d.ts.map +1 -1
- package/dist/federation/followers.js +6 -5
- package/dist/federation/followers.js.map +1 -1
- package/dist/federation/import-wordpress.d.ts +128 -0
- package/dist/federation/import-wordpress.d.ts.map +1 -0
- package/dist/federation/import-wordpress.js +426 -0
- package/dist/federation/import-wordpress.js.map +1 -0
- package/dist/federation/inbox.d.ts +36 -13
- package/dist/federation/inbox.d.ts.map +1 -1
- package/dist/federation/inbox.js +120 -49
- package/dist/federation/inbox.js.map +1 -1
- package/dist/federation/index.d.ts +22 -10
- package/dist/federation/index.d.ts.map +1 -1
- package/dist/federation/index.js +13 -8
- package/dist/federation/index.js.map +1 -1
- package/dist/federation/keys.d.ts +98 -20
- package/dist/federation/keys.d.ts.map +1 -1
- package/dist/federation/keys.js +269 -39
- package/dist/federation/keys.js.map +1 -1
- package/dist/federation/mount.d.ts +46 -10
- package/dist/federation/mount.d.ts.map +1 -1
- package/dist/federation/mount.js +300 -28
- package/dist/federation/mount.js.map +1 -1
- package/dist/federation/paths.d.ts +23 -35
- package/dist/federation/paths.d.ts.map +1 -1
- package/dist/federation/paths.js +26 -39
- package/dist/federation/paths.js.map +1 -1
- package/dist/federation/records.d.ts +223 -0
- package/dist/federation/records.d.ts.map +1 -0
- package/dist/federation/records.js +506 -0
- package/dist/federation/records.js.map +1 -0
- package/dist/federation/relays.d.ts +114 -0
- package/dist/federation/relays.d.ts.map +1 -0
- package/dist/federation/relays.js +290 -0
- package/dist/federation/relays.js.map +1 -0
- package/dist/federation/replies.d.ts +80 -0
- package/dist/federation/replies.d.ts.map +1 -0
- package/dist/federation/replies.js +166 -0
- package/dist/federation/replies.js.map +1 -0
- package/dist/federation/wordpress.d.ts +131 -0
- package/dist/federation/wordpress.d.ts.map +1 -0
- package/dist/federation/wordpress.js +341 -0
- package/dist/federation/wordpress.js.map +1 -0
- package/dist/files/atomic.d.ts +103 -0
- package/dist/files/atomic.d.ts.map +1 -0
- package/dist/files/atomic.js +150 -0
- package/dist/files/atomic.js.map +1 -0
- package/dist/files/index.d.ts +3 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +2 -0
- package/dist/files/index.js.map +1 -0
- package/dist/forms/protection.d.ts +85 -0
- package/dist/forms/protection.d.ts.map +1 -0
- package/dist/forms/protection.js +116 -0
- package/dist/forms/protection.js.map +1 -0
- package/dist/images/icons.d.ts +59 -0
- package/dist/images/icons.d.ts.map +1 -0
- package/dist/images/icons.js +131 -0
- package/dist/images/icons.js.map +1 -0
- package/dist/images/index.d.ts +7 -0
- package/dist/images/index.d.ts.map +1 -0
- package/dist/images/index.js +4 -0
- package/dist/images/index.js.map +1 -0
- package/dist/images/markup.d.ts +47 -0
- package/dist/images/markup.d.ts.map +1 -0
- package/dist/images/markup.js +175 -0
- package/dist/images/markup.js.map +1 -0
- package/dist/images/paths.d.ts +34 -0
- package/dist/images/paths.d.ts.map +1 -0
- package/dist/images/paths.js +41 -0
- package/dist/images/paths.js.map +1 -0
- package/dist/images/variants.d.ts +104 -0
- package/dist/images/variants.d.ts.map +1 -0
- package/dist/images/variants.js +320 -0
- package/dist/images/variants.js.map +1 -0
- package/dist/index.d.ts +123 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +344 -25
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +18 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +34 -3
- package/dist/init.js.map +1 -1
- package/dist/mail/brevo.d.ts +35 -0
- package/dist/mail/brevo.d.ts.map +1 -0
- package/dist/mail/brevo.js +85 -0
- package/dist/mail/brevo.js.map +1 -0
- package/dist/mail/credentials.d.ts +62 -0
- package/dist/mail/credentials.d.ts.map +1 -0
- package/dist/mail/credentials.js +86 -0
- package/dist/mail/credentials.js.map +1 -0
- package/dist/mail/index.d.ts +15 -0
- package/dist/mail/index.d.ts.map +1 -0
- package/dist/mail/index.js +8 -0
- package/dist/mail/index.js.map +1 -0
- package/dist/mail/memory.d.ts +35 -0
- package/dist/mail/memory.d.ts.map +1 -0
- package/dist/mail/memory.js +29 -0
- package/dist/mail/memory.js.map +1 -0
- package/dist/mail/provider.d.ts +80 -0
- package/dist/mail/provider.d.ts.map +1 -0
- package/dist/mail/provider.js +23 -0
- package/dist/mail/provider.js.map +1 -0
- package/dist/mail/service.d.ts +156 -0
- package/dist/mail/service.d.ts.map +1 -0
- package/dist/mail/service.js +265 -0
- package/dist/mail/service.js.map +1 -0
- package/dist/mail/smtp.d.ts +39 -0
- package/dist/mail/smtp.d.ts.map +1 -0
- package/dist/mail/smtp.js +58 -0
- package/dist/mail/smtp.js.map +1 -0
- package/dist/mail/templates.d.ts +91 -0
- package/dist/mail/templates.d.ts.map +1 -0
- package/dist/mail/templates.js +69 -0
- package/dist/mail/templates.js.map +1 -0
- package/dist/notifications/comments.d.ts +66 -0
- package/dist/notifications/comments.d.ts.map +1 -0
- package/dist/notifications/comments.js +151 -0
- package/dist/notifications/comments.js.map +1 -0
- package/dist/notifications/digest.d.ts +135 -0
- package/dist/notifications/digest.d.ts.map +1 -0
- package/dist/notifications/digest.js +287 -0
- package/dist/notifications/digest.js.map +1 -0
- package/dist/notifications/index.d.ts +13 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +8 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/links.d.ts +60 -0
- package/dist/notifications/links.d.ts.map +1 -0
- package/dist/notifications/links.js +63 -0
- package/dist/notifications/links.js.map +1 -0
- package/dist/notifications/optouts.d.ts +48 -0
- package/dist/notifications/optouts.d.ts.map +1 -0
- package/dist/notifications/optouts.js +93 -0
- package/dist/notifications/optouts.js.map +1 -0
- package/dist/notifications/preferences.d.ts +158 -0
- package/dist/notifications/preferences.d.ts.map +1 -0
- package/dist/notifications/preferences.js +195 -0
- package/dist/notifications/preferences.js.map +1 -0
- package/dist/notifications/routes.d.ts +28 -0
- package/dist/notifications/routes.d.ts.map +1 -0
- package/dist/notifications/routes.js +184 -0
- package/dist/notifications/routes.js.map +1 -0
- package/dist/notifications/tokens.d.ts +60 -0
- package/dist/notifications/tokens.d.ts.map +1 -0
- package/dist/notifications/tokens.js +125 -0
- package/dist/notifications/tokens.js.map +1 -0
- package/dist/notify.d.ts +84 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +149 -0
- package/dist/notify.js.map +1 -0
- package/dist/web/archive.d.ts +49 -0
- package/dist/web/archive.d.ts.map +1 -0
- package/dist/web/archive.js +59 -0
- package/dist/web/archive.js.map +1 -0
- package/dist/web/assets.d.ts +6 -5
- package/dist/web/assets.d.ts.map +1 -1
- package/dist/web/assets.js +5 -7
- package/dist/web/assets.js.map +1 -1
- package/dist/web/authors.d.ts +143 -0
- package/dist/web/authors.d.ts.map +1 -0
- package/dist/web/authors.js +178 -0
- package/dist/web/authors.js.map +1 -0
- package/dist/web/comments.d.ts +60 -0
- package/dist/web/comments.d.ts.map +1 -0
- package/dist/web/comments.js +207 -0
- package/dist/web/comments.js.map +1 -0
- package/dist/web/context.d.ts +162 -28
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +123 -26
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts +209 -0
- package/dist/web/conversation.d.ts.map +1 -0
- package/dist/web/conversation.js +557 -0
- package/dist/web/conversation.js.map +1 -0
- package/dist/web/documents.d.ts +36 -6
- package/dist/web/documents.d.ts.map +1 -1
- package/dist/web/documents.js +52 -10
- package/dist/web/documents.js.map +1 -1
- package/dist/web/feed-atom.d.ts +22 -0
- package/dist/web/feed-atom.d.ts.map +1 -0
- package/dist/web/feed-atom.js +83 -0
- package/dist/web/feed-atom.js.map +1 -0
- package/dist/web/feed-item.d.ts +145 -0
- package/dist/web/feed-item.d.ts.map +1 -0
- package/dist/web/feed-item.js +120 -0
- package/dist/web/feed-item.js.map +1 -0
- package/dist/web/feed-json.d.ts +79 -0
- package/dist/web/feed-json.d.ts.map +1 -0
- package/dist/web/feed-json.js +53 -0
- package/dist/web/feed-json.js.map +1 -0
- package/dist/web/feed-rss.d.ts +26 -0
- package/dist/web/feed-rss.d.ts.map +1 -0
- package/dist/web/feed-rss.js +203 -0
- package/dist/web/feed-rss.js.map +1 -0
- package/dist/web/feed-source.d.ts +244 -0
- package/dist/web/feed-source.d.ts.map +1 -0
- package/dist/web/feed-source.js +201 -0
- package/dist/web/feed-source.js.map +1 -0
- package/dist/web/feed-xml.d.ts +63 -0
- package/dist/web/feed-xml.d.ts.map +1 -0
- package/dist/web/feed-xml.js +116 -0
- package/dist/web/feed-xml.js.map +1 -0
- package/dist/web/feeds.d.ts +31 -96
- package/dist/web/feeds.d.ts.map +1 -1
- package/dist/web/feeds.js +94 -198
- package/dist/web/feeds.js.map +1 -1
- package/dist/web/health.d.ts +31 -0
- package/dist/web/health.d.ts.map +1 -0
- package/dist/web/health.js +44 -0
- package/dist/web/health.js.map +1 -0
- package/dist/web/index.d.ts +30 -10
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +18 -7
- package/dist/web/index.js.map +1 -1
- package/dist/web/navigation.d.ts +195 -0
- package/dist/web/navigation.d.ts.map +1 -0
- package/dist/web/navigation.js +300 -0
- package/dist/web/navigation.js.map +1 -0
- package/dist/web/negotiate.d.ts +31 -0
- package/dist/web/negotiate.d.ts.map +1 -1
- package/dist/web/negotiate.js +31 -11
- package/dist/web/negotiate.js.map +1 -1
- package/dist/web/recent.d.ts +43 -0
- package/dist/web/recent.d.ts.map +1 -0
- package/dist/web/recent.js +37 -0
- package/dist/web/recent.js.map +1 -0
- package/dist/web/render.d.ts +203 -9
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +341 -17
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts +25 -8
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +854 -93
- package/dist/web/routes.js.map +1 -1
- package/dist/web/sanitize.d.ts +19 -0
- package/dist/web/sanitize.d.ts.map +1 -0
- package/dist/web/sanitize.js +272 -0
- package/dist/web/sanitize.js.map +1 -0
- package/dist/web/search.d.ts +79 -0
- package/dist/web/search.d.ts.map +1 -0
- package/dist/web/search.js +94 -0
- package/dist/web/search.js.map +1 -0
- package/dist/web/sitemap.d.ts +120 -0
- package/dist/web/sitemap.d.ts.map +1 -0
- package/dist/web/sitemap.js +199 -0
- package/dist/web/sitemap.js.map +1 -0
- package/dist/web/taxonomy.d.ts +152 -0
- package/dist/web/taxonomy.d.ts.map +1 -0
- package/dist/web/taxonomy.js +237 -0
- package/dist/web/taxonomy.js.map +1 -0
- package/dist/web/templates.d.ts +54 -16
- package/dist/web/templates.d.ts.map +1 -1
- package/dist/web/templates.js +109 -28
- package/dist/web/templates.js.map +1 -1
- package/dist/web/themes.d.ts +226 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +314 -0
- package/dist/web/themes.js.map +1 -0
- package/dist/webmention/discovery.d.ts +51 -0
- package/dist/webmention/discovery.d.ts.map +1 -0
- package/dist/webmention/discovery.js +176 -0
- package/dist/webmention/discovery.js.map +1 -0
- package/dist/webmention/html.d.ts +71 -0
- package/dist/webmention/html.d.ts.map +1 -0
- package/dist/webmention/html.js +285 -0
- package/dist/webmention/html.js.map +1 -0
- package/dist/webmention/index.d.ts +12 -0
- package/dist/webmention/index.d.ts.map +1 -0
- package/dist/webmention/index.js +8 -0
- package/dist/webmention/index.js.map +1 -0
- package/dist/webmention/links.d.ts +18 -0
- package/dist/webmention/links.d.ts.map +1 -0
- package/dist/webmention/links.js +64 -0
- package/dist/webmention/links.js.map +1 -0
- package/dist/webmention/microformats.d.ts +93 -0
- package/dist/webmention/microformats.d.ts.map +1 -0
- package/dist/webmention/microformats.js +376 -0
- package/dist/webmention/microformats.js.map +1 -0
- package/dist/webmention/receive.d.ts +141 -0
- package/dist/webmention/receive.d.ts.map +1 -0
- package/dist/webmention/receive.js +264 -0
- package/dist/webmention/receive.js.map +1 -0
- package/dist/webmention/routes.d.ts +37 -0
- package/dist/webmention/routes.d.ts.map +1 -0
- package/dist/webmention/routes.js +75 -0
- package/dist/webmention/routes.js.map +1 -0
- package/dist/webmention/service.d.ts +94 -0
- package/dist/webmention/service.d.ts.map +1 -0
- package/dist/webmention/service.js +207 -0
- package/dist/webmention/service.js.map +1 -0
- package/package.json +11 -6
- package/templates/site/content/_data/site.json +8 -0
- package/templates/site/content/pages/about.md +7 -0
- package/templates/site/content/posts/2026-01-01-hello-world.md +5 -3
- package/templates/site/geekity.config.ts +11 -1
- package/templates/site/tsconfig.json +1 -1
- package/themes/default/README.md +1216 -50
- package/themes/default/layouts/404.njk +2 -3
- package/themes/default/layouts/author.njk +36 -0
- package/themes/default/layouts/base.njk +161 -31
- package/themes/default/layouts/category.njk +27 -0
- package/themes/default/layouts/front-page.njk +56 -0
- package/themes/default/layouts/home.njk +17 -1
- package/themes/default/layouts/page.njk +57 -5
- package/themes/default/layouts/post.njk +78 -19
- package/themes/default/layouts/search.njk +57 -0
- package/themes/default/layouts/tag.njk +3 -6
- package/themes/default/mail/comment-digest.html.njk +37 -0
- package/themes/default/mail/comment-digest.subject.njk +3 -0
- package/themes/default/mail/comment-digest.txt.njk +40 -0
- package/themes/default/mail/comment-pending.html.njk +27 -0
- package/themes/default/mail/comment-pending.subject.njk +2 -0
- package/themes/default/mail/comment-pending.txt.njk +24 -0
- package/themes/default/mail/comment-reply.html.njk +21 -0
- package/themes/default/mail/comment-reply.subject.njk +2 -0
- package/themes/default/mail/comment-reply.txt.njk +22 -0
- package/themes/default/mail/contact-message.html.njk +24 -0
- package/themes/default/mail/contact-message.subject.njk +5 -0
- package/themes/default/mail/contact-message.txt.njk +20 -0
- package/themes/default/mail/password-changed.html.njk +18 -0
- package/themes/default/mail/password-changed.subject.njk +2 -0
- package/themes/default/mail/password-changed.txt.njk +17 -0
- package/themes/default/mail/password-reset.html.njk +22 -0
- package/themes/default/mail/password-reset.subject.njk +2 -0
- package/themes/default/mail/password-reset.txt.njk +18 -0
- package/themes/default/mail/test.html.njk +14 -0
- package/themes/default/mail/test.subject.njk +2 -0
- package/themes/default/mail/test.txt.njk +12 -0
- package/themes/default/partials/archive.njk +27 -0
- package/themes/default/partials/bio.njk +71 -0
- package/themes/default/partials/comment-form.njk +137 -0
- package/themes/default/partials/contact-form.njk +88 -0
- package/themes/default/partials/conversation.njk +139 -0
- package/themes/default/partials/feeds.njk +26 -0
- package/themes/default/partials/jsonld.njk +120 -0
- package/themes/default/partials/menu.njk +32 -0
- package/themes/default/partials/pagination.njk +12 -6
- package/themes/default/partials/post-list.njk +51 -18
- package/themes/default/partials/search-form.njk +22 -0
- package/themes/default/partials/tags.njk +26 -5
- package/themes/default/static/highlight.js +4 -0
- package/themes/default/static/style.css +1142 -194
- package/themes/default/theme.json +9 -0
- package/admin/layouts/federation.njk +0 -145
- package/admin/layouts/login.njk +0 -23
- package/admin/layouts/settings.njk +0 -116
- package/admin/layouts/setup.njk +0 -27
- package/admin/layouts/users.njk +0 -91
- /package/admin/{layouts/_flash.njk → components/flash.njk} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every settings page is made of.
|
|
3
|
+
*
|
|
4
|
+
* The settings used to be one form with twelve headings. They are six pages
|
|
5
|
+
* now — General, Reading, Permalinks, Discussion and Email under Settings, and
|
|
6
|
+
* Federation under its own section (TASK-109) — and this is what they have in
|
|
7
|
+
* common: a description of the page, and the one pair of routes that turns it
|
|
8
|
+
* into a screen you can read and a form you can save. A page module describes
|
|
9
|
+
* itself and writes its own template; nothing about how a page is wired lives
|
|
10
|
+
* in the page.
|
|
11
|
+
*
|
|
12
|
+
* The save is the part worth reading twice. A page writes only the fields it
|
|
13
|
+
* carries, and it writes them onto `content/_data/site.json` as re-read inside
|
|
14
|
+
* the atomic update (decision-9), not onto the copy the form was rendered
|
|
15
|
+
* from. So two people saving two different pages at the same moment both land:
|
|
16
|
+
* the second save is applied to what the first one actually wrote, and a
|
|
17
|
+
* setting neither page shows is not even in the picture.
|
|
18
|
+
*/
|
|
19
|
+
import type { Context, Hono } from 'hono';
|
|
20
|
+
import type { ResolvedConfig } from '../config.ts';
|
|
21
|
+
import type { GeekityEnv } from '../env.ts';
|
|
22
|
+
import type { DeliveryReport } from '../federation/delivery.ts';
|
|
23
|
+
import type { AdminRender } from './documents.ts';
|
|
24
|
+
import type { SettingsField, SettingsForm, SiteSettings } from './settings.ts';
|
|
25
|
+
/** What {@link mountSettingsPage} needs from the admin around it. */
|
|
26
|
+
export interface MountSettingsOptions {
|
|
27
|
+
/** The admin's renderer, which injects the chrome, the CSRF token and the flash. */
|
|
28
|
+
render: AdminRender;
|
|
29
|
+
}
|
|
30
|
+
/** A submitted form, before anything has been read out of it. */
|
|
31
|
+
export type SubmittedBody = Record<string, unknown>;
|
|
32
|
+
/** One settings page, wherever the menu files it. */
|
|
33
|
+
export interface SettingsPage {
|
|
34
|
+
/** The child of its section it is, as `src/admin/menu.ts` names it. */
|
|
35
|
+
child: string;
|
|
36
|
+
/** What the menu calls it. */
|
|
37
|
+
label: string;
|
|
38
|
+
/**
|
|
39
|
+
* The section it is under, when it is not Settings.
|
|
40
|
+
*
|
|
41
|
+
* Five of the six are Settings' own children. Federation's is a child of
|
|
42
|
+
* the Federation section instead (TASK-109): what a settings page is has
|
|
43
|
+
* nothing to do with where the menu files it, so the page says where it is
|
|
44
|
+
* and the rest of this module carries on as before.
|
|
45
|
+
*/
|
|
46
|
+
section?: string;
|
|
47
|
+
/**
|
|
48
|
+
* What the page is headed and what a save says it saved, when the menu's
|
|
49
|
+
* label is not that on its own. Only Federation has one: under its own
|
|
50
|
+
* section it is listed as Settings, and "Settings settings saved" is not a
|
|
51
|
+
* sentence.
|
|
52
|
+
*/
|
|
53
|
+
heading?: string;
|
|
54
|
+
/** Where it is: {@link settingsPagePath}, or its own section's path. */
|
|
55
|
+
path: string;
|
|
56
|
+
/** The template it renders, from {@link ADMIN_TEMPLATES}. */
|
|
57
|
+
template: string;
|
|
58
|
+
/** The settings it carries. Every setting is on exactly one page. */
|
|
59
|
+
fields: readonly SettingsField[];
|
|
60
|
+
/**
|
|
61
|
+
* The settings as this page shows them, where what is stored is not what is
|
|
62
|
+
* in effect. Only General has one, for the base URL a deployment overrides.
|
|
63
|
+
*/
|
|
64
|
+
shown?: (config: ResolvedConfig, settings: SiteSettings) => SiteSettings;
|
|
65
|
+
/** What the page renders beyond its own fields: a panel, a credential, a list. */
|
|
66
|
+
panels?: (c: Context<GeekityEnv>, settings: SiteSettings) => Record<string, unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* The fields this page does not read straight off the body, because
|
|
69
|
+
* something other than the form decides them — a field rendered read-only
|
|
70
|
+
* submits nothing, and a save must not clear it.
|
|
71
|
+
*/
|
|
72
|
+
reads?: (options: {
|
|
73
|
+
c: Context<GeekityEnv>;
|
|
74
|
+
body: SubmittedBody;
|
|
75
|
+
current: SiteSettings;
|
|
76
|
+
}) => Partial<SettingsForm>;
|
|
77
|
+
/**
|
|
78
|
+
* What a save of this page sets off beyond the file, as the sentence the
|
|
79
|
+
* flash adds. The side effect stays where the field is: the actor is told
|
|
80
|
+
* about a profile change on the page the profile is on, and the relays are
|
|
81
|
+
* reconciled on the page the relay list is on.
|
|
82
|
+
*/
|
|
83
|
+
saved?: (c: Context<GeekityEnv>, before: SiteSettings, after: SiteSettings) => Promise<string> | string;
|
|
84
|
+
/**
|
|
85
|
+
* The page's own endpoints: a credential, a test message. Each is its own
|
|
86
|
+
* POST so a refused one cannot lose an edit to a field.
|
|
87
|
+
*/
|
|
88
|
+
endpoints?: (app: Hono<GeekityEnv>, options: MountSettingsOptions) => void;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Where one settings page lives.
|
|
92
|
+
*
|
|
93
|
+
* General is `/admin/settings` itself rather than `/admin/settings/general`:
|
|
94
|
+
* it is where the Settings heading lands, where every save that has nothing
|
|
95
|
+
* better to say redirects, and the URL every older bookmark holds.
|
|
96
|
+
*/
|
|
97
|
+
export declare function settingsPagePath(child: string): string;
|
|
98
|
+
/**
|
|
99
|
+
* Register one settings page: the screen, the save, and whatever endpoints of
|
|
100
|
+
* its own it has.
|
|
101
|
+
*
|
|
102
|
+
* Every read is of `content/_data/site.json` as it is at that moment, and a
|
|
103
|
+
* save rewrites it: a page is a view of the file rather than of anything this
|
|
104
|
+
* process remembers (decision-9). A form the page's own validator has anything
|
|
105
|
+
* to say about is a 400 that writes nothing at all and comes back with the
|
|
106
|
+
* problems on the fields that have them.
|
|
107
|
+
*/
|
|
108
|
+
export declare function mountSettingsPage(app: Hono<GeekityEnv>, page: SettingsPage, options: MountSettingsOptions): void;
|
|
109
|
+
/** Everything one settings page's template renders. */
|
|
110
|
+
export declare function settingsScreen(c: Context<GeekityEnv>, page: SettingsPage, settings: SiteSettings): Record<string, unknown>;
|
|
111
|
+
/** A form field as a string. A file upload, or a missing field, is the empty one. */
|
|
112
|
+
export declare function bodyField(value: unknown): string;
|
|
113
|
+
/**
|
|
114
|
+
* The sentence a flash adds about the followers, when there were any: a save
|
|
115
|
+
* of the profile is also an announcement, and it should say so rather than
|
|
116
|
+
* leave the admin wondering.
|
|
117
|
+
*/
|
|
118
|
+
export declare function toldFollowers(report: DeliveryReport | undefined): string;
|
|
119
|
+
//# sourceMappingURL=settings-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-page.d.ts","sourceRoot":"","sources":["../../src/admin/settings-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAWlD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE/E,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACnC,oFAAoF;IACpF,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,iEAAiE;AACjE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE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CAAC,UAAU,CAAC,EACtB,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,YAAY,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBzB;AA2BD,qFAAqF;AACrF,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAMxE"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every settings page is made of.
|
|
3
|
+
*
|
|
4
|
+
* The settings used to be one form with twelve headings. They are six pages
|
|
5
|
+
* now — General, Reading, Permalinks, Discussion and Email under Settings, and
|
|
6
|
+
* Federation under its own section (TASK-109) — and this is what they have in
|
|
7
|
+
* common: a description of the page, and the one pair of routes that turns it
|
|
8
|
+
* into a screen you can read and a form you can save. A page module describes
|
|
9
|
+
* itself and writes its own template; nothing about how a page is wired lives
|
|
10
|
+
* in the page.
|
|
11
|
+
*
|
|
12
|
+
* The save is the part worth reading twice. A page writes only the fields it
|
|
13
|
+
* carries, and it writes them onto `content/_data/site.json` as re-read inside
|
|
14
|
+
* the atomic update (decision-9), not onto the copy the form was rendered
|
|
15
|
+
* from. So two people saving two different pages at the same moment both land:
|
|
16
|
+
* the second save is applied to what the first one actually wrote, and a
|
|
17
|
+
* setting neither page shows is not even in the picture.
|
|
18
|
+
*/
|
|
19
|
+
import { flash } from './flash.js';
|
|
20
|
+
import { formFromSettings, readSiteSettings, SETTINGS_FIELDS, SETTINGS_PATH, settingsFromForm, settingsProblems, updateSiteSettings, } from './settings.js';
|
|
21
|
+
/**
|
|
22
|
+
* Where one settings page lives.
|
|
23
|
+
*
|
|
24
|
+
* General is `/admin/settings` itself rather than `/admin/settings/general`:
|
|
25
|
+
* it is where the Settings heading lands, where every save that has nothing
|
|
26
|
+
* better to say redirects, and the URL every older bookmark holds.
|
|
27
|
+
*/
|
|
28
|
+
export function settingsPagePath(child) {
|
|
29
|
+
return child === 'general' ? SETTINGS_PATH : `${SETTINGS_PATH}/${child}`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Register one settings page: the screen, the save, and whatever endpoints of
|
|
33
|
+
* its own it has.
|
|
34
|
+
*
|
|
35
|
+
* Every read is of `content/_data/site.json` as it is at that moment, and a
|
|
36
|
+
* save rewrites it: a page is a view of the file rather than of anything this
|
|
37
|
+
* process remembers (decision-9). A form the page's own validator has anything
|
|
38
|
+
* to say about is a 400 that writes nothing at all and comes back with the
|
|
39
|
+
* problems on the fields that have them.
|
|
40
|
+
*/
|
|
41
|
+
export function mountSettingsPage(app, page, options) {
|
|
42
|
+
const { render } = options;
|
|
43
|
+
app.get(page.path, (c) => render(c, page.template, settingsScreen(c, page, readSiteSettings(c.var.config.contentDir))));
|
|
44
|
+
app.post(page.path, async (c) => {
|
|
45
|
+
const body = await c.req.parseBody();
|
|
46
|
+
const stored = readSiteSettings(c.var.config.contentDir);
|
|
47
|
+
const submitted = pageForm(c, page, body, stored);
|
|
48
|
+
// The themes directory goes in because one check needs the file system:
|
|
49
|
+
// whether the name a page submitted is a theme that is actually there.
|
|
50
|
+
const problems = settingsProblems(submitted, page.fields, {
|
|
51
|
+
themesDir: c.var.config.themesDir,
|
|
52
|
+
});
|
|
53
|
+
if (Object.keys(problems).length > 0) {
|
|
54
|
+
c.status(400);
|
|
55
|
+
return render(c, page.template, {
|
|
56
|
+
...settingsScreen(c, page, stored),
|
|
57
|
+
form: submitted,
|
|
58
|
+
problems,
|
|
59
|
+
hasProblems: true,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// The change is applied to the settings re-read inside the write, so a
|
|
63
|
+
// field this page does not carry is whatever the file says now rather than
|
|
64
|
+
// whatever it said when the form was drawn. The archive renames and the
|
|
65
|
+
// menus come from there for the same reason: a save of the title must not
|
|
66
|
+
// undo a term somebody renamed, or a menu somebody edited, while this form
|
|
67
|
+
// was open.
|
|
68
|
+
const settings = await updateSiteSettings({
|
|
69
|
+
contentDir: c.var.config.contentDir,
|
|
70
|
+
change: (current) => settingsFromForm(pageForm(c, page, body, current), current),
|
|
71
|
+
});
|
|
72
|
+
const note = page.saved === undefined ? '' : await page.saved(c, stored, settings);
|
|
73
|
+
flash(c, 'notice', `${pageHeading(page)} settings saved.${note}`);
|
|
74
|
+
return c.redirect(page.path, 303);
|
|
75
|
+
});
|
|
76
|
+
page.endpoints?.(app, options);
|
|
77
|
+
}
|
|
78
|
+
/** Everything one settings page's template renders. */
|
|
79
|
+
export function settingsScreen(c, page, settings) {
|
|
80
|
+
const shown = page.shown === undefined ? settings : page.shown(c.var.config, settings);
|
|
81
|
+
return {
|
|
82
|
+
section: page.section ?? 'settings',
|
|
83
|
+
child: page.child,
|
|
84
|
+
settingsUrl: page.path,
|
|
85
|
+
settingsLabel: pageHeading(page),
|
|
86
|
+
fields: SETTINGS_FIELDS,
|
|
87
|
+
form: formFromSettings(shown),
|
|
88
|
+
problems: {},
|
|
89
|
+
// Whether to say "nothing was saved" over the form. A template cannot ask
|
|
90
|
+
// an object whether it is empty, and every page would otherwise spell out
|
|
91
|
+
// the list of its own fields to find out.
|
|
92
|
+
hasProblems: false,
|
|
93
|
+
...page.panels?.(c, settings),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** What the page is headed, and what a save of it says it saved. */
|
|
97
|
+
function pageHeading(page) {
|
|
98
|
+
return page.heading ?? page.label;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The whole form as this page's save means it: what is stored, with the
|
|
102
|
+
* page's own fields taken from what was submitted.
|
|
103
|
+
*
|
|
104
|
+
* Every other field comes from `current` rather than from the body, which is
|
|
105
|
+
* what makes a page write only its own settings — and it is read out of a
|
|
106
|
+
* checkbox correctly for free, since a clear checkbox submits nothing at all
|
|
107
|
+
* and only this page's checkboxes are read off the body.
|
|
108
|
+
*/
|
|
109
|
+
function pageForm(c, page, body, current) {
|
|
110
|
+
const form = formFromSettings(current);
|
|
111
|
+
for (const name of page.fields)
|
|
112
|
+
form[name] = bodyField(body[SETTINGS_FIELDS[name]]);
|
|
113
|
+
return { ...form, ...page.reads?.({ c, body, current }) };
|
|
114
|
+
}
|
|
115
|
+
/** A form field as a string. A file upload, or a missing field, is the empty one. */
|
|
116
|
+
export function bodyField(value) {
|
|
117
|
+
return typeof value === 'string' ? value : '';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The sentence a flash adds about the followers, when there were any: a save
|
|
121
|
+
* of the profile is also an announcement, and it should say so rather than
|
|
122
|
+
* leave the admin wondering.
|
|
123
|
+
*/
|
|
124
|
+
export function toldFollowers(report) {
|
|
125
|
+
const total = report?.deliveries.length ?? 0;
|
|
126
|
+
if (total === 0)
|
|
127
|
+
return '';
|
|
128
|
+
return total === 1
|
|
129
|
+
? ' One follower has been told.'
|
|
130
|
+
: ` ${String(total)} followers have been told.`;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=settings-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-page.js","sourceRoot":"","sources":["../../src/admin/settings-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AA2EvB;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,KAAK,EAAE,CAAC;AAC3E,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAqB,EACrB,IAAkB,EAClB,OAA6B;IAE7B,MAAM,EAAE,MAAM,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,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every settings page there is, and which of them Settings lists.
|
|
3
|
+
*
|
|
4
|
+
* This module is the list. What a page is made of is `settings-page.ts`, what
|
|
5
|
+
* each page carries is its own module, and what a setting means is
|
|
6
|
+
* `settings.ts`; the only thing that has to know all six exists is the mount
|
|
7
|
+
* and the menu.
|
|
8
|
+
*
|
|
9
|
+
* The order is the order the menu shows them, General first: the Settings
|
|
10
|
+
* heading lands on its first child, and General is `/admin/settings` itself.
|
|
11
|
+
*
|
|
12
|
+
* Five of the six are Settings' own children. Federation's is a settings page
|
|
13
|
+
* in every other respect — the same fields, the same save, the same refusals —
|
|
14
|
+
* but the menu files it under the Federation section, beside the followers it
|
|
15
|
+
* is about (TASK-109), so it is in {@link ALL_SETTINGS_PAGES} and not in
|
|
16
|
+
* {@link SETTINGS_PAGES}. Both lists matter: {@link ALL_SETTINGS_PAGES} is
|
|
17
|
+
* what the mount registers and what "every setting is on exactly one page" is
|
|
18
|
+
* checked against, and {@link SETTINGS_PAGES} is what the Settings menu has to
|
|
19
|
+
* agree with.
|
|
20
|
+
*/
|
|
21
|
+
import type { Hono } from 'hono';
|
|
22
|
+
import type { GeekityEnv } from '../env.ts';
|
|
23
|
+
import type { MountSettingsOptions, SettingsPage } from './settings-page.ts';
|
|
24
|
+
/** The settings pages the Settings menu lists, in the order it lists them. */
|
|
25
|
+
export declare const SETTINGS_PAGES: readonly SettingsPage[];
|
|
26
|
+
/** Every settings page, wherever the menu files it. */
|
|
27
|
+
export declare const ALL_SETTINGS_PAGES: readonly SettingsPage[];
|
|
28
|
+
/** Register every settings page, including the one filed under Federation. */
|
|
29
|
+
export declare function mountSettings(app: Hono<GeekityEnv>, options: MountSettingsOptions): void;
|
|
30
|
+
//# sourceMappingURL=settings-pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-pages.d.ts","sourceRoot":"","sources":["../../src/admin/settings-pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAM5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAI7E,8EAA8E;AAC9E,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAMjD,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAA6C,CAAC;AAEpG,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAExF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every settings page there is, and which of them Settings lists.
|
|
3
|
+
*
|
|
4
|
+
* This module is the list. What a page is made of is `settings-page.ts`, what
|
|
5
|
+
* each page carries is its own module, and what a setting means is
|
|
6
|
+
* `settings.ts`; the only thing that has to know all six exists is the mount
|
|
7
|
+
* and the menu.
|
|
8
|
+
*
|
|
9
|
+
* The order is the order the menu shows them, General first: the Settings
|
|
10
|
+
* heading lands on its first child, and General is `/admin/settings` itself.
|
|
11
|
+
*
|
|
12
|
+
* Five of the six are Settings' own children. Federation's is a settings page
|
|
13
|
+
* in every other respect — the same fields, the same save, the same refusals —
|
|
14
|
+
* but the menu files it under the Federation section, beside the followers it
|
|
15
|
+
* is about (TASK-109), so it is in {@link ALL_SETTINGS_PAGES} and not in
|
|
16
|
+
* {@link SETTINGS_PAGES}. Both lists matter: {@link ALL_SETTINGS_PAGES} is
|
|
17
|
+
* what the mount registers and what "every setting is on exactly one page" is
|
|
18
|
+
* checked against, and {@link SETTINGS_PAGES} is what the Settings menu has to
|
|
19
|
+
* agree with.
|
|
20
|
+
*/
|
|
21
|
+
import { DISCUSSION_SETTINGS } from './settings-discussion.js';
|
|
22
|
+
import { EMAIL_SETTINGS } from './settings-email.js';
|
|
23
|
+
import { FEDERATION_SETTINGS } from './settings-federation.js';
|
|
24
|
+
import { GENERAL_SETTINGS } from './settings-general.js';
|
|
25
|
+
import { mountSettingsPage } from './settings-page.js';
|
|
26
|
+
import { PERMALINKS_SETTINGS } from './settings-permalinks.js';
|
|
27
|
+
import { READING_SETTINGS } from './settings-reading.js';
|
|
28
|
+
/** The settings pages the Settings menu lists, in the order it lists them. */
|
|
29
|
+
export const SETTINGS_PAGES = [
|
|
30
|
+
GENERAL_SETTINGS,
|
|
31
|
+
READING_SETTINGS,
|
|
32
|
+
PERMALINKS_SETTINGS,
|
|
33
|
+
DISCUSSION_SETTINGS,
|
|
34
|
+
EMAIL_SETTINGS,
|
|
35
|
+
];
|
|
36
|
+
/** Every settings page, wherever the menu files it. */
|
|
37
|
+
export const ALL_SETTINGS_PAGES = [...SETTINGS_PAGES, FEDERATION_SETTINGS];
|
|
38
|
+
/** Register every settings page, including the one filed under Federation. */
|
|
39
|
+
export function mountSettings(app, options) {
|
|
40
|
+
for (const page of ALL_SETTINGS_PAGES)
|
|
41
|
+
mountSettingsPage(app, page, options);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=settings-pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-pages.js","sourceRoot":"","sources":["../../src/admin/settings-pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,cAAc;CACf,CAAC;AAEF,uDAAuD;AACvD,MAAM,CAAC,MAAM,kBAAkB,GAA4B,CAAC,GAAG,cAAc,EAAE,mBAAmB,CAAC,CAAC;AAEpG,8EAA8E;AAC9E,MAAM,UAAU,aAAa,CAAC,GAAqB,EAAE,OAA6B;IAChF,KAAK,MAAM,IAAI,IAAI,kBAAkB;QAAE,iBAAiB,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permalinks: the URLs the archives live at, and the ones they used to.
|
|
3
|
+
*
|
|
4
|
+
* WordPress's own name for the page that decides URL shape. The two bases are
|
|
5
|
+
* a pair — they may not be the same, and neither may take a path the site
|
|
6
|
+
* already answers on — so they are validated together and shown together.
|
|
7
|
+
*
|
|
8
|
+
* The recorded archive renames are here as well, read-only: they are a record
|
|
9
|
+
* of what happened rather than a preference, written by the taxonomy screens
|
|
10
|
+
* as a term is renamed or merged, and this is the page whose fields decide
|
|
11
|
+
* which URLs they are about.
|
|
12
|
+
*/
|
|
13
|
+
import type { SettingsPage } from './settings-page.ts';
|
|
14
|
+
/** The Permalinks settings page. */
|
|
15
|
+
export declare const PERMALINKS_SETTINGS: SettingsPage;
|
|
16
|
+
//# sourceMappingURL=settings-permalinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-permalinks.d.ts","sourceRoot":"","sources":["../../src/admin/settings-permalinks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,oCAAoC;AACpC,eAAO,MAAM,mBAAmB,EAAE,YAejC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permalinks: the URLs the archives live at, and the ones they used to.
|
|
3
|
+
*
|
|
4
|
+
* WordPress's own name for the page that decides URL shape. The two bases are
|
|
5
|
+
* a pair — they may not be the same, and neither may take a path the site
|
|
6
|
+
* already answers on — so they are validated together and shown together.
|
|
7
|
+
*
|
|
8
|
+
* The recorded archive renames are here as well, read-only: they are a record
|
|
9
|
+
* of what happened rather than a preference, written by the taxonomy screens
|
|
10
|
+
* as a term is renamed or merged, and this is the page whose fields decide
|
|
11
|
+
* which URLs they are about.
|
|
12
|
+
*/
|
|
13
|
+
import { TAXONOMY_LABELS } from '../web/taxonomy.js';
|
|
14
|
+
import { settingsPagePath } from './settings-page.js';
|
|
15
|
+
import { ADMIN_TEMPLATES } from './templates.js';
|
|
16
|
+
/** The Permalinks settings page. */
|
|
17
|
+
export const PERMALINKS_SETTINGS = {
|
|
18
|
+
child: 'permalinks',
|
|
19
|
+
label: 'Permalinks',
|
|
20
|
+
path: settingsPagePath('permalinks'),
|
|
21
|
+
template: ADMIN_TEMPLATES.settingsPermalinks,
|
|
22
|
+
fields: ['tagBase', 'categoryBase'],
|
|
23
|
+
panels: (_c, settings) => ({
|
|
24
|
+
taxonomyRedirects: settings.taxonomyRedirects.map((entry) => ({
|
|
25
|
+
...entry,
|
|
26
|
+
// What the taxonomy is called in a sentence, so the list reads as the
|
|
27
|
+
// taxonomy screens name it rather than as the file spells it.
|
|
28
|
+
label: TAXONOMY_LABELS[entry.taxonomy],
|
|
29
|
+
})),
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=settings-permalinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-permalinks.js","sourceRoot":"","sources":["../../src/admin/settings-permalinks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,oCAAoC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC/C,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,gBAAgB,CAAC,YAAY,CAAC;IACpC,QAAQ,EAAE,eAAe,CAAC,kBAAkB;IAC5C,MAAM,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC;IAEnC,MAAM,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACzB,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC5D,GAAG,KAAK;YACR,sEAAsE;YACtE,8DAA8D;YAC9D,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC;SACvC,CAAC,CAAC;KACJ,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading: what a visitor is shown, and who is told when it changes.
|
|
3
|
+
*
|
|
4
|
+
* WordPress's Reading page is what the homepage displays and how many posts a
|
|
5
|
+
* listing holds; this one adds the notify server, which is how a subscriber
|
|
6
|
+
* hears that a feed moved on without waiting for their next poll. The site
|
|
7
|
+
* menu was here too until TASK-108 gave the menus a screen of their own: which
|
|
8
|
+
* menus there are to edit comes from the active theme, which is not something
|
|
9
|
+
* a page of fields can be.
|
|
10
|
+
*/
|
|
11
|
+
import type { Context } from 'hono';
|
|
12
|
+
import type { GeekityEnv } from '../env.ts';
|
|
13
|
+
import type { SettingsPage } from './settings-page.ts';
|
|
14
|
+
/** One page the homepage or the posts page may be. */
|
|
15
|
+
export interface PageChoice {
|
|
16
|
+
/** What the setting stores. */
|
|
17
|
+
slug: string;
|
|
18
|
+
/** What the option reads. */
|
|
19
|
+
title: string;
|
|
20
|
+
}
|
|
21
|
+
/** The published pages, by title, as the two picks offer them. */
|
|
22
|
+
export declare function pageChoices(c: Context<GeekityEnv>): PageChoice[];
|
|
23
|
+
/**
|
|
24
|
+
* The Reading settings page.
|
|
25
|
+
*
|
|
26
|
+
* The two picks are a select each rather than a text field, so what a site can
|
|
27
|
+
* choose is what it actually has. A pick whose page has since been drafted,
|
|
28
|
+
* trashed or deleted is not on the list any more: the setting keeps the slug —
|
|
29
|
+
* putting the page back puts the front page back — and the page says which one
|
|
30
|
+
* has gone, because a select that had quietly reset itself to "Your latest
|
|
31
|
+
* posts" would be the screen lying about what is stored.
|
|
32
|
+
*/
|
|
33
|
+
export declare const READING_SETTINGS: SettingsPage;
|
|
34
|
+
//# sourceMappingURL=settings-reading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-reading.d.ts","sourceRoot":"","sources":["../../src/admin/settings-reading.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,sDAAsD;AACtD,MAAM,WAAW,UAAU;IACzB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,EAAE,CAQhE;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAkB9B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading: what a visitor is shown, and who is told when it changes.
|
|
3
|
+
*
|
|
4
|
+
* WordPress's Reading page is what the homepage displays and how many posts a
|
|
5
|
+
* listing holds; this one adds the notify server, which is how a subscriber
|
|
6
|
+
* hears that a feed moved on without waiting for their next poll. The site
|
|
7
|
+
* menu was here too until TASK-108 gave the menus a screen of their own: which
|
|
8
|
+
* menus there are to edit comes from the active theme, which is not something
|
|
9
|
+
* a page of fields can be.
|
|
10
|
+
*/
|
|
11
|
+
import { isPublicDocument } from '../web/documents.js';
|
|
12
|
+
import { settingsPagePath } from './settings-page.js';
|
|
13
|
+
import { ADMIN_TEMPLATES } from './templates.js';
|
|
14
|
+
/** The published pages, by title, as the two picks offer them. */
|
|
15
|
+
export function pageChoices(c) {
|
|
16
|
+
const now = c.var.store.now();
|
|
17
|
+
return c.var.store
|
|
18
|
+
.listAll({ type: 'page', draft: false, trashed: false, scheduled: false })
|
|
19
|
+
.filter((document) => isPublicDocument(document, now))
|
|
20
|
+
.map((document) => ({ slug: document.slug, title: document.title }))
|
|
21
|
+
.sort((a, b) => a.title.localeCompare(b.title));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The Reading settings page.
|
|
25
|
+
*
|
|
26
|
+
* The two picks are a select each rather than a text field, so what a site can
|
|
27
|
+
* choose is what it actually has. A pick whose page has since been drafted,
|
|
28
|
+
* trashed or deleted is not on the list any more: the setting keeps the slug —
|
|
29
|
+
* putting the page back puts the front page back — and the page says which one
|
|
30
|
+
* has gone, because a select that had quietly reset itself to "Your latest
|
|
31
|
+
* posts" would be the screen lying about what is stored.
|
|
32
|
+
*/
|
|
33
|
+
export const READING_SETTINGS = {
|
|
34
|
+
child: 'reading',
|
|
35
|
+
label: 'Reading',
|
|
36
|
+
path: settingsPagePath('reading'),
|
|
37
|
+
template: ADMIN_TEMPLATES.settingsReading,
|
|
38
|
+
fields: ['homepage', 'postsPage', 'postsPerPage', 'notifyServer'],
|
|
39
|
+
panels: (c, settings) => {
|
|
40
|
+
const choices = pageChoices(c);
|
|
41
|
+
const missing = (slug) => slug !== '' && !choices.some((choice) => choice.slug === slug);
|
|
42
|
+
return {
|
|
43
|
+
pageChoices: choices,
|
|
44
|
+
homepageMissing: missing(settings.homepage),
|
|
45
|
+
postsPageMissing: missing(settings.postsPage),
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=settings-reading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-reading.js","sourceRoot":"","sources":["../../src/admin/settings-reading.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAUjD,kEAAkE;AAClE,MAAM,UAAU,WAAW,CAAC,CAAsB;IAChD,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;IAE9B,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK;SACf,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;SACzE,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;SACrD,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;SACnE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;GASG;AACH,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