@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,120 @@
|
|
|
1
|
+
import type { ConditionalHeaders } from './negotiate.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Where the sitemap and the robots file live, and what goes in them.
|
|
4
|
+
*
|
|
5
|
+
* Both are fixed paths at the root of the site, which is the only place a
|
|
6
|
+
* crawler looks for them, so both are real routes rather than anything
|
|
7
|
+
* resolved from the content index — a document permalinked at `/sitemap.xml`
|
|
8
|
+
* cannot take the URL a search engine polls.
|
|
9
|
+
*
|
|
10
|
+
* This module writes the documents and answers the requests; the *contents* of
|
|
11
|
+
* the sitemap — which URLs the site publishes — are assembled in
|
|
12
|
+
* `routes.ts`, where the listings, the archives and the permalinks are already
|
|
13
|
+
* spelled, so the sitemap cannot disagree with the site about where anything
|
|
14
|
+
* is.
|
|
15
|
+
*/
|
|
16
|
+
/** The sitemap's URL. Fixed: it is the one a `robots.txt` names. */
|
|
17
|
+
export declare const SITEMAP_PATH = "/sitemap.xml";
|
|
18
|
+
/** The robots file's URL. Fixed by the standard; nothing else is looked at. */
|
|
19
|
+
export declare const ROBOTS_PATH = "/robots.txt";
|
|
20
|
+
/** The namespace both a `<urlset>` and a `<sitemapindex>` are written in. */
|
|
21
|
+
export declare const SITEMAP_NAMESPACE = "http://www.sitemaps.org/schemas/sitemap/0.9";
|
|
22
|
+
/**
|
|
23
|
+
* How many URLs one sitemap file may hold before the site serves an index of
|
|
24
|
+
* several instead.
|
|
25
|
+
*
|
|
26
|
+
* The protocol's own ceiling. Its other ceiling is 50 MB uncompressed, which
|
|
27
|
+
* this one reaches first by a wide margin: an entry is a `<loc>` and a
|
|
28
|
+
* `<lastmod>`, on the order of 120 bytes, so a full file is nearer 6 MB than
|
|
29
|
+
* 50. Splitting on the count alone keeps one number to reason about.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SITEMAP_MAX_URLS = 50000;
|
|
32
|
+
/**
|
|
33
|
+
* The route pattern the child sitemaps are served under.
|
|
34
|
+
*
|
|
35
|
+
* How many children there are depends on how much the site has published, so
|
|
36
|
+
* they cannot be a list of literal routes; the pattern is fixed even though
|
|
37
|
+
* the set is not.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SITEMAP_CHILD_ROUTE = "/sitemap-:page{[0-9]+}.xml";
|
|
40
|
+
/** The URL of the nth child sitemap, counting from one. */
|
|
41
|
+
export declare function sitemapChildPath(page: number): string;
|
|
42
|
+
/** One entry: a URL the site publishes, and when it last changed. */
|
|
43
|
+
export interface SitemapUrl {
|
|
44
|
+
/** The site-relative path, as the site itself spells it. */
|
|
45
|
+
loc: string;
|
|
46
|
+
/** When it last changed, or `undefined` when nothing dates it. */
|
|
47
|
+
lastmod?: Date | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A date as the sitemap protocol wants it: a W3C datetime.
|
|
51
|
+
*
|
|
52
|
+
* The milliseconds go, because nothing about a page changes within one and a
|
|
53
|
+
* crawler reads the field to the second at best.
|
|
54
|
+
*/
|
|
55
|
+
export declare function sitemapDate(date: Date): string;
|
|
56
|
+
/** One `<urlset>` document over the URLs it is given. */
|
|
57
|
+
export declare function sitemapXml(urls: readonly SitemapUrl[], baseUrl: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* One `<sitemapindex>` document naming the child sitemaps.
|
|
60
|
+
*
|
|
61
|
+
* Same shape as a `<urlset>` with a different element name around each entry,
|
|
62
|
+
* which is exactly what the protocol says the two documents are.
|
|
63
|
+
*/
|
|
64
|
+
export declare function sitemapIndexXml(children: readonly SitemapUrl[], baseUrl: string): string;
|
|
65
|
+
/** What a sitemap is served as. */
|
|
66
|
+
export declare const SITEMAP_CONTENT_TYPE = "application/xml; charset=utf-8";
|
|
67
|
+
/** What a robots file is served as. */
|
|
68
|
+
export declare const ROBOTS_CONTENT_TYPE = "text/plain; charset=utf-8";
|
|
69
|
+
/** Everything one sitemap response needs. */
|
|
70
|
+
export interface SitemapResponseOptions {
|
|
71
|
+
/** Every URL the site publishes, in the order the sitemap should list them. */
|
|
72
|
+
urls: readonly SitemapUrl[];
|
|
73
|
+
/** The site's public origin, for the absolute `<loc>`s. */
|
|
74
|
+
baseUrl: string;
|
|
75
|
+
/**
|
|
76
|
+
* Which child sitemap to serve, counting from one, or `undefined` for
|
|
77
|
+
* `/sitemap.xml` itself.
|
|
78
|
+
*/
|
|
79
|
+
page?: number | undefined;
|
|
80
|
+
/** URLs per file. Defaults to {@link SITEMAP_MAX_URLS}. */
|
|
81
|
+
maxUrls?: number | undefined;
|
|
82
|
+
/** The request's conditional headers, for the 304. */
|
|
83
|
+
conditional?: ConditionalHeaders | undefined;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* One sitemap as an HTTP response, or `undefined` when the URL names a child
|
|
87
|
+
* that does not exist and the caller owes a 404.
|
|
88
|
+
*
|
|
89
|
+
* `/sitemap.xml` is the whole thing while it fits, and an index naming the
|
|
90
|
+
* children once it does not — a crawler that holds the URL keeps it either
|
|
91
|
+
* way, which is the point of the index living at the same address.
|
|
92
|
+
*
|
|
93
|
+
* The validators are built before the conditional is decided, exactly as the
|
|
94
|
+
* feeds do it, so a crawler polling with `If-None-Match` still gets the ETag
|
|
95
|
+
* and the `Last-Modified` on the 304 it mostly receives.
|
|
96
|
+
*/
|
|
97
|
+
export declare function sitemapResponse(options: SitemapResponseOptions): Response | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* The robots file: everything public is crawlable, the admin is not, and the
|
|
100
|
+
* sitemap is named absolutely because that is the only spelling the standard
|
|
101
|
+
* allows for a `Sitemap:` line.
|
|
102
|
+
*
|
|
103
|
+
* Nothing else is disallowed. The ActivityPub routes under `/ap/` are left
|
|
104
|
+
* open deliberately: an actor and an object are documents meant to be
|
|
105
|
+
* fetched, they carry the same content as the pages that link to them, and a
|
|
106
|
+
* crawler that follows one gets JSON it will ignore. Hiding them would only
|
|
107
|
+
* make the fediverse's own view of the site depend on a file written for
|
|
108
|
+
* search engines.
|
|
109
|
+
*/
|
|
110
|
+
export declare function robotsTxt(baseUrl: string): string;
|
|
111
|
+
/**
|
|
112
|
+
* The robots file as an HTTP response.
|
|
113
|
+
*
|
|
114
|
+
* It has a validator but no `Last-Modified`: nothing dates it. Its body is a
|
|
115
|
+
* function of the site's origin alone, so the ETag moves when that does and
|
|
116
|
+
* never otherwise, which is exactly what a crawler's `If-None-Match` should
|
|
117
|
+
* be told.
|
|
118
|
+
*/
|
|
119
|
+
export declare function robotsResponse(baseUrl: string, conditional?: ConditionalHeaders): Response;
|
|
120
|
+
//# sourceMappingURL=sitemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/web/sitemap.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AAEH,oEAAoE;AACpE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,+EAA+E;AAC/E,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,gDAAgD,CAAC;AAE/E;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAAS,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE9C;AAED,yDAAyD;AACzD,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAExF;AA2BD,mCAAmC;AACnC,eAAO,MAAM,oBAAoB,mCAAmC,CAAC;AAErE,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACrC,+EAA+E;IAC/E,IAAI,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5B,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,sDAAsD;IACtD,WAAW,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CAC9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,QAAQ,GAAG,SAAS,CA+BrF;AA2CD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,kBAAkB,GAAG,QAAQ,CAW1F"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { ADMIN_PREFIX } from '../admin/session.js';
|
|
2
|
+
import { escapeXml } from './feeds.js';
|
|
3
|
+
import { absoluteUrl, contentEtag, isNotModified } from './negotiate.js';
|
|
4
|
+
/**
|
|
5
|
+
* Where the sitemap and the robots file live, and what goes in them.
|
|
6
|
+
*
|
|
7
|
+
* Both are fixed paths at the root of the site, which is the only place a
|
|
8
|
+
* crawler looks for them, so both are real routes rather than anything
|
|
9
|
+
* resolved from the content index — a document permalinked at `/sitemap.xml`
|
|
10
|
+
* cannot take the URL a search engine polls.
|
|
11
|
+
*
|
|
12
|
+
* This module writes the documents and answers the requests; the *contents* of
|
|
13
|
+
* the sitemap — which URLs the site publishes — are assembled in
|
|
14
|
+
* `routes.ts`, where the listings, the archives and the permalinks are already
|
|
15
|
+
* spelled, so the sitemap cannot disagree with the site about where anything
|
|
16
|
+
* is.
|
|
17
|
+
*/
|
|
18
|
+
/** The sitemap's URL. Fixed: it is the one a `robots.txt` names. */
|
|
19
|
+
export const SITEMAP_PATH = '/sitemap.xml';
|
|
20
|
+
/** The robots file's URL. Fixed by the standard; nothing else is looked at. */
|
|
21
|
+
export const ROBOTS_PATH = '/robots.txt';
|
|
22
|
+
/** The namespace both a `<urlset>` and a `<sitemapindex>` are written in. */
|
|
23
|
+
export const SITEMAP_NAMESPACE = 'http://www.sitemaps.org/schemas/sitemap/0.9';
|
|
24
|
+
/**
|
|
25
|
+
* How many URLs one sitemap file may hold before the site serves an index of
|
|
26
|
+
* several instead.
|
|
27
|
+
*
|
|
28
|
+
* The protocol's own ceiling. Its other ceiling is 50 MB uncompressed, which
|
|
29
|
+
* this one reaches first by a wide margin: an entry is a `<loc>` and a
|
|
30
|
+
* `<lastmod>`, on the order of 120 bytes, so a full file is nearer 6 MB than
|
|
31
|
+
* 50. Splitting on the count alone keeps one number to reason about.
|
|
32
|
+
*/
|
|
33
|
+
export const SITEMAP_MAX_URLS = 50_000;
|
|
34
|
+
/**
|
|
35
|
+
* The route pattern the child sitemaps are served under.
|
|
36
|
+
*
|
|
37
|
+
* How many children there are depends on how much the site has published, so
|
|
38
|
+
* they cannot be a list of literal routes; the pattern is fixed even though
|
|
39
|
+
* the set is not.
|
|
40
|
+
*/
|
|
41
|
+
export const SITEMAP_CHILD_ROUTE = '/sitemap-:page{[0-9]+}.xml';
|
|
42
|
+
/** The URL of the nth child sitemap, counting from one. */
|
|
43
|
+
export function sitemapChildPath(page) {
|
|
44
|
+
return `/sitemap-${String(page)}.xml`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A date as the sitemap protocol wants it: a W3C datetime.
|
|
48
|
+
*
|
|
49
|
+
* The milliseconds go, because nothing about a page changes within one and a
|
|
50
|
+
* crawler reads the field to the second at best.
|
|
51
|
+
*/
|
|
52
|
+
export function sitemapDate(date) {
|
|
53
|
+
return date.toISOString().replace(/\.\d+Z$/, 'Z');
|
|
54
|
+
}
|
|
55
|
+
/** One `<urlset>` document over the URLs it is given. */
|
|
56
|
+
export function sitemapXml(urls, baseUrl) {
|
|
57
|
+
return document('urlset', urls, baseUrl, 'url');
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* One `<sitemapindex>` document naming the child sitemaps.
|
|
61
|
+
*
|
|
62
|
+
* Same shape as a `<urlset>` with a different element name around each entry,
|
|
63
|
+
* which is exactly what the protocol says the two documents are.
|
|
64
|
+
*/
|
|
65
|
+
export function sitemapIndexXml(children, baseUrl) {
|
|
66
|
+
return document('sitemapindex', children, baseUrl, 'sitemap');
|
|
67
|
+
}
|
|
68
|
+
/** Either sitemap document: the same entries under a different pair of names. */
|
|
69
|
+
function document(root, entries, baseUrl, entryName) {
|
|
70
|
+
const lines = [
|
|
71
|
+
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
72
|
+
`<${root} xmlns="${SITEMAP_NAMESPACE}">`,
|
|
73
|
+
];
|
|
74
|
+
for (const entry of entries) {
|
|
75
|
+
lines.push(` <${entryName}>`);
|
|
76
|
+
lines.push(` <loc>${escapeXml(absoluteUrl(entry.loc, baseUrl))}</loc>`);
|
|
77
|
+
if (entry.lastmod !== undefined) {
|
|
78
|
+
lines.push(` <lastmod>${sitemapDate(entry.lastmod)}</lastmod>`);
|
|
79
|
+
}
|
|
80
|
+
lines.push(` </${entryName}>`);
|
|
81
|
+
}
|
|
82
|
+
lines.push(`</${root}>`, '');
|
|
83
|
+
return lines.join('\n');
|
|
84
|
+
}
|
|
85
|
+
/** What a sitemap is served as. */
|
|
86
|
+
export const SITEMAP_CONTENT_TYPE = 'application/xml; charset=utf-8';
|
|
87
|
+
/** What a robots file is served as. */
|
|
88
|
+
export const ROBOTS_CONTENT_TYPE = 'text/plain; charset=utf-8';
|
|
89
|
+
/**
|
|
90
|
+
* One sitemap as an HTTP response, or `undefined` when the URL names a child
|
|
91
|
+
* that does not exist and the caller owes a 404.
|
|
92
|
+
*
|
|
93
|
+
* `/sitemap.xml` is the whole thing while it fits, and an index naming the
|
|
94
|
+
* children once it does not — a crawler that holds the URL keeps it either
|
|
95
|
+
* way, which is the point of the index living at the same address.
|
|
96
|
+
*
|
|
97
|
+
* The validators are built before the conditional is decided, exactly as the
|
|
98
|
+
* feeds do it, so a crawler polling with `If-None-Match` still gets the ETag
|
|
99
|
+
* and the `Last-Modified` on the 304 it mostly receives.
|
|
100
|
+
*/
|
|
101
|
+
export function sitemapResponse(options) {
|
|
102
|
+
const { urls, baseUrl, page } = options;
|
|
103
|
+
const maxUrls = options.maxUrls ?? SITEMAP_MAX_URLS;
|
|
104
|
+
const split = urls.length > maxUrls;
|
|
105
|
+
if (page !== undefined && (!split || page < 1 || page > chunkCount(urls.length, maxUrls))) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
const entries = page !== undefined
|
|
109
|
+
? urls.slice((page - 1) * maxUrls, page * maxUrls)
|
|
110
|
+
: split
|
|
111
|
+
? childEntries(urls, maxUrls)
|
|
112
|
+
: urls;
|
|
113
|
+
const body = page === undefined && split ? sitemapIndexXml(entries, baseUrl) : sitemapXml(entries, baseUrl);
|
|
114
|
+
const etag = contentEtag('sitemap', fingerprint(entries, baseUrl, page));
|
|
115
|
+
const lastModified = newest(entries);
|
|
116
|
+
const headers = new Headers({ etag, 'cache-control': 'no-cache' });
|
|
117
|
+
if (lastModified !== undefined)
|
|
118
|
+
headers.set('last-modified', lastModified.toUTCString());
|
|
119
|
+
if (isNotModified(options.conditional, etag, lastModified)) {
|
|
120
|
+
return new Response(null, { status: 304, headers });
|
|
121
|
+
}
|
|
122
|
+
headers.set('content-type', SITEMAP_CONTENT_TYPE);
|
|
123
|
+
return new Response(body, { headers });
|
|
124
|
+
}
|
|
125
|
+
/** How many child sitemaps a URL count needs. */
|
|
126
|
+
function chunkCount(total, maxUrls) {
|
|
127
|
+
return Math.ceil(total / maxUrls);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The children an index names: one per chunk, each dated by the newest thing
|
|
131
|
+
* in it, so a crawler can skip a file whose contents it already has.
|
|
132
|
+
*/
|
|
133
|
+
function childEntries(urls, maxUrls) {
|
|
134
|
+
const children = [];
|
|
135
|
+
for (let index = 0; index < chunkCount(urls.length, maxUrls); index += 1) {
|
|
136
|
+
const chunk = urls.slice(index * maxUrls, (index + 1) * maxUrls);
|
|
137
|
+
children.push({ loc: sitemapChildPath(index + 1), lastmod: newest(chunk) });
|
|
138
|
+
}
|
|
139
|
+
return children;
|
|
140
|
+
}
|
|
141
|
+
/** The most recent `lastmod` among some entries, if any has one. */
|
|
142
|
+
function newest(entries) {
|
|
143
|
+
let latest;
|
|
144
|
+
for (const entry of entries) {
|
|
145
|
+
if (entry.lastmod === undefined)
|
|
146
|
+
continue;
|
|
147
|
+
if (latest === undefined || entry.lastmod > latest)
|
|
148
|
+
latest = entry.lastmod;
|
|
149
|
+
}
|
|
150
|
+
return latest;
|
|
151
|
+
}
|
|
152
|
+
/** What a sitemap document is made of, as one string to hash. */
|
|
153
|
+
function fingerprint(entries, baseUrl, page) {
|
|
154
|
+
return [
|
|
155
|
+
baseUrl,
|
|
156
|
+
page === undefined ? 'index' : String(page),
|
|
157
|
+
...entries.map((entry) => `${entry.loc} ${entry.lastmod?.toISOString() ?? ''}`),
|
|
158
|
+
].join('\n');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The robots file: everything public is crawlable, the admin is not, and the
|
|
162
|
+
* sitemap is named absolutely because that is the only spelling the standard
|
|
163
|
+
* allows for a `Sitemap:` line.
|
|
164
|
+
*
|
|
165
|
+
* Nothing else is disallowed. The ActivityPub routes under `/ap/` are left
|
|
166
|
+
* open deliberately: an actor and an object are documents meant to be
|
|
167
|
+
* fetched, they carry the same content as the pages that link to them, and a
|
|
168
|
+
* crawler that follows one gets JSON it will ignore. Hiding them would only
|
|
169
|
+
* make the fediverse's own view of the site depend on a file written for
|
|
170
|
+
* search engines.
|
|
171
|
+
*/
|
|
172
|
+
export function robotsTxt(baseUrl) {
|
|
173
|
+
return [
|
|
174
|
+
'User-agent: *',
|
|
175
|
+
`Disallow: ${ADMIN_PREFIX}/`,
|
|
176
|
+
'',
|
|
177
|
+
`Sitemap: ${absoluteUrl(SITEMAP_PATH, baseUrl)}`,
|
|
178
|
+
'',
|
|
179
|
+
].join('\n');
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The robots file as an HTTP response.
|
|
183
|
+
*
|
|
184
|
+
* It has a validator but no `Last-Modified`: nothing dates it. Its body is a
|
|
185
|
+
* function of the site's origin alone, so the ETag moves when that does and
|
|
186
|
+
* never otherwise, which is exactly what a crawler's `If-None-Match` should
|
|
187
|
+
* be told.
|
|
188
|
+
*/
|
|
189
|
+
export function robotsResponse(baseUrl, conditional) {
|
|
190
|
+
const body = robotsTxt(baseUrl);
|
|
191
|
+
const etag = contentEtag('robots', body);
|
|
192
|
+
const headers = new Headers({ etag, 'cache-control': 'no-cache' });
|
|
193
|
+
if (isNotModified(conditional, etag, undefined)) {
|
|
194
|
+
return new Response(null, { status: 304, headers });
|
|
195
|
+
}
|
|
196
|
+
headers.set('content-type', ROBOTS_CONTENT_TYPE);
|
|
197
|
+
return new Response(body, { headers });
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=sitemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;KAChF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO;QACL,eAAe;QACf,aAAa,YAAY,GAAG;QAC5B,EAAE;QACF,YAAY,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE;QAChD,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,WAAgC;IAC9E,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC,CAAC;IAEnE,IAAI,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;QAChD,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACjD,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the taxonomy archives live, and how their URLs are spelled.
|
|
3
|
+
*
|
|
4
|
+
* The bases are a setting rather than a constant: a site moving off WordPress
|
|
5
|
+
* keeps `/tag/` and `/category/`, and a site that spells them otherwise says
|
|
6
|
+
* so on the settings screen. Everything that builds or parses one of those
|
|
7
|
+
* URLs — the public routes, the canonical redirects, the feeds, the theme, the
|
|
8
|
+
* ActivityStreams hashtags — goes through this module, so they cannot
|
|
9
|
+
* disagree about where an archive is.
|
|
10
|
+
*/
|
|
11
|
+
/** Where a paginated listing's later pages live, under any listing root. */
|
|
12
|
+
export declare const PAGE_SEGMENT = "page";
|
|
13
|
+
/** Which taxonomy an archive is over. */
|
|
14
|
+
export type Taxonomy = 'tag' | 'category';
|
|
15
|
+
/** Both taxonomies, in the order a screen or a loop should take them. */
|
|
16
|
+
export declare const TAXONOMIES: readonly Taxonomy[];
|
|
17
|
+
/** One archive: a taxonomy and the term whose documents it lists. */
|
|
18
|
+
export interface TaxonomyTerm {
|
|
19
|
+
/** `tag` or `category`. */
|
|
20
|
+
taxonomy: Taxonomy;
|
|
21
|
+
/** The term itself, as the file spells it. */
|
|
22
|
+
term: string;
|
|
23
|
+
}
|
|
24
|
+
/** The URL segment each taxonomy's archives live under. */
|
|
25
|
+
export type TaxonomyBases = Readonly<Record<Taxonomy, string>>;
|
|
26
|
+
/**
|
|
27
|
+
* One term that was renamed, and what it was renamed to.
|
|
28
|
+
*
|
|
29
|
+
* A rename moves an archive, and an archive is a URL somebody may have linked
|
|
30
|
+
* to. The site records the move so the old URL can point at the new one for as
|
|
31
|
+
* long as it says so — a small list in the settings, and so in `site.json`,
|
|
32
|
+
* where an Eleventy build of the same content can publish the same redirects.
|
|
33
|
+
*/
|
|
34
|
+
export interface TaxonomyRedirect {
|
|
35
|
+
/** Which taxonomy's archive moved. */
|
|
36
|
+
taxonomy: Taxonomy;
|
|
37
|
+
/** The term that used to be there. */
|
|
38
|
+
from: string;
|
|
39
|
+
/** The term that is there now. */
|
|
40
|
+
to: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The bases a site has before anybody says otherwise: WordPress's own, so a
|
|
44
|
+
* site imported from it keeps every archive URL it had published.
|
|
45
|
+
*/
|
|
46
|
+
export declare const DEFAULT_TAXONOMY_BASES: TaxonomyBases;
|
|
47
|
+
/** The word each taxonomy is called on a screen. */
|
|
48
|
+
export declare const TAXONOMY_LABELS: Readonly<Record<Taxonomy, string>>;
|
|
49
|
+
/**
|
|
50
|
+
* What a base may be made of: one path segment, starting with a letter or a
|
|
51
|
+
* digit, of at most 64 characters.
|
|
52
|
+
*
|
|
53
|
+
* Deliberately narrower than what a URL would carry. A base is the first
|
|
54
|
+
* segment of every archive URL the site publishes and the thing the router
|
|
55
|
+
* matches on, so it holds nothing that would need percent-encoding, nothing
|
|
56
|
+
* that could be read as a file extension, and no slash that would make it two
|
|
57
|
+
* segments.
|
|
58
|
+
*/
|
|
59
|
+
export declare const TAXONOMY_BASE_PATTERN: RegExp;
|
|
60
|
+
/**
|
|
61
|
+
* Top-level paths the site already answers on, which a base may not take over.
|
|
62
|
+
*
|
|
63
|
+
* `feed` was here before anything served it: TASK-37 put the feeds at `/feed/`,
|
|
64
|
+
* and a site that had taken the word would find its archives shadowed by an
|
|
65
|
+
* upgrade. `comments` is the site-wide comments feed's root, for the same
|
|
66
|
+
* reason. `taxonomy.test.ts` pins this list against the prefixes those routes
|
|
67
|
+
* are actually registered under, so it cannot fall behind them.
|
|
68
|
+
*
|
|
69
|
+
* `sitemap.xml` and `robots.txt` are here because they are paths the site
|
|
70
|
+
* answers on, which is what the list is: {@link TAXONOMY_BASE_PATTERN} would
|
|
71
|
+
* refuse either of them anyway for the dot, so the entries are belt and
|
|
72
|
+
* braces rather than the only thing standing in the way.
|
|
73
|
+
*
|
|
74
|
+
* `author` and `inbox` are reserved harder than the rest (decision-14). Every
|
|
75
|
+
* user is an actor at `/author/{username}/` and the shared inbox is `/inbox/`,
|
|
76
|
+
* and an actor id is a name a follower's server has filed the account under:
|
|
77
|
+
* a base that took one of those words would not shadow an archive, it would
|
|
78
|
+
* unmake an account. `web/authors.ts` spells them as `AUTHOR_BASE` and
|
|
79
|
+
* `INBOX_BASE`, and `taxonomy.test.ts` holds this list against those two
|
|
80
|
+
* constants, so the reservation and the URLs cannot drift apart; they are
|
|
81
|
+
* literals here only because that module reads {@link PAGE_SEGMENT} from this
|
|
82
|
+
* one, and a cycle between two files of constants is not worth the tidiness.
|
|
83
|
+
*/
|
|
84
|
+
export declare const RESERVED_TOP_LEVEL_PATHS: readonly string[];
|
|
85
|
+
/**
|
|
86
|
+
* The URL of a page of either taxonomy's archive, by zero-based index.
|
|
87
|
+
*
|
|
88
|
+
* This is the one place a taxonomy archive URL is spelled, so the routes, the
|
|
89
|
+
* pager, the canonical redirect, the theme links and the ActivityStreams
|
|
90
|
+
* hashtags cannot disagree about where an archive lives.
|
|
91
|
+
*/
|
|
92
|
+
export declare function termHref(term: TaxonomyTerm, index: number, bases: TaxonomyBases): string;
|
|
93
|
+
/** The URL of a page of a tag archive, by zero-based index. */
|
|
94
|
+
export declare function tagHref(tag: string, index: number, bases: TaxonomyBases): string;
|
|
95
|
+
/** The URL of a page of a category archive, by zero-based index. */
|
|
96
|
+
export declare function categoryHref(category: string, index: number, bases: TaxonomyBases): string;
|
|
97
|
+
/** The taxonomy a first URL segment names, or `undefined` when it names none. */
|
|
98
|
+
export declare function taxonomyForSegment(segment: string | undefined, bases: TaxonomyBases): Taxonomy | undefined;
|
|
99
|
+
/** One message per base that cannot be used. An empty object is a valid pair. */
|
|
100
|
+
export type TaxonomyBaseProblems = Partial<Record<Taxonomy, string>>;
|
|
101
|
+
/**
|
|
102
|
+
* What is wrong with a pair of bases, one message per taxonomy.
|
|
103
|
+
*
|
|
104
|
+
* The pair is checked together rather than one at a time because two of the
|
|
105
|
+
* rules are about the pair: they may not be the same word, and neither may be
|
|
106
|
+
* a path the site already answers on.
|
|
107
|
+
*/
|
|
108
|
+
export declare function taxonomyBaseProblems(bases: TaxonomyBases): TaxonomyBaseProblems;
|
|
109
|
+
/**
|
|
110
|
+
* A pair of bases as they should be stored: trimmed, and each replaced by its
|
|
111
|
+
* default when it is not usable. Only for reading a value back out of storage
|
|
112
|
+
* or a data file, where a bad value should not take the site down; a value on
|
|
113
|
+
* its way in goes through {@link taxonomyBaseProblems} and is refused.
|
|
114
|
+
*/
|
|
115
|
+
export declare function taxonomyBasesOrDefault(bases: Partial<Record<Taxonomy, unknown>>): TaxonomyBases;
|
|
116
|
+
/**
|
|
117
|
+
* The recorded renames after one more, with chains collapsed.
|
|
118
|
+
*
|
|
119
|
+
* Three rules, all of them about not making a browser walk a history it does
|
|
120
|
+
* not care about. Anything that pointed at `from` is repointed at `to`, so
|
|
121
|
+
* `a → b` followed by `b → c` is stored as `a → c` and answered in one hop. An
|
|
122
|
+
* older record of `from` moving somewhere else is replaced, because it is no
|
|
123
|
+
* longer true. And any record of `to` having moved away is dropped, because
|
|
124
|
+
* the term is back and an archive that answers always beats a record of where
|
|
125
|
+
* it used to be.
|
|
126
|
+
*/
|
|
127
|
+
export declare function recordTermRename(existing: readonly TaxonomyRedirect[], change: TaxonomyRedirect): TaxonomyRedirect[];
|
|
128
|
+
/**
|
|
129
|
+
* The recorded renames after a term is deleted.
|
|
130
|
+
*
|
|
131
|
+
* Every record pointing at it goes: the archive it named is about to 404, and
|
|
132
|
+
* a redirect to a 404 costs a round trip and tells the reader nothing. So does
|
|
133
|
+
* any record of that term having moved, which the delete has just settled.
|
|
134
|
+
*/
|
|
135
|
+
export declare function forgetTerm(existing: readonly TaxonomyRedirect[], taxonomy: Taxonomy, term: string): TaxonomyRedirect[];
|
|
136
|
+
/**
|
|
137
|
+
* Where a term went, or `undefined` when nothing says it went anywhere.
|
|
138
|
+
*
|
|
139
|
+
* One hop, deliberately: the list is written with its chains already collapsed
|
|
140
|
+
* ({@link recordTermRename}), and following it further would let a hand-edited
|
|
141
|
+
* `site.json` send a reader round a loop.
|
|
142
|
+
*/
|
|
143
|
+
export declare function redirectedTerm(redirects: readonly TaxonomyRedirect[], term: TaxonomyTerm): string | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* A value out of `site.json` or a stored setting as the renames it names.
|
|
146
|
+
*
|
|
147
|
+
* Tolerant, like everything that reads that file: an entry that is not a
|
|
148
|
+
* `{ taxonomy, from, to }` of three non-empty strings is dropped rather than
|
|
149
|
+
* failing the read, and so is one that redirects a term to itself.
|
|
150
|
+
*/
|
|
151
|
+
export declare function taxonomyRedirectsOf(value: unknown): TaxonomyRedirect[];
|
|
152
|
+
//# sourceMappingURL=taxonomy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../../src/web/taxonomy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC,yCAAyC;AACzC,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC;AAE1C,yEAAyE;AACzE,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAAwB,CAAC;AAEnE,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,2DAA2D;AAC3D,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,QAAQ,EAAE,QAAQ,CAAC;IACnB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAG9D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,QAAqC,CAAC;AAExE;;;;;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