@geekity/cms 0.29.0 → 0.31.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 +26 -4214
- package/admin/pages/settings/privacy.njk +1 -1
- package/dist/access-log.d.ts +2 -10
- package/dist/access-log.d.ts.map +1 -1
- package/dist/access-log.js +1 -1
- package/dist/access-log.js.map +1 -1
- package/dist/{web → admin}/admin-bar.d.ts +3 -2
- package/dist/admin/admin-bar.d.ts.map +1 -0
- package/dist/{web → admin}/admin-bar.js +20 -17
- package/dist/admin/admin-bar.js.map +1 -0
- package/dist/{indieauth → admin}/app-activity.d.ts +2 -2
- package/dist/admin/app-activity.d.ts.map +1 -0
- package/dist/{indieauth → admin}/app-activity.js +5 -5
- package/dist/admin/app-activity.js.map +1 -0
- package/dist/admin/appearance.d.ts +3 -3
- package/dist/admin/appearance.d.ts.map +1 -1
- package/dist/admin/appearance.js +12 -6
- package/dist/admin/appearance.js.map +1 -1
- package/dist/admin/assets.d.ts +1 -8
- package/dist/admin/assets.d.ts.map +1 -1
- package/dist/admin/assets.js +2 -9
- package/dist/admin/assets.js.map +1 -1
- package/dist/admin/comments.d.ts +2 -2
- package/dist/admin/comments.d.ts.map +1 -1
- package/dist/admin/comments.js +16 -17
- package/dist/admin/comments.js.map +1 -1
- package/dist/{indieauth → admin}/connected-apps.d.ts +2 -2
- package/dist/admin/connected-apps.d.ts.map +1 -0
- package/dist/{indieauth → admin}/connected-apps.js +18 -19
- package/dist/admin/connected-apps.js.map +1 -0
- package/dist/admin/credentials.js +1 -1
- package/dist/admin/credentials.js.map +1 -1
- package/dist/admin/dev-mode.d.ts +1 -1
- package/dist/admin/dev-mode.d.ts.map +1 -1
- package/dist/admin/documents.d.ts +16 -301
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +74 -1032
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/editor-actions.d.ts +3 -2
- package/dist/admin/editor-actions.d.ts.map +1 -1
- package/dist/admin/editor-actions.js +8 -8
- package/dist/admin/editor-actions.js.map +1 -1
- package/dist/admin/editor-fields.d.ts +45 -0
- package/dist/admin/editor-fields.d.ts.map +1 -0
- package/dist/admin/editor-fields.js +71 -0
- package/dist/admin/editor-fields.js.map +1 -0
- package/dist/admin/editor-layout.d.ts +2 -10
- package/dist/admin/editor-layout.d.ts.map +1 -1
- package/dist/admin/editor-layout.js +1 -1
- package/dist/admin/editor-layout.js.map +1 -1
- package/dist/admin/federation.d.ts +5 -5
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +16 -18
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/flash.d.ts +2 -2
- package/dist/admin/flash.d.ts.map +1 -1
- package/dist/admin/headers.d.ts +1 -1
- package/dist/admin/headers.d.ts.map +1 -1
- package/dist/admin/headers.js +1 -1
- package/dist/admin/headers.js.map +1 -1
- package/dist/admin/index.d.ts +38 -20
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +27 -13
- package/dist/admin/index.js.map +1 -1
- package/dist/{indieauth/consent.d.ts → admin/indieauth-consent.d.ts} +4 -4
- package/dist/admin/indieauth-consent.d.ts.map +1 -0
- package/dist/{indieauth/consent.js → admin/indieauth-consent.js} +17 -18
- package/dist/admin/indieauth-consent.js.map +1 -0
- package/dist/admin/legacy-migrations.d.ts +131 -0
- package/dist/admin/legacy-migrations.d.ts.map +1 -0
- package/dist/admin/legacy-migrations.js +235 -0
- package/dist/admin/legacy-migrations.js.map +1 -0
- package/dist/admin/media.d.ts +4 -108
- package/dist/admin/media.d.ts.map +1 -1
- package/dist/admin/media.js +19 -187
- package/dist/admin/media.js.map +1 -1
- package/dist/admin/menu.d.ts.map +1 -1
- package/dist/admin/menu.js +7 -7
- package/dist/admin/menu.js.map +1 -1
- package/dist/admin/messages.d.ts +1 -1
- package/dist/admin/messages.d.ts.map +1 -1
- package/dist/admin/messages.js +10 -12
- package/dist/admin/messages.js.map +1 -1
- package/dist/admin/navigation.d.ts +3 -3
- package/dist/admin/navigation.d.ts.map +1 -1
- package/dist/admin/navigation.js +9 -12
- package/dist/admin/navigation.js.map +1 -1
- package/dist/admin/personal-data.d.ts +1 -1
- package/dist/admin/personal-data.d.ts.map +1 -1
- package/dist/admin/personal-data.js +3 -6
- package/dist/admin/personal-data.js.map +1 -1
- package/dist/admin/plugins.d.ts +1 -1
- package/dist/admin/plugins.d.ts.map +1 -1
- package/dist/admin/plugins.js +11 -15
- package/dist/admin/plugins.js.map +1 -1
- package/dist/admin/preview.d.ts +2 -1
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +28 -32
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/recovery.d.ts +3 -3
- package/dist/admin/recovery.d.ts.map +1 -1
- package/dist/admin/recovery.js +10 -12
- package/dist/admin/recovery.js.map +1 -1
- package/dist/admin/routes.d.ts +1 -3
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +28 -26
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/settings-discussion.d.ts.map +1 -1
- package/dist/admin/settings-discussion.js +7 -4
- package/dist/admin/settings-discussion.js.map +1 -1
- package/dist/admin/settings-email.d.ts +1 -1
- package/dist/admin/settings-email.d.ts.map +1 -1
- package/dist/admin/settings-email.js +13 -10
- package/dist/admin/settings-email.js.map +1 -1
- package/dist/admin/settings-general.d.ts.map +1 -1
- package/dist/admin/settings-general.js +10 -7
- package/dist/admin/settings-general.js.map +1 -1
- package/dist/admin/settings-page.d.ts +3 -4
- package/dist/admin/settings-page.d.ts.map +1 -1
- package/dist/admin/settings-page.js +5 -6
- package/dist/admin/settings-page.js.map +1 -1
- package/dist/admin/settings-pages.d.ts +1 -1
- package/dist/admin/settings-pages.d.ts.map +1 -1
- package/dist/admin/settings-permalinks.js +1 -1
- package/dist/admin/settings-permalinks.js.map +1 -1
- package/dist/admin/settings-reading.d.ts +2 -2
- package/dist/admin/settings-reading.d.ts.map +1 -1
- package/dist/admin/settings-reading.js +4 -3
- package/dist/admin/settings-reading.js.map +1 -1
- package/dist/admin/settings.d.ts +0 -579
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +1 -1155
- package/dist/admin/settings.js.map +1 -1
- package/dist/admin/syndication-targets.d.ts +1 -1
- package/dist/admin/syndication-targets.d.ts.map +1 -1
- package/dist/admin/syndication-targets.js +11 -15
- package/dist/admin/syndication-targets.js.map +1 -1
- package/dist/admin/taxonomy.d.ts +2 -2
- package/dist/admin/taxonomy.d.ts.map +1 -1
- package/dist/admin/taxonomy.js +8 -11
- package/dist/admin/taxonomy.js.map +1 -1
- package/dist/admin/templates.js +1 -1
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/tools.d.ts +4 -4
- package/dist/admin/tools.d.ts.map +1 -1
- package/dist/admin/tools.js +3 -6
- package/dist/admin/tools.js.map +1 -1
- package/dist/admin/uploads.d.ts +1 -106
- package/dist/admin/uploads.d.ts.map +1 -1
- package/dist/admin/uploads.js +2 -191
- package/dist/admin/uploads.js.map +1 -1
- package/dist/admin/users.d.ts +20 -15
- package/dist/admin/users.d.ts.map +1 -1
- package/dist/admin/users.js +83 -80
- package/dist/admin/users.js.map +1 -1
- package/dist/avatars/avatars.d.ts +2 -2
- package/dist/avatars/avatars.d.ts.map +1 -1
- package/dist/avatars/avatars.js +6 -9
- package/dist/avatars/avatars.js.map +1 -1
- package/dist/avatars/index.d.ts +0 -1
- package/dist/avatars/index.d.ts.map +1 -1
- package/dist/avatars/index.js +0 -1
- package/dist/avatars/index.js.map +1 -1
- package/dist/cache.d.ts +4 -2
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +11 -5
- package/dist/cache.js.map +1 -1
- package/dist/cli.d.ts +2 -33
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +245 -267
- package/dist/cli.js.map +1 -1
- package/dist/cms/app.d.ts +11 -0
- package/dist/cms/app.d.ts.map +1 -0
- package/dist/cms/app.js +115 -0
- package/dist/cms/app.js.map +1 -0
- package/dist/cms/boot.d.ts +14 -0
- package/dist/cms/boot.d.ts.map +1 -0
- package/dist/cms/boot.js +107 -0
- package/dist/cms/boot.js.map +1 -0
- package/dist/cms/create.d.ts +248 -0
- package/dist/cms/create.d.ts.map +1 -0
- package/dist/cms/create.js +167 -0
- package/dist/cms/create.js.map +1 -0
- package/dist/cms/lifecycle.d.ts +11 -0
- package/dist/cms/lifecycle.d.ts.map +1 -0
- package/dist/cms/lifecycle.js +15 -0
- package/dist/cms/lifecycle.js.map +1 -0
- package/dist/{web/errors.d.ts → cms/server-error.d.ts} +2 -8
- package/dist/cms/server-error.d.ts.map +1 -0
- package/dist/{web/errors.js → cms/server-error.js} +4 -14
- package/dist/cms/server-error.js.map +1 -0
- package/dist/cms/services.d.ts +55 -0
- package/dist/cms/services.d.ts.map +1 -0
- package/dist/cms/services.js +353 -0
- package/dist/cms/services.js.map +1 -0
- package/dist/cms/site-records.d.ts +4 -0
- package/dist/cms/site-records.d.ts.map +1 -0
- package/dist/cms/site-records.js +15 -0
- package/dist/cms/site-records.js.map +1 -0
- package/dist/comments/akismet.d.ts +1 -1
- package/dist/comments/akismet.d.ts.map +1 -1
- package/dist/comments/akismet.js +1 -3
- package/dist/comments/akismet.js.map +1 -1
- package/dist/comments/conversation.d.ts +334 -0
- package/dist/comments/conversation.d.ts.map +1 -0
- package/dist/comments/conversation.js +51 -0
- package/dist/comments/conversation.js.map +1 -0
- package/dist/comments/form.d.ts +2 -2
- package/dist/comments/form.d.ts.map +1 -1
- package/dist/comments/form.js +2 -2
- package/dist/comments/form.js.map +1 -1
- package/dist/comments/index.d.ts +12 -6
- package/dist/comments/index.d.ts.map +1 -1
- package/dist/comments/index.js +7 -4
- package/dist/comments/index.js.map +1 -1
- package/dist/comments/intake.d.ts +147 -0
- package/dist/comments/intake.d.ts.map +1 -0
- package/dist/comments/intake.js +161 -0
- package/dist/comments/intake.js.map +1 -0
- package/dist/comments/markdown.d.ts.map +1 -1
- package/dist/comments/markdown.js +2 -9
- package/dist/comments/markdown.js.map +1 -1
- package/dist/comments/migrations.d.ts +45 -0
- package/dist/comments/migrations.d.ts.map +1 -0
- package/dist/comments/migrations.js +194 -0
- package/dist/comments/migrations.js.map +1 -0
- package/dist/comments/moderate.d.ts +2 -2
- package/dist/comments/moderate.d.ts.map +1 -1
- package/dist/comments/moderate.js +3 -13
- package/dist/comments/moderate.js.map +1 -1
- package/dist/comments/page-form.d.ts +52 -0
- package/dist/comments/page-form.d.ts.map +1 -0
- package/dist/comments/page-form.js +62 -0
- package/dist/comments/page-form.js.map +1 -0
- package/dist/comments/policy.d.ts +1 -9
- package/dist/comments/policy.d.ts.map +1 -1
- package/dist/comments/policy.js +3 -18
- package/dist/comments/policy.js.map +1 -1
- package/dist/comments/records.d.ts +25 -173
- package/dist/comments/records.d.ts.map +1 -1
- package/dist/comments/records.js +69 -265
- package/dist/comments/records.js.map +1 -1
- package/dist/comments/reply-notices.d.ts +5 -5
- package/dist/comments/reply-notices.d.ts.map +1 -1
- package/dist/comments/reply-notices.js +6 -6
- package/dist/comments/reply-notices.js.map +1 -1
- package/dist/comments/reply-post.d.ts +2 -2
- package/dist/comments/reply-post.d.ts.map +1 -1
- package/dist/comments/reply-post.js +7 -5
- package/dist/comments/reply-post.js.map +1 -1
- package/dist/comments/routes.d.ts +3 -3
- package/dist/comments/routes.d.ts.map +1 -1
- package/dist/comments/routes.js +22 -34
- package/dist/comments/routes.js.map +1 -1
- package/dist/comments/submission.d.ts +5 -100
- package/dist/comments/submission.d.ts.map +1 -1
- package/dist/comments/submission.js +5 -20
- package/dist/comments/submission.js.map +1 -1
- package/dist/comments/viewer.d.ts +1 -25
- package/dist/comments/viewer.d.ts.map +1 -1
- package/dist/comments/viewer.js +1 -44
- package/dist/comments/viewer.js.map +1 -1
- package/dist/config-loader.d.ts +35 -0
- package/dist/config-loader.d.ts.map +1 -0
- package/dist/config-loader.js +116 -0
- package/dist/config-loader.js.map +1 -0
- package/dist/config.d.ts +72 -50
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +132 -180
- package/dist/config.js.map +1 -1
- package/dist/contact/delivery.d.ts +1 -1
- package/dist/contact/delivery.d.ts.map +1 -1
- package/dist/contact/delivery.js +5 -13
- package/dist/contact/delivery.js.map +1 -1
- package/dist/contact/form.d.ts +2 -4
- package/dist/contact/form.d.ts.map +1 -1
- package/dist/contact/form.js +3 -4
- package/dist/contact/form.js.map +1 -1
- package/dist/contact/index.d.ts +2 -2
- package/dist/contact/index.d.ts.map +1 -1
- package/dist/contact/index.js +2 -2
- package/dist/contact/index.js.map +1 -1
- package/dist/contact/records.d.ts.map +1 -1
- package/dist/contact/records.js +8 -11
- package/dist/contact/records.js.map +1 -1
- package/dist/contact/submission.d.ts +2 -2
- package/dist/contact/submission.d.ts.map +1 -1
- package/dist/contact/submission.js +7 -16
- package/dist/contact/submission.js.map +1 -1
- package/dist/{images → content}/alt-text.d.ts +1 -1
- package/dist/content/alt-text.d.ts.map +1 -0
- package/dist/{images → content}/alt-text.js +3 -5
- package/dist/content/alt-text.js.map +1 -0
- package/dist/content/authors.d.ts +79 -0
- package/dist/content/authors.d.ts.map +1 -0
- package/dist/content/authors.js +106 -0
- package/dist/content/authors.js.map +1 -0
- package/dist/content/citation.d.ts +3 -0
- package/dist/content/citation.d.ts.map +1 -1
- package/dist/content/citation.js +3 -0
- package/dist/content/citation.js.map +1 -1
- package/dist/content/comments.d.ts +3 -0
- package/dist/content/comments.d.ts.map +1 -0
- package/dist/content/comments.js +3 -0
- package/dist/content/comments.js.map +1 -0
- package/dist/content/contact.d.ts +3 -0
- package/dist/content/contact.d.ts.map +1 -0
- package/dist/content/contact.js +3 -0
- package/dist/content/contact.js.map +1 -0
- package/dist/content/document-form.d.ts +195 -0
- package/dist/content/document-form.d.ts.map +1 -0
- package/dist/content/document-form.js +201 -0
- package/dist/content/document-form.js.map +1 -0
- package/dist/content/document-kind.d.ts +55 -0
- package/dist/content/document-kind.d.ts.map +1 -0
- package/dist/content/document-kind.js +30 -0
- package/dist/content/document-kind.js.map +1 -0
- package/dist/{admin/enclosure-field.d.ts → content/enclosure-form.d.ts} +14 -34
- package/dist/content/enclosure-form.d.ts.map +1 -0
- package/dist/{admin/enclosure-field.js → content/enclosure-form.js} +39 -76
- package/dist/content/enclosure-form.js.map +1 -0
- package/dist/content/enclosure.d.ts.map +1 -1
- package/dist/content/enclosure.js +3 -4
- package/dist/content/enclosure.js.map +1 -1
- package/dist/{admin/event-field.d.ts → content/event-form.d.ts} +6 -5
- package/dist/content/event-form.d.ts.map +1 -0
- package/dist/{admin/event-field.js → content/event-form.js} +45 -12
- package/dist/content/event-form.js.map +1 -0
- package/dist/content/excerpt.d.ts +25 -0
- package/dist/content/excerpt.d.ts.map +1 -0
- package/dist/content/excerpt.js +43 -0
- package/dist/content/excerpt.js.map +1 -0
- package/dist/content/form-error.d.ts +10 -0
- package/dist/content/form-error.d.ts.map +1 -0
- package/dist/content/form-error.js +2 -0
- package/dist/content/form-error.js.map +1 -0
- package/dist/{web → content}/guids.d.ts +14 -19
- package/dist/content/guids.d.ts.map +1 -0
- package/dist/{web → content}/guids.js +30 -19
- package/dist/content/guids.js.map +1 -0
- package/dist/content/image-tags.d.ts +25 -0
- package/dist/content/image-tags.d.ts.map +1 -0
- package/dist/content/image-tags.js +55 -0
- package/dist/content/image-tags.js.map +1 -0
- package/dist/content/index.d.ts +9 -4
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +5 -2
- package/dist/content/index.js.map +1 -1
- package/dist/content/language.d.ts +19 -0
- package/dist/content/language.d.ts.map +1 -0
- package/dist/content/language.js +19 -0
- package/dist/content/language.js.map +1 -0
- package/dist/content/license.d.ts.map +1 -0
- package/dist/content/license.js.map +1 -0
- package/dist/{web → content}/locale.d.ts +0 -6
- package/dist/content/locale.d.ts.map +1 -0
- package/dist/{web → content}/locale.js +1 -6
- package/dist/content/locale.js.map +1 -0
- package/dist/content/location-form.d.ts +17 -0
- package/dist/content/location-form.d.ts.map +1 -0
- package/dist/{admin/location-field.js → content/location-form.js} +2 -23
- package/dist/content/location-form.js.map +1 -0
- package/dist/content/location.d.ts.map +1 -1
- package/dist/content/location.js +1 -3
- package/dist/content/location.js.map +1 -1
- package/dist/content/markdown-links.d.ts +11 -0
- package/dist/content/markdown-links.d.ts.map +1 -0
- package/dist/content/markdown-links.js +223 -0
- package/dist/content/markdown-links.js.map +1 -0
- package/dist/content/markdown.d.ts +2 -1
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content/markdown.js.map +1 -1
- package/dist/content/migrated.js +1 -1
- package/dist/content/migrated.js.map +1 -1
- package/dist/content/parser.d.ts.map +1 -1
- package/dist/content/parser.js +1 -12
- package/dist/content/parser.js.map +1 -1
- package/dist/content/permalinks.d.ts +34 -0
- package/dist/content/permalinks.d.ts.map +1 -0
- package/dist/{web/documents.js → content/permalinks.js} +6 -56
- package/dist/content/permalinks.js.map +1 -0
- package/dist/content/photo-form.d.ts +28 -0
- package/dist/content/photo-form.d.ts.map +1 -0
- package/dist/{admin/photo-field.js → content/photo-form.js} +36 -36
- package/dist/content/photo-form.js.map +1 -0
- package/dist/content/photo.d.ts +1 -1
- package/dist/content/photo.d.ts.map +1 -1
- package/dist/content/photo.js +1 -1
- package/dist/content/photo.js.map +1 -1
- package/dist/content/post-fields.d.ts +40 -0
- package/dist/content/post-fields.d.ts.map +1 -0
- package/dist/content/post-fields.js +256 -0
- package/dist/content/post-fields.js.map +1 -0
- package/dist/{admin/read-field.d.ts → content/read-form.d.ts} +6 -4
- package/dist/content/read-form.d.ts.map +1 -0
- package/dist/content/read-form.js +99 -0
- package/dist/content/read-form.js.map +1 -0
- package/dist/content/read.d.ts.map +1 -1
- package/dist/content/read.js +7 -11
- package/dist/content/read.js.map +1 -1
- package/dist/content/redirects.d.ts +84 -0
- package/dist/content/redirects.d.ts.map +1 -0
- package/dist/content/redirects.js +234 -0
- package/dist/content/redirects.js.map +1 -0
- package/dist/content/sanitize.d.ts +13 -0
- package/dist/content/sanitize.d.ts.map +1 -0
- package/dist/{web → content}/sanitize.js +4 -71
- package/dist/content/sanitize.js.map +1 -0
- package/dist/content/save.d.ts +5 -8
- package/dist/content/save.d.ts.map +1 -1
- package/dist/content/save.js +5 -26
- package/dist/content/save.js.map +1 -1
- package/dist/content/schedule.d.ts +2 -2
- package/dist/content/schedule.d.ts.map +1 -1
- package/dist/content/schedule.js +1 -3
- package/dist/content/schedule.js.map +1 -1
- package/dist/content/served.d.ts +58 -0
- package/dist/content/served.d.ts.map +1 -0
- package/dist/content/served.js +65 -0
- package/dist/content/served.js.map +1 -0
- package/dist/content/site-links.d.ts +72 -0
- package/dist/content/site-links.d.ts.map +1 -0
- package/dist/content/site-links.js +191 -0
- package/dist/content/site-links.js.map +1 -0
- package/dist/content/sqlite/archive.d.ts +4 -0
- package/dist/content/sqlite/archive.d.ts.map +1 -0
- package/dist/content/sqlite/archive.js +96 -0
- package/dist/content/sqlite/archive.js.map +1 -0
- package/dist/content/sqlite/backlinks.d.ts +4 -0
- package/dist/content/sqlite/backlinks.d.ts.map +1 -0
- package/dist/content/sqlite/backlinks.js +46 -0
- package/dist/content/sqlite/backlinks.js.map +1 -0
- package/dist/content/sqlite/catalog.d.ts +4 -0
- package/dist/content/sqlite/catalog.d.ts.map +1 -0
- package/dist/content/sqlite/catalog.js +62 -0
- package/dist/content/sqlite/catalog.js.map +1 -0
- package/dist/content/sqlite/clauses.d.ts +57 -0
- package/dist/content/sqlite/clauses.d.ts.map +1 -0
- package/dist/content/sqlite/clauses.js +76 -0
- package/dist/content/sqlite/clauses.js.map +1 -0
- package/dist/content/sqlite/database.d.ts +26 -0
- package/dist/content/sqlite/database.d.ts.map +1 -0
- package/dist/content/sqlite/database.js +27 -0
- package/dist/content/sqlite/database.js.map +1 -0
- package/dist/content/sqlite/documents.d.ts +12 -0
- package/dist/content/sqlite/documents.d.ts.map +1 -0
- package/dist/content/sqlite/documents.js +40 -0
- package/dist/content/sqlite/documents.js.map +1 -0
- package/dist/content/sqlite/lookups.d.ts +6 -0
- package/dist/content/sqlite/lookups.d.ts.map +1 -0
- package/dist/content/sqlite/lookups.js +25 -0
- package/dist/content/sqlite/lookups.js.map +1 -0
- package/dist/content/sqlite/open.d.ts +8 -0
- package/dist/content/sqlite/open.d.ts.map +1 -0
- package/dist/content/sqlite/open.js +63 -0
- package/dist/content/sqlite/open.js.map +1 -0
- package/dist/content/sqlite/replies.d.ts +4 -0
- package/dist/content/sqlite/replies.d.ts.map +1 -0
- package/dist/content/sqlite/replies.js +21 -0
- package/dist/content/sqlite/replies.js.map +1 -0
- package/dist/content/sqlite/rows.d.ts +22 -0
- package/dist/content/sqlite/rows.d.ts.map +1 -0
- package/dist/content/sqlite/rows.js +93 -0
- package/dist/content/sqlite/rows.js.map +1 -0
- package/dist/content/sqlite/schedule.d.ts +4 -0
- package/dist/content/sqlite/schedule.d.ts.map +1 -0
- package/dist/content/sqlite/schedule.js +16 -0
- package/dist/content/sqlite/schedule.js.map +1 -0
- package/dist/content/sqlite/schema.d.ts +10 -0
- package/dist/content/sqlite/schema.d.ts.map +1 -0
- package/dist/content/sqlite/schema.js +209 -0
- package/dist/content/sqlite/schema.js.map +1 -0
- package/dist/content/sqlite/search.d.ts +4 -0
- package/dist/content/sqlite/search.d.ts.map +1 -0
- package/dist/content/sqlite/search.js +54 -0
- package/dist/content/sqlite/search.js.map +1 -0
- package/dist/content/sqlite/spellings.d.ts +6 -0
- package/dist/content/sqlite/spellings.d.ts.map +1 -0
- package/dist/content/sqlite/spellings.js +80 -0
- package/dist/content/sqlite/spellings.js.map +1 -0
- package/dist/content/sqlite/taxonomy.d.ts +4 -0
- package/dist/content/sqlite/taxonomy.d.ts.map +1 -0
- package/dist/content/sqlite/taxonomy.js +75 -0
- package/dist/content/sqlite/taxonomy.js.map +1 -0
- package/dist/content/sqlite/writes.d.ts +9 -0
- package/dist/content/sqlite/writes.d.ts.map +1 -0
- package/dist/content/sqlite/writes.js +164 -0
- package/dist/content/sqlite/writes.js.map +1 -0
- package/dist/content/store.d.ts +142 -137
- package/dist/content/store.d.ts.map +1 -1
- package/dist/content/store.js +0 -1050
- package/dist/content/store.js.map +1 -1
- package/dist/content/sync.d.ts +12 -4
- package/dist/content/sync.d.ts.map +1 -1
- package/dist/content/sync.js +24 -41
- package/dist/content/sync.js.map +1 -1
- package/dist/content/syndicate-to.d.ts +25 -0
- package/dist/content/syndicate-to.d.ts.map +1 -0
- package/dist/content/syndicate-to.js +8 -0
- package/dist/content/syndicate-to.js.map +1 -0
- package/dist/{web → content}/taxonomy.d.ts +1 -1
- package/dist/content/taxonomy.d.ts.map +1 -0
- package/dist/{web → content}/taxonomy.js +2 -2
- package/dist/content/taxonomy.js.map +1 -0
- package/dist/content/time.d.ts +2 -2
- package/dist/content/time.d.ts.map +1 -1
- package/dist/content/time.js +3 -3
- package/dist/content/time.js.map +1 -1
- package/dist/content/trash.d.ts +35 -0
- package/dist/content/trash.d.ts.map +1 -0
- package/dist/content/trash.js +83 -0
- package/dist/content/trash.js.map +1 -0
- package/dist/content/uploads.d.ts +24 -0
- package/dist/content/uploads.d.ts.map +1 -0
- package/dist/content/uploads.js +27 -0
- package/dist/content/uploads.js.map +1 -0
- package/dist/content/video.d.ts.map +1 -1
- package/dist/content/video.js +3 -5
- package/dist/content/video.js.map +1 -1
- package/dist/content/write.d.ts +84 -0
- package/dist/content/write.d.ts.map +1 -0
- package/dist/content/write.js +566 -0
- package/dist/content/write.js.map +1 -0
- package/dist/content/writer.d.ts.map +1 -1
- package/dist/content/writer.js +1 -2
- package/dist/content/writer.js.map +1 -1
- package/dist/dev-mode.d.ts +5 -3
- package/dist/dev-mode.d.ts.map +1 -1
- package/dist/dev-mode.js +3 -3
- package/dist/dev-mode.js.map +1 -1
- package/dist/drain.d.ts +2 -3
- package/dist/drain.d.ts.map +1 -1
- package/dist/drain.js +2 -1
- package/dist/drain.js.map +1 -1
- package/dist/exports.d.ts +26 -0
- package/dist/exports.d.ts.map +1 -0
- package/dist/exports.js +8 -0
- package/dist/exports.js.map +1 -0
- package/dist/federation/actor.d.ts +1 -1
- package/dist/federation/actor.d.ts.map +1 -1
- package/dist/federation/actor.js +6 -13
- package/dist/federation/actor.js.map +1 -1
- package/dist/federation/article.d.ts +4 -14
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +19 -32
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/backfill.d.ts +4 -4
- package/dist/federation/backfill.d.ts.map +1 -1
- package/dist/federation/backfill.js +12 -13
- package/dist/federation/backfill.js.map +1 -1
- package/dist/federation/citations.d.ts.map +1 -1
- package/dist/federation/citations.js.map +1 -1
- package/dist/federation/cited-post.d.ts.map +1 -1
- package/dist/federation/cited-post.js +2 -4
- package/dist/federation/cited-post.js.map +1 -1
- package/dist/federation/delivery-plan.d.ts +85 -0
- package/dist/federation/delivery-plan.d.ts.map +1 -0
- package/dist/federation/delivery-plan.js +137 -0
- package/dist/federation/delivery-plan.js.map +1 -0
- package/dist/federation/delivery.d.ts +7 -32
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +64 -201
- package/dist/federation/delivery.js.map +1 -1
- package/dist/federation/federation.d.ts +5 -5
- package/dist/federation/federation.d.ts.map +1 -1
- package/dist/federation/federation.js +7 -6
- package/dist/federation/federation.js.map +1 -1
- package/dist/federation/followers.d.ts +1 -1
- package/dist/federation/followers.d.ts.map +1 -1
- package/dist/federation/inbox.d.ts +1 -1
- package/dist/federation/inbox.d.ts.map +1 -1
- package/dist/federation/inbox.js +5 -4
- package/dist/federation/inbox.js.map +1 -1
- package/dist/federation/index.d.ts +10 -8
- package/dist/federation/index.d.ts.map +1 -1
- package/dist/federation/index.js +7 -5
- package/dist/federation/index.js.map +1 -1
- package/dist/federation/keys.d.ts +8 -27
- package/dist/federation/keys.d.ts.map +1 -1
- package/dist/federation/keys.js +4 -47
- package/dist/federation/keys.js.map +1 -1
- package/dist/federation/mount.d.ts +2 -2
- package/dist/federation/mount.d.ts.map +1 -1
- package/dist/federation/mount.js +9 -7
- package/dist/federation/mount.js.map +1 -1
- package/dist/federation/paths.d.ts +1 -9
- package/dist/federation/paths.d.ts.map +1 -1
- package/dist/federation/paths.js +2 -12
- package/dist/federation/paths.js.map +1 -1
- package/dist/federation/profiles.d.ts +1 -1
- package/dist/federation/profiles.d.ts.map +1 -1
- package/dist/federation/profiles.js +5 -8
- package/dist/federation/profiles.js.map +1 -1
- package/dist/federation/quotes.d.ts +2 -2
- package/dist/federation/quotes.d.ts.map +1 -1
- package/dist/federation/quotes.js +4 -4
- package/dist/federation/quotes.js.map +1 -1
- package/dist/federation/records.d.ts +2 -2
- package/dist/federation/records.d.ts.map +1 -1
- package/dist/federation/records.js +12 -19
- package/dist/federation/records.js.map +1 -1
- package/dist/federation/relays.d.ts +2 -3
- package/dist/federation/relays.d.ts.map +1 -1
- package/dist/federation/relays.js +22 -30
- package/dist/federation/relays.js.map +1 -1
- package/dist/federation/site-loaders.js +1 -1
- package/dist/federation/site-loaders.js.map +1 -1
- package/dist/federation/webfinger.d.ts +23 -0
- package/dist/federation/webfinger.d.ts.map +1 -0
- package/dist/federation/webfinger.js +70 -0
- package/dist/federation/webfinger.js.map +1 -0
- package/dist/files/atomic.d.ts.map +1 -1
- package/dist/files/atomic.js +4 -9
- package/dist/files/atomic.js.map +1 -1
- package/dist/files/static-files.d.ts +21 -0
- package/dist/files/static-files.d.ts.map +1 -0
- package/dist/files/static-files.js +88 -0
- package/dist/files/static-files.js.map +1 -0
- package/dist/forms/checker.d.ts +93 -0
- package/dist/forms/checker.d.ts.map +1 -0
- package/dist/forms/checker.js +2 -0
- package/dist/forms/checker.js.map +1 -0
- package/dist/forms/protection.d.ts +3 -1
- package/dist/forms/protection.d.ts.map +1 -1
- package/dist/forms/protection.js +3 -1
- package/dist/forms/protection.js.map +1 -1
- package/dist/images/icons.js +2 -2
- package/dist/images/icons.js.map +1 -1
- package/dist/images/index.d.ts +2 -1
- package/dist/images/index.d.ts.map +1 -1
- package/dist/images/index.js +2 -1
- package/dist/images/index.js.map +1 -1
- package/dist/images/markup.d.ts +0 -20
- package/dist/images/markup.d.ts.map +1 -1
- package/dist/images/markup.js +5 -64
- package/dist/images/markup.js.map +1 -1
- package/dist/images/paths.d.ts +0 -10
- package/dist/images/paths.d.ts.map +1 -1
- package/dist/images/paths.js +3 -11
- package/dist/images/paths.js.map +1 -1
- package/dist/images/variants.d.ts +2 -2
- package/dist/images/variants.d.ts.map +1 -1
- package/dist/images/variants.js +4 -3
- package/dist/images/variants.js.map +1 -1
- package/dist/index.d.ts +3 -291
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -838
- package/dist/index.js.map +1 -1
- package/dist/indexnow.d.ts.map +1 -1
- package/dist/indexnow.js +21 -26
- package/dist/indexnow.js.map +1 -1
- package/dist/indieauth/client.d.ts +1 -1
- package/dist/indieauth/client.d.ts.map +1 -1
- package/dist/indieauth/client.js +1 -1
- package/dist/indieauth/client.js.map +1 -1
- package/dist/indieauth/grants.d.ts +1 -1
- package/dist/indieauth/grants.d.ts.map +1 -1
- package/dist/indieauth/identity.d.ts +2 -2
- package/dist/indieauth/identity.d.ts.map +1 -1
- package/dist/indieauth/identity.js +5 -7
- package/dist/indieauth/identity.js.map +1 -1
- package/dist/indieauth/redeem.d.ts +1 -1
- package/dist/indieauth/redeem.d.ts.map +1 -1
- package/dist/indieauth/redeem.js.map +1 -1
- package/dist/indieauth/request.d.ts +5 -1
- package/dist/indieauth/request.d.ts.map +1 -1
- package/dist/indieauth/request.js +6 -2
- package/dist/indieauth/request.js.map +1 -1
- package/dist/indieauth/tokens.d.ts +1 -1
- package/dist/indieauth/tokens.d.ts.map +1 -1
- package/dist/indieauth/tokens.js +2 -2
- package/dist/indieauth/tokens.js.map +1 -1
- package/dist/mail/index.d.ts +1 -5
- package/dist/mail/index.d.ts.map +1 -1
- package/dist/mail/index.js +0 -2
- package/dist/mail/index.js.map +1 -1
- package/dist/mail/provider.d.ts +7 -0
- package/dist/mail/provider.d.ts.map +1 -1
- package/dist/maintenance.d.ts +1 -1
- package/dist/maintenance.d.ts.map +1 -1
- package/dist/media/library.d.ts +99 -0
- package/dist/media/library.d.ts.map +1 -0
- package/dist/media/library.js +157 -0
- package/dist/media/library.js.map +1 -0
- package/dist/media/uploads.d.ts +106 -0
- package/dist/media/uploads.d.ts.map +1 -0
- package/dist/media/uploads.js +192 -0
- package/dist/media/uploads.js.map +1 -0
- package/dist/micropub/content.js +1 -1
- package/dist/micropub/content.js.map +1 -1
- package/dist/micropub/create.d.ts +7 -15
- package/dist/micropub/create.d.ts.map +1 -1
- package/dist/micropub/create.js +48 -184
- package/dist/micropub/create.js.map +1 -1
- package/dist/micropub/endpoint.d.ts +2 -2
- package/dist/micropub/endpoint.d.ts.map +1 -1
- package/dist/micropub/endpoint.js +29 -40
- package/dist/micropub/endpoint.js.map +1 -1
- package/dist/micropub/media.d.ts +1 -1
- package/dist/micropub/media.d.ts.map +1 -1
- package/dist/micropub/media.js +6 -6
- package/dist/micropub/media.js.map +1 -1
- package/dist/micropub/update.d.ts +6 -14
- package/dist/micropub/update.d.ts.map +1 -1
- package/dist/micropub/update.js +37 -90
- package/dist/micropub/update.js.map +1 -1
- package/dist/notifications/comments.d.ts +4 -4
- package/dist/notifications/comments.d.ts.map +1 -1
- package/dist/notifications/comments.js +6 -14
- package/dist/notifications/comments.js.map +1 -1
- package/dist/notifications/digest.d.ts +4 -4
- package/dist/notifications/digest.d.ts.map +1 -1
- package/dist/notifications/digest.js +6 -16
- package/dist/notifications/digest.js.map +1 -1
- package/dist/notifications/index.d.ts +6 -3
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +3 -2
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/links.d.ts.map +1 -1
- package/dist/notifications/links.js +2 -2
- package/dist/notifications/links.js.map +1 -1
- package/dist/{mail/service.d.ts → notifications/mail-service.d.ts} +7 -13
- package/dist/notifications/mail-service.d.ts.map +1 -0
- package/dist/{mail/service.js → notifications/mail-service.js} +33 -54
- package/dist/notifications/mail-service.js.map +1 -0
- package/dist/{mail/templates.d.ts → notifications/mail-templates.d.ts} +4 -2
- package/dist/notifications/mail-templates.d.ts.map +1 -0
- package/dist/{mail/templates.js → notifications/mail-templates.js} +5 -3
- package/dist/notifications/mail-templates.js.map +1 -0
- package/dist/notifications/tokens.d.ts +2 -2
- package/dist/notifications/tokens.d.ts.map +1 -1
- package/dist/notifications/tokens.js +2 -2
- package/dist/notifications/tokens.js.map +1 -1
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +12 -24
- package/dist/notify.js.map +1 -1
- package/dist/plugin.d.ts +48 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +28 -2
- package/dist/plugin.js.map +1 -1
- package/dist/plugins/enabled.d.ts.map +1 -1
- package/dist/plugins/enabled.js +2 -4
- package/dist/plugins/enabled.js.map +1 -1
- package/dist/plugins/fetch.d.ts +1 -1
- package/dist/plugins/fetch.d.ts.map +1 -1
- package/dist/plugins/fetch.js +1 -1
- package/dist/plugins/fetch.js.map +1 -1
- package/dist/plugins/folder.d.ts.map +1 -1
- package/dist/plugins/folder.js +1 -3
- package/dist/plugins/folder.js.map +1 -1
- package/dist/plugins/install.d.ts.map +1 -1
- package/dist/plugins/install.js +7 -3
- package/dist/plugins/install.js.map +1 -1
- package/dist/plugins/manage.d.ts +1 -1
- package/dist/plugins/manage.d.ts.map +1 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +7 -9
- package/dist/plugins/registry.js.map +1 -1
- package/dist/plugins/settings.d.ts.map +1 -1
- package/dist/plugins/settings.js +2 -3
- package/dist/plugins/settings.js.map +1 -1
- package/dist/plugins/site.d.ts +1 -1
- package/dist/plugins/site.d.ts.map +1 -1
- package/dist/plugins/site.js +10 -4
- package/dist/plugins/site.js.map +1 -1
- package/dist/plugins/upgrade.d.ts.map +1 -1
- package/dist/plugins/upgrade.js +4 -3
- package/dist/plugins/upgrade.js.map +1 -1
- package/dist/privacy/erase.d.ts +1 -1
- package/dist/privacy/erase.d.ts.map +1 -1
- package/dist/privacy/retention.d.ts +2 -2
- package/dist/privacy/retention.d.ts.map +1 -1
- package/dist/privacy/retention.js +9 -11
- package/dist/privacy/retention.js.map +1 -1
- package/dist/site/admin-paths.d.ts +23 -0
- package/dist/site/admin-paths.d.ts.map +1 -0
- package/dist/site/admin-paths.js +25 -0
- package/dist/site/admin-paths.js.map +1 -0
- package/dist/site/admin-theme.d.ts.map +1 -0
- package/dist/site/admin-theme.js.map +1 -0
- package/dist/{web → site}/authors.d.ts +1 -72
- package/dist/site/authors.d.ts.map +1 -0
- package/dist/site/authors.js +107 -0
- package/dist/site/authors.js.map +1 -0
- package/dist/site/feed-settings.d.ts +28 -0
- package/dist/site/feed-settings.d.ts.map +1 -0
- package/dist/site/feed-settings.js +22 -0
- package/dist/site/feed-settings.js.map +1 -0
- package/dist/{web/indexnow.d.ts → site/indexnow-key.d.ts} +1 -1
- package/dist/site/indexnow-key.d.ts.map +1 -0
- package/dist/{web/indexnow.js → site/indexnow-key.js} +1 -1
- package/dist/site/indexnow-key.js.map +1 -0
- package/dist/{web → site}/navigation.d.ts +7 -1
- package/dist/site/navigation.d.ts.map +1 -0
- package/dist/{web → site}/navigation.js +18 -0
- package/dist/site/navigation.js.map +1 -0
- package/dist/{notifications/preferences.d.ts → site/notification-preferences.d.ts} +2 -2
- package/dist/site/notification-preferences.d.ts.map +1 -0
- package/dist/{notifications/preferences.js → site/notification-preferences.js} +1 -1
- package/dist/site/notification-preferences.js.map +1 -0
- package/dist/site/passwords.d.ts.map +1 -0
- package/dist/site/passwords.js.map +1 -0
- package/dist/{privacy/policy.d.ts → site/retention-policy.d.ts} +1 -1
- package/dist/site/retention-policy.d.ts.map +1 -0
- package/dist/{privacy/policy.js → site/retention-policy.js} +1 -1
- package/dist/site/retention-policy.js.map +1 -0
- package/dist/site/robots.d.ts +62 -0
- package/dist/site/robots.d.ts.map +1 -0
- package/dist/site/robots.js +130 -0
- package/dist/site/robots.js.map +1 -0
- package/dist/site/setting-rows.d.ts +46 -0
- package/dist/site/setting-rows.d.ts.map +1 -0
- package/dist/site/setting-rows.js +480 -0
- package/dist/site/setting-rows.js.map +1 -0
- package/dist/site/setting-values.d.ts +63 -0
- package/dist/site/setting-values.d.ts.map +1 -0
- package/dist/site/setting-values.js +170 -0
- package/dist/site/setting-values.js.map +1 -0
- package/dist/site/settings-form.d.ts +30 -0
- package/dist/site/settings-form.d.ts.map +1 -0
- package/dist/site/settings-form.js +58 -0
- package/dist/site/settings-form.js.map +1 -0
- package/dist/site/settings.d.ts +345 -0
- package/dist/site/settings.d.ts.map +1 -0
- package/dist/site/settings.js +107 -0
- package/dist/site/settings.js.map +1 -0
- package/dist/site/site-json.d.ts +69 -0
- package/dist/site/site-json.d.ts.map +1 -0
- package/dist/site/site-json.js +113 -0
- package/dist/site/site-json.js.map +1 -0
- package/dist/{admin/accounts.d.ts → site/users.d.ts} +25 -41
- package/dist/site/users.d.ts.map +1 -0
- package/dist/{admin/accounts.js → site/users.js} +49 -155
- package/dist/site/users.js.map +1 -0
- package/dist/store/admin-store.d.ts +72 -0
- package/dist/store/admin-store.d.ts.map +1 -0
- package/dist/store/admin-store.js +62 -0
- package/dist/store/admin-store.js.map +1 -0
- package/dist/store/comments.d.ts +253 -0
- package/dist/store/comments.d.ts.map +1 -0
- package/dist/store/comments.js +234 -0
- package/dist/store/comments.js.map +1 -0
- package/dist/store/conversation.d.ts +28 -0
- package/dist/store/conversation.d.ts.map +1 -0
- package/dist/store/conversation.js +16 -0
- package/dist/store/conversation.js.map +1 -0
- package/dist/store/deliveries.d.ts +92 -0
- package/dist/store/deliveries.d.ts.map +1 -0
- package/dist/store/deliveries.js +88 -0
- package/dist/store/deliveries.js.map +1 -0
- package/dist/store/followers.d.ts +91 -0
- package/dist/store/followers.d.ts.map +1 -0
- package/dist/store/followers.js +79 -0
- package/dist/store/followers.js.map +1 -0
- package/dist/{federation/replies.d.ts → store/inbox-replies.d.ts} +2 -2
- package/dist/store/inbox-replies.d.ts.map +1 -0
- package/dist/{federation/replies.js → store/inbox-replies.js} +2 -4
- package/dist/store/inbox-replies.js.map +1 -0
- package/dist/store/inbox.d.ts +132 -0
- package/dist/store/inbox.d.ts.map +1 -0
- package/dist/store/inbox.js +157 -0
- package/dist/store/inbox.js.map +1 -0
- package/dist/store/profiles.d.ts +49 -0
- package/dist/store/profiles.d.ts.map +1 -0
- package/dist/store/profiles.js +71 -0
- package/dist/store/profiles.js.map +1 -0
- package/dist/store/relays.d.ts +66 -0
- package/dist/store/relays.d.ts.map +1 -0
- package/dist/store/relays.js +69 -0
- package/dist/store/relays.js.map +1 -0
- package/dist/store/rows.d.ts +33 -0
- package/dist/store/rows.d.ts.map +1 -0
- package/dist/store/rows.js +44 -0
- package/dist/store/rows.js.map +1 -0
- package/dist/store/schema.d.ts +14 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +588 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/sessions.d.ts +90 -0
- package/dist/store/sessions.d.ts.map +1 -0
- package/dist/store/sessions.js +107 -0
- package/dist/store/sessions.js.map +1 -0
- package/dist/store/state.d.ts +18 -0
- package/dist/store/state.d.ts.map +1 -0
- package/dist/store/state.js +19 -0
- package/dist/store/state.js.map +1 -0
- package/dist/store/tokens.d.ts +75 -0
- package/dist/store/tokens.d.ts.map +1 -0
- package/dist/store/tokens.js +82 -0
- package/dist/store/tokens.js.map +1 -0
- package/dist/store/webmentions.d.ts +66 -0
- package/dist/store/webmentions.d.ts.map +1 -0
- package/dist/store/webmentions.js +84 -0
- package/dist/store/webmentions.js.map +1 -0
- package/dist/supervisor/primary.d.ts +1 -1
- package/dist/supervisor/primary.d.ts.map +1 -1
- package/dist/supervisor/primary.js +31 -11
- package/dist/supervisor/primary.js.map +1 -1
- package/dist/supervisor/worker.d.ts +6 -2
- package/dist/supervisor/worker.d.ts.map +1 -1
- package/dist/supervisor/worker.js +4 -4
- package/dist/supervisor/worker.js.map +1 -1
- package/dist/testing.d.ts +8 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +6 -0
- package/dist/testing.js.map +1 -0
- package/dist/{web → theme}/assets.d.ts +1 -32
- package/dist/theme/assets.d.ts.map +1 -0
- package/dist/{web → theme}/assets.js +2 -100
- package/dist/theme/assets.js.map +1 -0
- package/dist/theme/site-data.d.ts +187 -0
- package/dist/theme/site-data.d.ts.map +1 -0
- package/dist/theme/site-data.js +160 -0
- package/dist/theme/site-data.js.map +1 -0
- package/dist/{web → theme}/templates.d.ts +2 -0
- package/dist/theme/templates.d.ts.map +1 -0
- package/dist/{web → theme}/templates.js +9 -32
- package/dist/theme/templates.js.map +1 -0
- package/dist/{web → theme}/themes.d.ts +1 -0
- package/dist/theme/themes.d.ts.map +1 -0
- package/dist/{web → theme}/themes.js +6 -3
- package/dist/theme/themes.js.map +1 -0
- package/dist/util/client-id.d.ts.map +1 -0
- package/dist/util/client-id.js.map +1 -0
- package/dist/util/clock.d.ts +9 -0
- package/dist/util/clock.d.ts.map +1 -0
- package/dist/util/clock.js +2 -0
- package/dist/util/clock.js.map +1 -0
- package/dist/util/errors.d.ts +3 -0
- package/dist/util/errors.d.ts.map +1 -0
- package/dist/util/errors.js +5 -0
- package/dist/util/errors.js.map +1 -0
- package/dist/util/files.d.ts +5 -0
- package/dist/util/files.d.ts.map +1 -0
- package/dist/util/files.js +38 -0
- package/dist/util/files.js.map +1 -0
- package/dist/util/forms.d.ts +5 -0
- package/dist/util/forms.d.ts.map +1 -0
- package/dist/util/forms.js +17 -0
- package/dist/util/forms.js.map +1 -0
- package/dist/util/guards.d.ts +4 -0
- package/dist/util/guards.d.ts.map +1 -0
- package/dist/util/guards.js +12 -0
- package/dist/util/guards.js.map +1 -0
- package/dist/{webmention/html.d.ts → util/html-tree.d.ts} +2 -2
- package/dist/util/html-tree.d.ts.map +1 -0
- package/dist/{webmention/html.js → util/html-tree.js} +3 -64
- package/dist/util/html-tree.js.map +1 -0
- package/dist/util/html.d.ts +4 -0
- package/dist/util/html.d.ts.map +1 -0
- package/dist/util/html.js +34 -0
- package/dist/util/html.js.map +1 -0
- package/dist/util/public-address.d.ts.map +1 -0
- package/dist/util/public-address.js.map +1 -0
- package/dist/util/queue.d.ts +7 -0
- package/dist/util/queue.d.ts.map +1 -0
- package/dist/util/queue.js +23 -0
- package/dist/util/queue.js.map +1 -0
- package/dist/util/retry.d.ts +11 -0
- package/dist/util/retry.d.ts.map +1 -0
- package/dist/util/retry.js +14 -0
- package/dist/util/retry.js.map +1 -0
- package/dist/util/url.d.ts +11 -0
- package/dist/util/url.d.ts.map +1 -0
- package/dist/util/url.js +20 -0
- package/dist/util/url.js.map +1 -0
- package/dist/web/absolute-urls.js +1 -1
- package/dist/web/absolute-urls.js.map +1 -1
- package/dist/web/archive.js +2 -2
- package/dist/web/archive.js.map +1 -1
- package/dist/web/asset-routes.d.ts +48 -0
- package/dist/web/asset-routes.d.ts.map +1 -0
- package/dist/web/asset-routes.js +107 -0
- package/dist/web/asset-routes.js.map +1 -0
- package/dist/{avatars/routes.d.ts → web/avatar-routes.d.ts} +2 -2
- package/dist/web/avatar-routes.d.ts.map +1 -0
- package/dist/{avatars/routes.js → web/avatar-routes.js} +3 -3
- package/dist/web/avatar-routes.js.map +1 -0
- package/dist/web/comment-routes.d.ts +18 -0
- package/dist/web/comment-routes.d.ts.map +1 -0
- package/dist/web/comment-routes.js +177 -0
- package/dist/web/comment-routes.js.map +1 -0
- package/dist/web/compression.d.ts.map +1 -1
- package/dist/web/compression.js +1 -2
- package/dist/web/compression.js.map +1 -1
- package/dist/{contact/routes.d.ts → web/contact-routes.d.ts} +2 -2
- package/dist/web/contact-routes.d.ts.map +1 -0
- package/dist/{contact/routes.js → web/contact-routes.js} +14 -17
- package/dist/web/contact-routes.js.map +1 -0
- package/dist/web/context.d.ts +1 -187
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +5 -171
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts +6 -333
- package/dist/web/conversation.d.ts.map +1 -1
- package/dist/web/conversation.js +280 -220
- package/dist/web/conversation.js.map +1 -1
- package/dist/web/document-page.d.ts +13 -0
- package/dist/web/document-page.d.ts.map +1 -0
- package/dist/web/document-page.js +136 -0
- package/dist/web/document-page.js.map +1 -0
- package/dist/web/document-site.d.ts +14 -0
- package/dist/web/document-site.d.ts.map +1 -0
- package/dist/web/document-site.js +28 -0
- package/dist/web/document-site.js.map +1 -0
- package/dist/web/embed.d.ts +13 -0
- package/dist/web/embed.d.ts.map +1 -0
- package/dist/web/embed.js +66 -0
- package/dist/web/embed.js.map +1 -0
- package/dist/{env.d.ts → web/env.d.ts} +27 -26
- package/dist/web/env.d.ts.map +1 -0
- package/dist/web/env.js.map +1 -0
- package/dist/web/federation-routes.d.ts +33 -0
- package/dist/web/federation-routes.d.ts.map +1 -0
- package/dist/web/federation-routes.js +280 -0
- package/dist/web/federation-routes.js.map +1 -0
- package/dist/web/feed-atom.d.ts.map +1 -1
- package/dist/web/feed-atom.js +4 -3
- package/dist/web/feed-atom.js.map +1 -1
- package/dist/web/feed-item.d.ts +4 -39
- package/dist/web/feed-item.d.ts.map +1 -1
- package/dist/web/feed-item.js +8 -72
- package/dist/web/feed-item.js.map +1 -1
- package/dist/web/feed-json.js +2 -2
- package/dist/web/feed-json.js.map +1 -1
- package/dist/web/feed-routes.d.ts +36 -0
- package/dist/web/feed-routes.d.ts.map +1 -0
- package/dist/web/feed-routes.js +124 -0
- package/dist/web/feed-routes.js.map +1 -0
- package/dist/web/feed-rss.d.ts.map +1 -1
- package/dist/web/feed-rss.js +9 -6
- package/dist/web/feed-rss.js.map +1 -1
- package/dist/web/feed-source.d.ts +13 -40
- package/dist/web/feed-source.d.ts.map +1 -1
- package/dist/web/feed-source.js +14 -43
- package/dist/web/feed-source.js.map +1 -1
- package/dist/web/feeds.d.ts +4 -2
- package/dist/web/feeds.d.ts.map +1 -1
- package/dist/web/feeds.js +8 -5
- package/dist/web/feeds.js.map +1 -1
- package/dist/web/health.d.ts +1 -1
- package/dist/web/health.d.ts.map +1 -1
- package/dist/web/index.d.ts +53 -29
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +37 -18
- package/dist/web/index.js.map +1 -1
- package/dist/{indieauth/activity-log.d.ts → web/indieauth-activity-log.d.ts} +3 -3
- package/dist/web/indieauth-activity-log.d.ts.map +1 -0
- package/dist/{indieauth/activity-log.js → web/indieauth-activity-log.js} +5 -6
- package/dist/web/indieauth-activity-log.js.map +1 -0
- package/dist/{indieauth/bearer.d.ts → web/indieauth-bearer.d.ts} +5 -5
- package/dist/web/indieauth-bearer.d.ts.map +1 -0
- package/dist/{indieauth/bearer.js → web/indieauth-bearer.js} +4 -4
- package/dist/web/indieauth-bearer.js.map +1 -0
- package/dist/{indieauth/discovery.d.ts → web/indieauth-discovery.d.ts} +2 -7
- package/dist/web/indieauth-discovery.d.ts.map +1 -0
- package/dist/{indieauth/discovery.js → web/indieauth-discovery.js} +6 -9
- package/dist/web/indieauth-discovery.js.map +1 -0
- package/dist/{indieauth/token.d.ts → web/indieauth-token.d.ts} +2 -2
- package/dist/web/indieauth-token.d.ts.map +1 -0
- package/dist/{indieauth/token.js → web/indieauth-token.js} +7 -7
- package/dist/web/indieauth-token.js.map +1 -0
- package/dist/web/listing-pages.d.ts +19 -0
- package/dist/web/listing-pages.d.ts.map +1 -0
- package/dist/web/listing-pages.js +148 -0
- package/dist/web/listing-pages.js.map +1 -0
- package/dist/web/listing-subject.d.ts +58 -0
- package/dist/web/listing-subject.d.ts.map +1 -0
- package/dist/web/listing-subject.js +89 -0
- package/dist/web/listing-subject.js.map +1 -0
- package/dist/web/llms.d.ts +16 -15
- package/dist/web/llms.d.ts.map +1 -1
- package/dist/web/llms.js +23 -35
- package/dist/web/llms.js.map +1 -1
- package/dist/web/maintenance.d.ts +1 -1
- package/dist/web/maintenance.d.ts.map +1 -1
- package/dist/web/maintenance.js +7 -13
- package/dist/web/maintenance.js.map +1 -1
- package/dist/web/manifest.d.ts +1 -1
- package/dist/web/manifest.d.ts.map +1 -1
- package/dist/web/manifest.js +2 -1
- package/dist/web/manifest.js.map +1 -1
- package/dist/web/markdown-page.d.ts +76 -0
- package/dist/web/markdown-page.d.ts.map +1 -0
- package/dist/web/markdown-page.js +79 -0
- package/dist/web/markdown-page.js.map +1 -0
- package/dist/web/markdown-representation.d.ts +15 -0
- package/dist/web/markdown-representation.d.ts.map +1 -0
- package/dist/web/markdown-representation.js +130 -0
- package/dist/web/markdown-representation.js.map +1 -0
- package/dist/web/negotiate.d.ts +5 -12
- package/dist/web/negotiate.d.ts.map +1 -1
- package/dist/web/negotiate.js +11 -18
- package/dist/web/negotiate.js.map +1 -1
- package/dist/{notifications/routes.d.ts → web/notification-routes.d.ts} +2 -2
- package/dist/web/notification-routes.d.ts.map +1 -0
- package/dist/{notifications/routes.js → web/notification-routes.js} +24 -29
- package/dist/web/notification-routes.js.map +1 -0
- package/dist/web/oembed.d.ts +2 -2
- package/dist/web/oembed.d.ts.map +1 -1
- package/dist/web/oembed.js +5 -4
- package/dist/web/oembed.js.map +1 -1
- package/dist/web/opensearch.d.ts.map +1 -1
- package/dist/web/opensearch.js +2 -1
- package/dist/web/opensearch.js.map +1 -1
- package/dist/web/page-sources.d.ts +15 -0
- package/dist/web/page-sources.d.ts.map +1 -0
- package/dist/web/page-sources.js +44 -0
- package/dist/web/page-sources.js.map +1 -0
- package/dist/web/pagination.d.ts +1 -0
- package/dist/web/pagination.d.ts.map +1 -1
- package/dist/web/pagination.js +4 -1
- package/dist/web/pagination.js.map +1 -1
- package/dist/web/paths.d.ts +52 -0
- package/dist/web/paths.d.ts.map +1 -0
- package/dist/web/paths.js +208 -0
- package/dist/web/paths.js.map +1 -0
- package/dist/web/pingback-routes.d.ts +5 -0
- package/dist/web/pingback-routes.d.ts.map +1 -0
- package/dist/web/pingback-routes.js +100 -0
- package/dist/web/pingback-routes.js.map +1 -0
- package/dist/{plugins/federation.d.ts → web/plugin-federation.d.ts} +3 -3
- package/dist/web/plugin-federation.d.ts.map +1 -0
- package/dist/{plugins/federation.js → web/plugin-federation.js} +5 -5
- package/dist/web/plugin-federation.js.map +1 -0
- package/dist/{plugins/mount.d.ts → web/plugin-routes.d.ts} +3 -3
- package/dist/web/plugin-routes.d.ts.map +1 -0
- package/dist/{plugins/mount.js → web/plugin-routes.js} +2 -2
- package/dist/web/plugin-routes.js.map +1 -0
- package/dist/web/redirects.d.ts +1 -84
- package/dist/web/redirects.d.ts.map +1 -1
- package/dist/web/redirects.js +0 -232
- package/dist/web/redirects.js.map +1 -1
- package/dist/web/render.d.ts +43 -7
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +96 -48
- package/dist/web/render.js.map +1 -1
- package/dist/web/request.d.ts +44 -0
- package/dist/web/request.d.ts.map +1 -0
- package/dist/web/request.js +82 -0
- package/dist/web/request.js.map +1 -0
- package/dist/web/robots.d.ts +1 -46
- package/dist/web/robots.d.ts.map +1 -1
- package/dist/web/robots.js +5 -131
- package/dist/web/robots.js.map +1 -1
- package/dist/web/routes.d.ts +5 -39
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +112 -1373
- package/dist/web/routes.js.map +1 -1
- package/dist/web/search.d.ts.map +1 -1
- package/dist/web/search.js +2 -9
- package/dist/web/search.js.map +1 -1
- package/dist/{admin → web}/session.d.ts +1 -5
- package/dist/web/session.d.ts.map +1 -0
- package/dist/{admin → web}/session.js +0 -4
- package/dist/web/session.js.map +1 -0
- package/dist/web/share-image.d.ts.map +1 -1
- package/dist/web/share-image.js +3 -2
- package/dist/web/share-image.js.map +1 -1
- package/dist/web/signed-in.d.ts +27 -0
- package/dist/web/signed-in.d.ts.map +1 -0
- package/dist/web/signed-in.js +45 -0
- package/dist/web/signed-in.js.map +1 -0
- package/dist/web/site-index.d.ts +13 -0
- package/dist/web/site-index.d.ts.map +1 -0
- package/dist/web/site-index.js +143 -0
- package/dist/web/site-index.js.map +1 -0
- package/dist/web/site-view.d.ts +45 -0
- package/dist/web/site-view.d.ts.map +1 -0
- package/dist/web/site-view.js +67 -0
- package/dist/web/site-view.js.map +1 -0
- package/dist/web/sitemap.d.ts.map +1 -1
- package/dist/web/sitemap.js +5 -7
- package/dist/web/sitemap.js.map +1 -1
- package/dist/{admin → web}/throttle.d.ts +3 -4
- package/dist/web/throttle.d.ts.map +1 -0
- package/dist/{admin → web}/throttle.js +1 -2
- package/dist/web/throttle.js.map +1 -0
- package/dist/web/webmention-routes.d.ts +11 -0
- package/dist/web/webmention-routes.d.ts.map +1 -0
- package/dist/web/webmention-routes.js +51 -0
- package/dist/web/webmention-routes.js.map +1 -0
- package/dist/web/well-known.d.ts +2 -2
- package/dist/web/well-known.d.ts.map +1 -1
- package/dist/web/well-known.js +5 -14
- package/dist/web/well-known.js.map +1 -1
- package/dist/webmention/cited-picture.d.ts +1 -2
- package/dist/webmention/cited-picture.d.ts.map +1 -1
- package/dist/webmention/cited-picture.js +4 -6
- package/dist/webmention/cited-picture.js.map +1 -1
- package/dist/webmention/discovery.d.ts +2 -13
- package/dist/webmention/discovery.d.ts.map +1 -1
- package/dist/webmention/discovery.js +18 -73
- package/dist/webmention/discovery.js.map +1 -1
- package/dist/webmention/endpoint.d.ts +27 -0
- package/dist/webmention/endpoint.d.ts.map +1 -0
- package/dist/webmention/endpoint.js +26 -0
- package/dist/webmention/endpoint.js.map +1 -0
- package/dist/webmention/fetch-public.d.ts +18 -1
- package/dist/webmention/fetch-public.d.ts.map +1 -1
- package/dist/webmention/fetch-public.js +57 -23
- package/dist/webmention/fetch-public.js.map +1 -1
- package/dist/webmention/index.d.ts +11 -9
- package/dist/webmention/index.d.ts.map +1 -1
- package/dist/webmention/index.js +7 -6
- package/dist/webmention/index.js.map +1 -1
- package/dist/webmention/links.d.ts +0 -55
- package/dist/webmention/links.d.ts.map +1 -1
- package/dist/webmention/links.js +2 -185
- package/dist/webmention/links.js.map +1 -1
- package/dist/webmention/microformats.d.ts +1 -1
- package/dist/webmention/microformats.d.ts.map +1 -1
- package/dist/webmention/microformats.js +1 -1
- package/dist/webmention/microformats.js.map +1 -1
- package/dist/webmention/pingback.d.ts +12 -4
- package/dist/webmention/pingback.d.ts.map +1 -1
- package/dist/webmention/pingback.js +4 -102
- package/dist/webmention/pingback.js.map +1 -1
- package/dist/webmention/receive.d.ts +7 -4
- package/dist/webmention/receive.d.ts.map +1 -1
- package/dist/webmention/receive.js +34 -42
- package/dist/webmention/receive.js.map +1 -1
- package/dist/webmention/reply-context/fediverse.d.ts +29 -0
- package/dist/webmention/reply-context/fediverse.d.ts.map +1 -0
- package/dist/webmention/reply-context/fediverse.js +59 -0
- package/dist/webmention/reply-context/fediverse.js.map +1 -0
- package/dist/webmention/reply-context/json-ld.d.ts +5 -0
- package/dist/webmention/reply-context/json-ld.d.ts.map +1 -0
- package/dist/webmention/reply-context/json-ld.js +78 -0
- package/dist/webmention/reply-context/json-ld.js.map +1 -0
- package/dist/webmention/reply-context/oembed.d.ts +21 -0
- package/dist/webmention/reply-context/oembed.d.ts.map +1 -0
- package/dist/webmention/reply-context/oembed.js +137 -0
- package/dist/webmention/reply-context/oembed.js.map +1 -0
- package/dist/webmention/reply-context/page.d.ts +30 -0
- package/dist/webmention/reply-context/page.d.ts.map +1 -0
- package/dist/webmention/reply-context/page.js +134 -0
- package/dist/webmention/reply-context/page.js.map +1 -0
- package/dist/webmention/reply-context/source.d.ts +29 -0
- package/dist/webmention/reply-context/source.d.ts.map +1 -0
- package/dist/webmention/reply-context/source.js +46 -0
- package/dist/webmention/reply-context/source.js.map +1 -0
- package/dist/webmention/reply-context.d.ts +5 -34
- package/dist/webmention/reply-context.d.ts.map +1 -1
- package/dist/webmention/reply-context.js +9 -432
- package/dist/webmention/reply-context.js.map +1 -1
- package/dist/webmention/reply-contexts.d.ts +3 -3
- package/dist/webmention/reply-contexts.d.ts.map +1 -1
- package/dist/webmention/reply-contexts.js +7 -10
- package/dist/webmention/reply-contexts.js.map +1 -1
- package/dist/webmention/routes.d.ts +1 -1
- package/dist/webmention/routes.d.ts.map +1 -1
- package/dist/webmention/routes.js +5 -8
- package/dist/webmention/routes.js.map +1 -1
- package/dist/webmention/service.d.ts +7 -7
- package/dist/webmention/service.d.ts.map +1 -1
- package/dist/webmention/service.js +49 -61
- package/dist/webmention/service.js.map +1 -1
- package/dist/webmention/syndication.d.ts +3 -26
- package/dist/webmention/syndication.d.ts.map +1 -1
- package/dist/webmention/syndication.js +6 -20
- package/dist/webmention/syndication.js.map +1 -1
- package/package.json +5 -1
- package/themes/default/README.md +36 -2329
- package/themes/default/layouts/base.njk +5 -4
- package/themes/default/layouts/comment.njk +3 -3
- package/themes/default/layouts/front-page.njk +4 -3
- package/themes/default/layouts/page.njk +2 -0
- package/themes/default/partials/comment-form.njk +1 -1
- package/themes/default/partials/comment.njk +5 -5
- package/themes/default/partials/contact-form.njk +1 -2
- package/themes/default/partials/conversation.njk +1 -2
- package/themes/default/partials/markdown-footer.md.njk +24 -0
- package/themes/default/partials/markdown-header.md.njk +31 -0
- package/themes/default/src/style.css +6 -6
- package/dist/admin/accounts.d.ts.map +0 -1
- package/dist/admin/accounts.js.map +0 -1
- package/dist/admin/admin-theme.d.ts.map +0 -1
- package/dist/admin/admin-theme.js.map +0 -1
- package/dist/admin/enclosure-field.d.ts.map +0 -1
- package/dist/admin/enclosure-field.js.map +0 -1
- package/dist/admin/event-field.d.ts.map +0 -1
- package/dist/admin/event-field.js.map +0 -1
- package/dist/admin/location-field.d.ts +0 -27
- package/dist/admin/location-field.d.ts.map +0 -1
- package/dist/admin/location-field.js.map +0 -1
- package/dist/admin/passwords.d.ts.map +0 -1
- package/dist/admin/passwords.js.map +0 -1
- package/dist/admin/photo-field.d.ts +0 -38
- package/dist/admin/photo-field.d.ts.map +0 -1
- package/dist/admin/photo-field.js.map +0 -1
- package/dist/admin/read-field.d.ts.map +0 -1
- package/dist/admin/read-field.js +0 -61
- package/dist/admin/read-field.js.map +0 -1
- package/dist/admin/session.d.ts.map +0 -1
- package/dist/admin/session.js.map +0 -1
- package/dist/admin/store.d.ts +0 -998
- package/dist/admin/store.d.ts.map +0 -1
- package/dist/admin/store.js +0 -1588
- package/dist/admin/store.js.map +0 -1
- package/dist/admin/throttle.d.ts.map +0 -1
- package/dist/admin/throttle.js.map +0 -1
- package/dist/avatars/routes.d.ts.map +0 -1
- package/dist/avatars/routes.js.map +0 -1
- package/dist/contact/routes.d.ts.map +0 -1
- package/dist/contact/routes.js.map +0 -1
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js.map +0 -1
- package/dist/federation/replies.d.ts.map +0 -1
- package/dist/federation/replies.js.map +0 -1
- package/dist/images/alt-text.d.ts.map +0 -1
- package/dist/images/alt-text.js.map +0 -1
- package/dist/indieauth/activity-log.d.ts.map +0 -1
- package/dist/indieauth/activity-log.js.map +0 -1
- package/dist/indieauth/app-activity.d.ts.map +0 -1
- package/dist/indieauth/app-activity.js.map +0 -1
- package/dist/indieauth/bearer.d.ts.map +0 -1
- package/dist/indieauth/bearer.js.map +0 -1
- package/dist/indieauth/client-id.d.ts.map +0 -1
- package/dist/indieauth/client-id.js.map +0 -1
- package/dist/indieauth/connected-apps.d.ts.map +0 -1
- package/dist/indieauth/connected-apps.js.map +0 -1
- package/dist/indieauth/consent.d.ts.map +0 -1
- package/dist/indieauth/consent.js.map +0 -1
- package/dist/indieauth/discovery.d.ts.map +0 -1
- package/dist/indieauth/discovery.js.map +0 -1
- package/dist/indieauth/token.d.ts.map +0 -1
- package/dist/indieauth/token.js.map +0 -1
- package/dist/mail/service.d.ts.map +0 -1
- package/dist/mail/service.js.map +0 -1
- package/dist/mail/templates.d.ts.map +0 -1
- package/dist/mail/templates.js.map +0 -1
- package/dist/notifications/preferences.d.ts.map +0 -1
- package/dist/notifications/preferences.js.map +0 -1
- package/dist/notifications/routes.d.ts.map +0 -1
- package/dist/notifications/routes.js.map +0 -1
- package/dist/plugins/federation.d.ts.map +0 -1
- package/dist/plugins/federation.js.map +0 -1
- package/dist/plugins/mount.d.ts.map +0 -1
- package/dist/plugins/mount.js.map +0 -1
- package/dist/privacy/policy.d.ts.map +0 -1
- package/dist/privacy/policy.js.map +0 -1
- package/dist/web/admin-bar.d.ts.map +0 -1
- package/dist/web/admin-bar.js.map +0 -1
- package/dist/web/assets.d.ts.map +0 -1
- package/dist/web/assets.js.map +0 -1
- package/dist/web/authors.d.ts.map +0 -1
- package/dist/web/authors.js +0 -211
- package/dist/web/authors.js.map +0 -1
- package/dist/web/documents.d.ts +0 -81
- package/dist/web/documents.d.ts.map +0 -1
- package/dist/web/documents.js.map +0 -1
- package/dist/web/errors.d.ts.map +0 -1
- package/dist/web/errors.js.map +0 -1
- package/dist/web/guids.d.ts.map +0 -1
- package/dist/web/guids.js.map +0 -1
- package/dist/web/indexnow.d.ts.map +0 -1
- package/dist/web/indexnow.js.map +0 -1
- package/dist/web/license.d.ts.map +0 -1
- package/dist/web/license.js.map +0 -1
- package/dist/web/locale.d.ts.map +0 -1
- package/dist/web/locale.js.map +0 -1
- package/dist/web/navigation.d.ts.map +0 -1
- package/dist/web/navigation.js.map +0 -1
- package/dist/web/recent.d.ts +0 -43
- package/dist/web/recent.d.ts.map +0 -1
- package/dist/web/recent.js +0 -37
- package/dist/web/recent.js.map +0 -1
- package/dist/web/sanitize.d.ts +0 -29
- package/dist/web/sanitize.d.ts.map +0 -1
- package/dist/web/sanitize.js.map +0 -1
- package/dist/web/taxonomy.d.ts.map +0 -1
- package/dist/web/taxonomy.js.map +0 -1
- package/dist/web/templates.d.ts.map +0 -1
- package/dist/web/templates.js.map +0 -1
- package/dist/web/themes.d.ts.map +0 -1
- package/dist/web/themes.js.map +0 -1
- package/dist/webmention/html.d.ts.map +0 -1
- package/dist/webmention/html.js.map +0 -1
- package/dist/webmention/public-address.d.ts.map +0 -1
- package/dist/webmention/public-address.js.map +0 -1
- /package/dist/{web → content}/license.d.ts +0 -0
- /package/dist/{web → content}/license.js +0 -0
- /package/dist/{admin → site}/admin-theme.d.ts +0 -0
- /package/dist/{admin → site}/admin-theme.js +0 -0
- /package/dist/{admin → site}/passwords.d.ts +0 -0
- /package/dist/{admin → site}/passwords.js +0 -0
- /package/dist/{indieauth → util}/client-id.d.ts +0 -0
- /package/dist/{indieauth → util}/client-id.js +0 -0
- /package/dist/{webmention → util}/public-address.d.ts +0 -0
- /package/dist/{webmention → util}/public-address.js +0 -0
- /package/dist/{env.js → web/env.js} +0 -0
package/dist/web/routes.js
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { goneDocumentAt, isGone, isListed, isServed, permalinkOfObjectId, previewDocumentAt, publicDocumentAt, } from './documents.js';
|
|
26
|
-
import { commentsFeedPath, REPLIES_ROOT, repliesFeedPath, commentsFeedResponse, feedPathUnder, feedResponse, feedSize, splitFeedPath, COMMENTS_ROOT, COMMENTS_TITLE_PREFIX, FEED_FORMATS, FEED_SEGMENTS, } from './feeds.js';
|
|
27
|
-
import { absoluteUrl, DOCUMENT_REPRESENTATIONS, documentJson, LISTING_REPRESENTATIONS, SEARCH_REPRESENTATIONS, lastModifiedOf, latestModified, MEDIA_TYPES, notAcceptableResponse, representationHref, representationEtag, representationResponse, selectRepresentation, splitRepresentationExtension, } from './negotiate.js';
|
|
28
|
-
import { offsetForPage, paginate } from './pagination.js';
|
|
29
|
-
import { TEMPLATES } from './render.js';
|
|
30
|
-
import { robotsResponse, ROBOTS_PATH } from './robots.js';
|
|
31
|
-
import { sitemapResponse, SITEMAP_CHILD_ROUTE, SITEMAP_PATH } from './sitemap.js';
|
|
1
|
+
import { mountAvatars } from './avatar-routes.js';
|
|
2
|
+
import { mountComments } from './comment-routes.js';
|
|
3
|
+
import { mountContact } from './contact-routes.js';
|
|
4
|
+
import { COMMENT_PAGE_PREFIX } from '../content/guids.js';
|
|
5
|
+
import { findPathRedirect, findQueryRedirect, redirectLocation } from '../content/redirects.js';
|
|
6
|
+
import { UPLOAD_ASSET_PREFIX, VARIANT_ASSET_PREFIX } from '../content/uploads.js';
|
|
7
|
+
import { iconSetting } from '../images/icons.js';
|
|
8
|
+
import { advertiseIdentityEndpoints } from './indieauth-discovery.js';
|
|
9
|
+
import { mountNotificationLinks } from './notification-routes.js';
|
|
10
|
+
import { robotsPolicyOf } from '../site/settings.js';
|
|
11
|
+
import { readSiteSettings } from '../site/site-json.js';
|
|
12
|
+
import { mountPingbacks } from './pingback-routes.js';
|
|
13
|
+
import { mountWebmentions } from './webmention-routes.js';
|
|
14
|
+
import { favicon, imageVariant, themeAsset, upload } from './asset-routes.js';
|
|
15
|
+
import { THEME_ASSET_PREFIX } from '../theme/assets.js';
|
|
16
|
+
import { negotiateDocument } from './document-page.js';
|
|
17
|
+
import { goneDocumentAt, previewDocumentAt } from '../content/permalinks.js';
|
|
18
|
+
import { embedView, oEmbed } from './embed.js';
|
|
19
|
+
import { commentPage, comments, feed, repliesFeed } from './feed-routes.js';
|
|
20
|
+
import { feedPathUnder, FEED_FORMATS, REPLIES_ROOT, splitFeedPath } from './feeds.js';
|
|
21
|
+
import { indexNowKeyPath, indexNowKeyResponse } from '../site/indexnow-key.js';
|
|
22
|
+
import { listing, search } from './listing-pages.js';
|
|
23
|
+
import { feedHref, SITE_POSTS } from './listing-subject.js';
|
|
24
|
+
import { LLMS_TXT_LINK, LLMS_TXT_PATH } from './llms.js';
|
|
32
25
|
import { FAVICON_PATH, manifestResponse, MANIFEST_PATH, webManifest } from './manifest.js';
|
|
26
|
+
import { DOCUMENT_REPRESENTATIONS, LISTING_REPRESENTATIONS, representationHref, SEARCH_REPRESENTATIONS, splitRepresentationExtension, } from './negotiate.js';
|
|
27
|
+
import { EMBED_PATH, OEMBED_PATH } from './oembed.js';
|
|
33
28
|
import { openSearchDescription, openSearchResponse, OPENSEARCH_PATH } from './opensearch.js';
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
29
|
+
import { canonicalHref, classifyPath, commentsFeedHref, movedHref, parseTermPath, slashedHref, } from './paths.js';
|
|
30
|
+
import { conditionalHeaders, encodePath, gone, notFound, queryFeedFormat, requestPath, requestSearch, selectFromAccept, } from './request.js';
|
|
31
|
+
import { robotsResponse, ROBOTS_PATH } from './robots.js';
|
|
32
|
+
import { SEARCH_PATH } from './search.js';
|
|
33
|
+
import { llmsTxt, sitemap } from './site-index.js';
|
|
34
|
+
import { siteView } from './site-view.js';
|
|
35
|
+
import { SITEMAP_CHILD_ROUTE, SITEMAP_PATH } from './sitemap.js';
|
|
36
|
+
import { redirectedTerm, termHref } from '../content/taxonomy.js';
|
|
40
37
|
/**
|
|
41
38
|
* Register the public site on a Hono app.
|
|
42
39
|
*
|
|
@@ -45,10 +42,9 @@ import { PAGE_SEGMENT, redirectedTerm, taxonomyForSegment, termHref } from './ta
|
|
|
45
42
|
* routes registered after this one still win, and a permalink can never shadow
|
|
46
43
|
* them, because the document lookup only runs once nothing else has matched.
|
|
47
44
|
*/
|
|
48
|
-
export function mountPublicSite(app) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
app.use('*', publicAdminBar);
|
|
45
|
+
export function mountPublicSite(app, { adminBar } = {}) {
|
|
46
|
+
if (adminBar !== undefined)
|
|
47
|
+
app.use('*', adminBar);
|
|
52
48
|
app.use('*', advertiseIdentityEndpoints);
|
|
53
49
|
app.use('*', declaredQueryRedirect);
|
|
54
50
|
app.get(`${THEME_ASSET_PREFIX}*`, themeAsset);
|
|
@@ -79,10 +75,10 @@ export function mountPublicSite(app) {
|
|
|
79
75
|
// whole of WordPress's "Your homepage displays", decided per request off
|
|
80
76
|
// `site.json` so a save on the settings screen moves the front page on the
|
|
81
77
|
// very next one.
|
|
82
|
-
const home =
|
|
78
|
+
const home = siteView(c).pages.home;
|
|
83
79
|
const response = home === undefined
|
|
84
|
-
? listing(c, {
|
|
85
|
-
: negotiateDocument(c, home, selectFromAccept(c, DOCUMENT_REPRESENTATIONS)
|
|
80
|
+
? listing(c, { subject: SITE_POSTS, pageNumber: 0 })
|
|
81
|
+
: negotiateDocument(c, home, selectFromAccept(c, DOCUMENT_REPRESENTATIONS));
|
|
86
82
|
// The home page is where a tool that found the site looks for its index
|
|
87
83
|
// (TASK-149): a header, so it is found without parsing the page.
|
|
88
84
|
if (readSiteSettings(c.var.config.contentDir).llmsTxt) {
|
|
@@ -90,29 +86,13 @@ export function mountPublicSite(app) {
|
|
|
90
86
|
}
|
|
91
87
|
return response;
|
|
92
88
|
});
|
|
93
|
-
app.get(`/${PAGE_SEGMENT}/:page{[0-9]+}/`, (c) => {
|
|
94
|
-
const requested = Number(c.req.param('page'));
|
|
95
|
-
// Page one is the home page; it does not get a second URL.
|
|
96
|
-
if (requested <= 1)
|
|
97
|
-
return c.redirect('/', 301);
|
|
98
|
-
const pages = frontPages(c);
|
|
99
|
-
// With a posts page, the listing's pages live under it and these are the
|
|
100
|
-
// URLs they used to have; with a static homepage and no posts page, the
|
|
101
|
-
// listing has no page of its own and neither have its pages.
|
|
102
|
-
if (pages.posts !== undefined) {
|
|
103
|
-
return c.redirect(listingPageHref(pages.posts.permalink, requested - 1), 301);
|
|
104
|
-
}
|
|
105
|
-
if (pages.home !== undefined)
|
|
106
|
-
return notFound(c);
|
|
107
|
-
return listing(c, { term: undefined, pageNumber: requested - 1 });
|
|
108
|
-
});
|
|
109
89
|
// The site's own feeds are routes rather than representations, so a reader's
|
|
110
90
|
// careless `Accept` header cannot land it on the HTML (doc-3), and so a
|
|
111
91
|
// document permalinked at `/feed/` cannot take the subscribers' URL. Their
|
|
112
92
|
// paths are fixed — only the taxonomy feeds hang off a configurable base —
|
|
113
93
|
// so the route table can hold them.
|
|
114
94
|
for (const format of FEED_FORMATS) {
|
|
115
|
-
app.get(feedPathUnder('/', format), (c) => feed(c, format,
|
|
95
|
+
app.get(feedPathUnder('/', format), (c) => feed(c, format, SITE_POSTS));
|
|
116
96
|
}
|
|
117
97
|
// The site-wide comments feed, for the same reason and at WordPress's URL.
|
|
118
98
|
app.get(commentsFeedHref(undefined), (c) => comments(c, undefined));
|
|
@@ -153,15 +133,8 @@ export function mountPublicSite(app) {
|
|
|
153
133
|
// same prefix: the one response another site may put in a frame.
|
|
154
134
|
app.get(EMBED_PATH, embedView);
|
|
155
135
|
// The index for language models (TASK-149), a fixed path at the root for
|
|
156
|
-
// the same reason.
|
|
157
|
-
|
|
158
|
-
app.get(LLMS_TXT_PATH, (c) => {
|
|
159
|
-
const { contentDir, baseUrl } = c.var.config;
|
|
160
|
-
if (!readSiteSettings(contentDir).llmsTxt)
|
|
161
|
-
return notFound(c);
|
|
162
|
-
const file = ownLlmsTxt(contentDir) ?? generatedLlmsTxt(llmsIndex(c), baseUrl);
|
|
163
|
-
return llmsTxtResponse(file, conditionalHeaders(c));
|
|
164
|
-
});
|
|
136
|
+
// the same reason.
|
|
137
|
+
app.get(LLMS_TXT_PATH, llmsTxt);
|
|
165
138
|
// The IndexNow key file (TASK-151), at the root because that is where an
|
|
166
139
|
// engine checks for it. Any other `.txt` path is not this route's: it falls
|
|
167
140
|
// through to whatever document or 404 would have answered it.
|
|
@@ -182,73 +155,13 @@ export function mountPublicSite(app) {
|
|
|
182
155
|
// the way to the real one.
|
|
183
156
|
app.get(SEARCH_PATH, (c) => search(c, selectFromAccept(c, SEARCH_REPRESENTATIONS)));
|
|
184
157
|
app.get(representationHref(SEARCH_PATH, 'json'), (c) => search(c, 'json'));
|
|
185
|
-
app.get(SEARCH_PATH.slice(0, -1), (c) => c.redirect(`${SEARCH_PATH}${
|
|
186
|
-
// The
|
|
187
|
-
// when the app is built and the bases
|
|
188
|
-
// resolved per request in the not-found
|
|
189
|
-
// holds at that moment (TASK-36).
|
|
158
|
+
app.get(SEARCH_PATH.slice(0, -1), (c) => c.redirect(`${SEARCH_PATH}${requestSearch(c)}`, 301));
|
|
159
|
+
// The archives and the home listing's pages are deliberately not routes. A
|
|
160
|
+
// route table is fixed when the app is built, and the bases and the posts
|
|
161
|
+
// page are settings, so a listing is resolved per request in the not-found
|
|
162
|
+
// handler, from what the site holds at that moment (TASK-36).
|
|
190
163
|
app.notFound(resolveRequest);
|
|
191
164
|
}
|
|
192
|
-
/**
|
|
193
|
-
* The oEmbed of the post or page a URL names, a 404 when it names none, and a
|
|
194
|
-
* 501 for a format the spec allows and this provider does not serve.
|
|
195
|
-
*/
|
|
196
|
-
function oEmbed(c) {
|
|
197
|
-
const request = oEmbedRequest((name) => c.req.query(name));
|
|
198
|
-
const found = embeddableAt(c, request.url);
|
|
199
|
-
if (found === undefined)
|
|
200
|
-
return notFound(c);
|
|
201
|
-
if (request.format === undefined)
|
|
202
|
-
return c.text('Not Implemented', 501);
|
|
203
|
-
const embed = oEmbedFor({ ...embedSubject(c, found), config: c.var.config, request });
|
|
204
|
-
return oEmbedResponse(embed, request.format, conditionalHeaders(c));
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* The card of the post or page a URL names as a page another site may frame,
|
|
208
|
-
* and a 404, framed by nobody else, when it names none.
|
|
209
|
-
*/
|
|
210
|
-
function embedView(c) {
|
|
211
|
-
const found = embeddableAt(c, c.req.query('url') ?? '');
|
|
212
|
-
if (found === undefined)
|
|
213
|
-
return notFound(c);
|
|
214
|
-
c.set('frameable', true);
|
|
215
|
-
return embedResponse(embedPage(embedSubject(c, found)), conditionalHeaders(c));
|
|
216
|
-
}
|
|
217
|
-
/** What an embed of `found` is drawn from, with the byline it names. */
|
|
218
|
-
function embedSubject(c, found) {
|
|
219
|
-
const site = c.var.renderer.site();
|
|
220
|
-
const users = listUsers(c.var.config.dataDir);
|
|
221
|
-
return {
|
|
222
|
-
...found,
|
|
223
|
-
label: postLabel(found.document, (url) => c.var.replyContexts.read(url)),
|
|
224
|
-
// Who the byline names: the document's author, else the site's.
|
|
225
|
-
author: authorContext(users, found.document.author) ?? siteAuthorContext(users, site.author),
|
|
226
|
-
config: c.var.config,
|
|
227
|
-
site,
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* The published post or page an absolute URL is the page of, and where it is
|
|
232
|
-
* served, or `undefined`.
|
|
233
|
-
*
|
|
234
|
-
* The same lookup a request for that URL makes, so an embed exists exactly
|
|
235
|
-
* where a page does: a URL on this site's origin and under its base path,
|
|
236
|
-
* with no query, at a public document's permalink. `/` is the static
|
|
237
|
-
* homepage when there is one, and the posts page is the listing it carries
|
|
238
|
-
* rather than a page to embed.
|
|
239
|
-
*/
|
|
240
|
-
function embeddableAt(c, url) {
|
|
241
|
-
const pathname = permalinkOfObjectId(url, c.var.config.baseUrl);
|
|
242
|
-
if (pathname === undefined)
|
|
243
|
-
return undefined;
|
|
244
|
-
const pages = frontPages(c);
|
|
245
|
-
if (pathname === '/')
|
|
246
|
-
return pages.home === undefined ? undefined : { document: pages.home, href: '/' };
|
|
247
|
-
const document = publicDocumentAt(c.var.store, pathname);
|
|
248
|
-
if (document === undefined || document.path === pages.posts?.path)
|
|
249
|
-
return undefined;
|
|
250
|
-
return { document, href: document.path === pages.home?.path ? '/' : document.permalink };
|
|
251
|
-
}
|
|
252
165
|
/**
|
|
253
166
|
* A declared redirect whose source names a query, WordPress's `/?p=123` above
|
|
254
167
|
* all (TASK-128). It is answered before any route because `/` is one the
|
|
@@ -257,7 +170,7 @@ function embeddableAt(c, url) {
|
|
|
257
170
|
*/
|
|
258
171
|
const declaredQueryRedirect = async (c, next) => {
|
|
259
172
|
if (c.req.method === 'GET' || c.req.method === 'HEAD') {
|
|
260
|
-
const
|
|
173
|
+
const search = requestSearch(c);
|
|
261
174
|
const redirect = search === ''
|
|
262
175
|
? undefined
|
|
263
176
|
: findQueryRedirect(c.var.redirects.current(), requestPath(c), search);
|
|
@@ -266,130 +179,56 @@ const declaredQueryRedirect = async (c, next) => {
|
|
|
266
179
|
}
|
|
267
180
|
await next();
|
|
268
181
|
};
|
|
269
|
-
/**
|
|
270
|
-
* The last stop for a request: a taxonomy archive or one of its feeds, the
|
|
271
|
-
* document at this URL, the same document in the representation a `.md` or
|
|
272
|
-
* `.json` suffix asked for, the canonical URL it should have asked for, or the
|
|
273
|
-
* theme's 404.
|
|
274
|
-
*
|
|
275
|
-
* The archives come first, so an archive URL means the archive however a
|
|
276
|
-
* document is permalinked; they are here rather than in the route table
|
|
277
|
-
* because their bases are a setting, and a route table is fixed when the app
|
|
278
|
-
* is built. The suffix is stripped and the *same* {@link publicDocumentAt}
|
|
279
|
-
* lookup runs again, so no representation can resolve to a document the others
|
|
280
|
-
* cannot see.
|
|
281
|
-
*/
|
|
282
182
|
function resolveRequest(c) {
|
|
283
|
-
const
|
|
183
|
+
const view = siteView(c);
|
|
284
184
|
const pathname = requestPath(c);
|
|
285
|
-
const
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const request = postsPageRequest(pages.posts, pathname);
|
|
293
|
-
if (request !== undefined) {
|
|
294
|
-
// `{permalink}page/1/` is the listing's own URL spelled twice, and
|
|
295
|
-
// collapses onto it exactly as `/page/1/` collapses onto `/`.
|
|
296
|
-
if (request.pageNumber === 0 && pathname !== pages.posts.permalink) {
|
|
297
|
-
return c.redirect(encodePath(pages.posts.permalink), 301);
|
|
298
|
-
}
|
|
299
|
-
return listing(c, request);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
const feedRequest = parseFeedPath(c, pathname, bases, authors);
|
|
303
|
-
if (feedRequest !== undefined) {
|
|
304
|
-
const { target, format } = feedRequest;
|
|
305
|
-
const canonical = feedTargetHref(target, format, bases);
|
|
306
|
-
if (!feedRequest.canonical ||
|
|
307
|
-
isCarriedTagFeedInAnotherCasing(store, target, canonical, pathname)) {
|
|
308
|
-
return c.redirect(canonical, 301);
|
|
185
|
+
const search = requestSearch(c);
|
|
186
|
+
const here = encodePath(pathname);
|
|
187
|
+
const match = classifyPath(view, pathname);
|
|
188
|
+
if (match !== undefined) {
|
|
189
|
+
const href = canonicalHref(view, match);
|
|
190
|
+
if (href !== here || (match.kind === 'feed' && !match.canonical)) {
|
|
191
|
+
return c.redirect(`${href}${search}`, 301);
|
|
309
192
|
}
|
|
310
|
-
return
|
|
311
|
-
? feed(c, format, target.subject)
|
|
312
|
-
: comments(c, target.document);
|
|
313
|
-
}
|
|
314
|
-
const archive = taxonomyArchive(c, pathname, bases, authors);
|
|
315
|
-
if (archive !== undefined)
|
|
316
|
-
return archive;
|
|
317
|
-
// And one person's, which is the same kind of thing at a path the site
|
|
318
|
-
// reserves: `author` is never a document's first segment, so this can be
|
|
319
|
-
// answered before the permalink lookup without anything being shadowed.
|
|
320
|
-
const byAuthor = authorArchive(c, pathname, bases, authors);
|
|
321
|
-
if (byAuthor !== undefined)
|
|
322
|
-
return byAuthor;
|
|
323
|
-
const document = publicDocumentAt(store, pathname);
|
|
324
|
-
if (document !== undefined) {
|
|
325
|
-
// The front page has one URL. The page it is made of keeps its own
|
|
326
|
-
// permalink in the file, so that a homepage put back to being an ordinary
|
|
327
|
-
// page goes back to answering there, and that URL points at `/` while it
|
|
328
|
-
// is the front page.
|
|
329
|
-
if (document.path === pages.home?.path)
|
|
330
|
-
return c.redirect('/', 301);
|
|
331
|
-
// WordPress answered `?feed=rss2` on a permalink with that document's
|
|
332
|
-
// comments feed, which is the only feed a document has here too. The other
|
|
333
|
-
// spellings name a format a comments feed does not come in, so they are
|
|
334
|
-
// not a feed request at all and the page is served.
|
|
335
|
-
if (queryFeedFormat(c) === 'rss' && showsConversation(c, document)) {
|
|
336
|
-
return c.redirect(commentsFeedHref(document), 301);
|
|
337
|
-
}
|
|
338
|
-
return negotiateDocument(c, document, selectFromAccept(c, DOCUMENT_REPRESENTATIONS));
|
|
193
|
+
return serve(c, view, match);
|
|
339
194
|
}
|
|
340
195
|
const hidden = hiddenDocumentForSignedInHtml(c, pathname);
|
|
341
196
|
if (hidden !== undefined)
|
|
342
197
|
return hidden;
|
|
343
|
-
const { search } = new URL(c.req.url);
|
|
344
198
|
const extension = splitRepresentationExtension(pathname);
|
|
345
199
|
if (extension !== undefined) {
|
|
346
|
-
const
|
|
347
|
-
const href = representationHref(encodePath(candidate), extension.representation);
|
|
348
|
-
return href === encodePath(pathname) ? undefined : `${href}${search}`;
|
|
349
|
-
};
|
|
200
|
+
const { representation } = extension;
|
|
350
201
|
for (const candidate of extension.paths) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
// `/index.json`, `/page/2/index.json`, `/tag/x/index.json`,
|
|
364
|
-
// `/category/x/index.json`: the same escape hatch over a listing, for the
|
|
365
|
-
// representations a listing has.
|
|
366
|
-
if (LISTING_REPRESENTATIONS.includes(extension.representation)) {
|
|
367
|
-
for (const candidate of extension.paths) {
|
|
368
|
-
const request = listingRequestAt(store, pages, candidate, bases, authors);
|
|
369
|
-
if (request === undefined)
|
|
370
|
-
continue;
|
|
371
|
-
const canonical = canonicalRedirect(candidate);
|
|
372
|
-
if (canonical !== undefined)
|
|
373
|
-
return c.redirect(canonical, 301);
|
|
374
|
-
return listing(c, request, extension.representation);
|
|
375
|
-
}
|
|
202
|
+
const found = classifyPath(view, candidate);
|
|
203
|
+
if (found === undefined || found.kind === 'feed')
|
|
204
|
+
continue;
|
|
205
|
+
if (found.kind === 'listing' && !LISTING_REPRESENTATIONS.includes(representation))
|
|
206
|
+
continue;
|
|
207
|
+
const href = representationHref(canonicalHref(view, found), representation);
|
|
208
|
+
if (href !== here)
|
|
209
|
+
return c.redirect(`${href}${search}`, 301);
|
|
210
|
+
return found.kind === 'listing'
|
|
211
|
+
? listing(c, found, representation)
|
|
212
|
+
: negotiateDocument(c, found.document, representation);
|
|
376
213
|
}
|
|
377
214
|
}
|
|
378
215
|
// Nothing lives here, so a URL something used to live at leads on to where
|
|
379
216
|
// it lives now. Asked only after every live lookup, which is what lets a new
|
|
380
|
-
// document take an old URL over
|
|
381
|
-
|
|
217
|
+
// document take an old URL over, and a term that comes back into use beat
|
|
218
|
+
// the record of what it was renamed to.
|
|
219
|
+
const formerly = movedHref(view, pathname, undefined) ??
|
|
382
220
|
extension?.paths
|
|
383
|
-
.map((candidate) => movedHref(
|
|
384
|
-
.find((href) => href !== undefined)
|
|
221
|
+
.map((candidate) => movedHref(view, candidate, extension.representation))
|
|
222
|
+
.find((href) => href !== undefined) ??
|
|
223
|
+
renamedTermHref(c, view, pathname);
|
|
385
224
|
if (formerly !== undefined)
|
|
386
225
|
return c.redirect(`${formerly}${search}`, 301);
|
|
387
|
-
const deleted = [pathname, ...(extension?.paths ?? [])].some((candidate) => goneDocumentAt(store, candidate) !== undefined);
|
|
226
|
+
const deleted = [pathname, ...(extension?.paths ?? [])].some((candidate) => goneDocumentAt(view.store, candidate) !== undefined);
|
|
388
227
|
if (deleted)
|
|
389
228
|
return gone(c);
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
return c.redirect(
|
|
229
|
+
const slashed = slashedHref(view, pathname, c.var.renderer.pageSize());
|
|
230
|
+
if (slashed !== undefined)
|
|
231
|
+
return c.redirect(`${slashed}${search}`, 301);
|
|
393
232
|
// And a URL the site itself says has moved (TASK-128), after every live
|
|
394
233
|
// lookup and after the slash that would lead to one, so a declared source
|
|
395
234
|
// never shadows a live document.
|
|
@@ -399,63 +238,25 @@ function resolveRequest(c) {
|
|
|
399
238
|
}
|
|
400
239
|
return notFound(c);
|
|
401
240
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
* collapses onto the home page, and an archive nothing carries 404s rather
|
|
420
|
-
* than redirecting first: a URL that leads nowhere should cost one 404, not a
|
|
421
|
-
* redirect and then a 404.
|
|
422
|
-
*/
|
|
423
|
-
function taxonomyArchive(c, pathname, bases, authors) {
|
|
424
|
-
if (!pathname.endsWith('/'))
|
|
425
|
-
return undefined;
|
|
426
|
-
const request = parseListingPath(c.var.store, pathname, bases, authors);
|
|
427
|
-
if (request?.term === undefined)
|
|
428
|
-
return undefined;
|
|
429
|
-
// An archive that answers is served; only once nothing carries the term is
|
|
430
|
-
// the record of renames consulted, so a term that comes back into use — or
|
|
431
|
-
// one that was merged into and then recreated — beats what it used to be
|
|
432
|
-
// called. One hop: the list is stored with its chains already collapsed.
|
|
433
|
-
if (countListing(c.var.store, request) === 0) {
|
|
434
|
-
const moved = movedTerm(c, request.term);
|
|
435
|
-
if (moved !== undefined)
|
|
436
|
-
return c.redirect(termHref(moved, request.pageNumber, bases), 301);
|
|
437
|
-
}
|
|
438
|
-
const canonical = termHref(request.term, request.pageNumber, bases);
|
|
439
|
-
if (canonical !== encodePath(pathname)) {
|
|
440
|
-
return countListing(c.var.store, request) === 0 ? notFound(c) : c.redirect(canonical, 301);
|
|
241
|
+
function serve(c, view, match) {
|
|
242
|
+
switch (match.kind) {
|
|
243
|
+
case 'listing':
|
|
244
|
+
return listing(c, match);
|
|
245
|
+
case 'feed':
|
|
246
|
+
return match.target.kind === 'listing'
|
|
247
|
+
? feed(c, match.format, match.target.subject)
|
|
248
|
+
: comments(c, match.target.document);
|
|
249
|
+
case 'document':
|
|
250
|
+
// WordPress answered `?feed=rss2` on a permalink with that document's
|
|
251
|
+
// comments feed, which is the only feed a document has here too. The
|
|
252
|
+
// other spellings name a format a comments feed does not come in, so
|
|
253
|
+
// they are not a feed request at all and the page is served.
|
|
254
|
+
if (queryFeedFormat(c) === 'rss' && view.showsConversation(match.document)) {
|
|
255
|
+
return c.redirect(commentsFeedHref(match.document), 301);
|
|
256
|
+
}
|
|
257
|
+
return negotiateDocument(c, match.document, selectFromAccept(c, DOCUMENT_REPRESENTATIONS));
|
|
441
258
|
}
|
|
442
|
-
return listing(c, request);
|
|
443
259
|
}
|
|
444
|
-
/**
|
|
445
|
-
* One person's archive, the redirect that puts it at its canonical URL, or
|
|
446
|
-
* `undefined` when the path is not one.
|
|
447
|
-
*
|
|
448
|
-
* Unlike a taxonomy archive it does not depend on there being anything on it.
|
|
449
|
-
* A tag exists only while something carries it; a person exists because they
|
|
450
|
-
* have an account, and after decision-14 this URL is the id their followers
|
|
451
|
-
* file them under — so an archive that 404'd until its owner published would
|
|
452
|
-
* be an account that came into being with a post. What decides the 404 is
|
|
453
|
-
* whether the username is somebody's, which {@link parseListingPath} has
|
|
454
|
-
* already asked.
|
|
455
|
-
*
|
|
456
|
-
* `/author/{username}/page/1/` collapses onto the archive root the way
|
|
457
|
-
* `/page/1/` collapses onto the home page.
|
|
458
|
-
*/
|
|
459
260
|
function hiddenDocumentForSignedInHtml(c, pathname) {
|
|
460
261
|
if (c.var.signedIn === undefined)
|
|
461
262
|
return undefined;
|
|
@@ -464,1087 +265,25 @@ function hiddenDocumentForSignedInHtml(c, pathname) {
|
|
|
464
265
|
const hidden = previewDocumentAt(c.var.store, pathname);
|
|
465
266
|
return hidden === undefined ? undefined : negotiateDocument(c, hidden, 'html');
|
|
466
267
|
}
|
|
467
|
-
function authorArchive(c, pathname, bases, authors) {
|
|
468
|
-
if (!pathname.endsWith('/'))
|
|
469
|
-
return undefined;
|
|
470
|
-
const request = parseListingPath(c.var.store, pathname, bases, authors);
|
|
471
|
-
if (request?.author === undefined)
|
|
472
|
-
return undefined;
|
|
473
|
-
const canonical = authorHref(request.author.user.username, request.pageNumber);
|
|
474
|
-
if (canonical !== encodePath(pathname))
|
|
475
|
-
return c.redirect(canonical, 301);
|
|
476
|
-
return listing(c, request);
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Where a term with nothing left under it went, or `undefined` when the site
|
|
480
|
-
* records no such rename.
|
|
481
|
-
*/
|
|
482
|
-
function movedTerm(c, term) {
|
|
483
|
-
const moved = redirectedTerm(c.var.renderer.termRedirects(), term);
|
|
484
|
-
return moved === undefined ? undefined : { taxonomy: term.taxonomy, term: moved };
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* A path as the feed it names: `/feed/`, `/feed/atom/`, `/{base}/x/feed/json/`,
|
|
488
|
-
* the comments feeds at `/comments/feed/` and `{permalink}feed/`, and the
|
|
489
|
-
* `/feed/rss/` spelling WordPress also answered at any of those roots.
|
|
490
|
-
*
|
|
491
|
-
* The site's own canonical feeds are real routes and never reach here; what
|
|
492
|
-
* does reach here is every taxonomy feed — their bases are a setting, so they
|
|
493
|
-
* cannot be in the route table — every document's comments feed, and every alias.
|
|
494
|
-
*/
|
|
495
|
-
function parseFeedPath(c, pathname, bases, authors) {
|
|
496
|
-
const { store } = c.var;
|
|
497
|
-
const split = splitFeedPath(pathname);
|
|
498
|
-
if (split === undefined)
|
|
499
|
-
return undefined;
|
|
500
|
-
const { format, canonical } = split;
|
|
501
|
-
if (split.root === COMMENTS_ROOT) {
|
|
502
|
-
return format === 'rss'
|
|
503
|
-
? { target: { kind: 'comments', document: undefined }, format, canonical }
|
|
504
|
-
: undefined;
|
|
505
|
-
}
|
|
506
|
-
const root = parseListingPath(store, split.root, bases, authors);
|
|
507
|
-
// Only a listing root has a feed, and only its first page: a feed is not
|
|
508
|
-
// paginated, so `/{base}/x/page/2/feed/` names nothing.
|
|
509
|
-
if (root !== undefined) {
|
|
510
|
-
return root.pageNumber === 0
|
|
511
|
-
? { target: { kind: 'listing', subject: root }, format, canonical }
|
|
512
|
-
: undefined;
|
|
513
|
-
}
|
|
514
|
-
// Otherwise it may be a document's comments feed, which it has exactly when
|
|
515
|
-
// its page shows its conversation.
|
|
516
|
-
if (format !== 'rss')
|
|
517
|
-
return undefined;
|
|
518
|
-
const document = publicDocumentAt(store, split.root);
|
|
519
|
-
if (document === undefined || !showsConversation(c, document))
|
|
520
|
-
return undefined;
|
|
521
|
-
return { target: { kind: 'comments', document }, format, canonical };
|
|
522
|
-
}
|
|
523
|
-
/** Whether this document's page shows its conversation, and so has a comments feed. */
|
|
524
|
-
function showsConversation(c, document) {
|
|
525
|
-
return answerable(document, commentPolicyOf(c.var.renderer.site()), c.var.store.now());
|
|
526
|
-
}
|
|
527
|
-
/** Where the canonical URL of one feed is. */
|
|
528
|
-
function feedTargetHref(target, format, bases) {
|
|
529
|
-
return target.kind === 'listing'
|
|
530
|
-
? listingFeedHref(target.subject, format, bases)
|
|
531
|
-
: commentsFeedHref(target.document);
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* The format `?feed=` asked for, WordPress's pre-permalink spelling, or
|
|
535
|
-
* `undefined` when the request did not ask for a feed at all.
|
|
536
|
-
*
|
|
537
|
-
* `rss2` is what WordPress calls RSS 2.0 and `rss` its RSS 0.92, which this
|
|
538
|
-
* site does not serve and answers with the RSS 2.0 feed rather than a 404.
|
|
539
|
-
*/
|
|
540
|
-
function queryFeedFormat(c) {
|
|
541
|
-
const asked = c.req.query('feed');
|
|
542
|
-
if (asked === undefined)
|
|
543
|
-
return undefined;
|
|
544
|
-
if (asked === 'rss2' || asked === 'rss')
|
|
545
|
-
return 'rss';
|
|
546
|
-
return FEED_FORMATS.find((format) => FEED_SEGMENTS[format] === asked);
|
|
547
|
-
}
|
|
548
|
-
/**
|
|
549
|
-
* What the query string puts on a rendered post, if anything.
|
|
550
|
-
*
|
|
551
|
-
* A reader has no session, so the message after a submission travels in the
|
|
552
|
-
* URL and is read back here. An unknown value says nothing at all rather than
|
|
553
|
-
* being printed, so the query cannot be used to put words on somebody's post.
|
|
554
|
-
*/
|
|
555
|
-
function commentNotice(c, document, viewer) {
|
|
556
|
-
const notice = commentNoticeFor(c.req.query(COMMENT_NOTICE_PARAM));
|
|
557
|
-
return {
|
|
558
|
-
...(notice === undefined ? {} : { commentNotice: notice }),
|
|
559
|
-
// And who a Reply link says the form is answering, which travels the same
|
|
560
|
-
// way and for the same reason: a reader has no session, and threading
|
|
561
|
-
// should not need a line of JavaScript.
|
|
562
|
-
...commentReplyTarget({
|
|
563
|
-
admin: c.var.admin,
|
|
564
|
-
document,
|
|
565
|
-
id: c.req.query(COMMENT_REPLY_PARAM),
|
|
566
|
-
thread: viewer === undefined ? undefined : c.var.conversation.thread(document),
|
|
567
|
-
}),
|
|
568
|
-
// And the thank-you after a contact form was sent, which travels the same
|
|
569
|
-
// way for the same reason (TASK-56).
|
|
570
|
-
...contactNotice(c),
|
|
571
|
-
};
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* The thank-you a contact form's redirect landed on, if the query names one.
|
|
575
|
-
*
|
|
576
|
-
* On the context rather than in the form's own state because the redirect is
|
|
577
|
-
* what makes a refresh harmless: the page is drawn fresh, and the query is the
|
|
578
|
-
* only thing that says a message went.
|
|
579
|
-
*/
|
|
580
|
-
function contactNotice(c) {
|
|
581
|
-
const notice = contactNoticeFor(c.req.query(CONTACT_NOTICE_PARAM));
|
|
582
|
-
return notice === undefined ? {} : { contactNotice: notice };
|
|
583
|
-
}
|
|
584
|
-
/** The representation an `Accept` header asked for, or `undefined` for a 406. */
|
|
585
|
-
function selectFromAccept(c, available) {
|
|
586
|
-
return selectRepresentation(c.req.header('accept'), available);
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* One document in one representation, or the 406 an impossible `Accept` earns.
|
|
590
|
-
*
|
|
591
|
-
* `href` is where it is being served, which is its own permalink everywhere
|
|
592
|
-
* but the front page: a page serving as the homepage is read at `/`, and the
|
|
593
|
-
* canonical URL, the alternates and the theme's own links have to say so.
|
|
594
|
-
*/
|
|
595
|
-
function negotiateDocument(c, document, representation, href = document.permalink) {
|
|
596
|
-
if (representation === undefined) {
|
|
597
|
-
return notAcceptableResponse(encodePath(href), DOCUMENT_REPRESENTATIONS);
|
|
598
|
-
}
|
|
599
|
-
// Who the request's session says is reading, when it says anybody
|
|
600
|
-
// (TASK-103). Only the HTML has a form on it, so only the HTML asks; the
|
|
601
|
-
// Markdown and JSON of a post are the same bytes for everybody.
|
|
602
|
-
const account = representation === 'html' ? c.var.signedIn : undefined;
|
|
603
|
-
const viewer = account === undefined ? undefined : commenterOf(account);
|
|
604
|
-
// And which document it is, so the admin bar can offer its editor.
|
|
605
|
-
if (representation === 'html')
|
|
606
|
-
c.set('shownDocument', document);
|
|
607
|
-
const listed = isListed(document, c.var.store.now());
|
|
608
|
-
// The thank-you after a comment was posted, which the redirect carried back
|
|
609
|
-
// as a query, is the only thing about a document's HTML that the URL rather
|
|
610
|
-
// than the file decides. A document served at `/` is the site's front page,
|
|
611
|
-
// and the front page is the one place a theme may lay a page out differently.
|
|
612
|
-
const page = representation === 'html'
|
|
613
|
-
? c.var.renderer.renderPage(document, {
|
|
614
|
-
frontPage: href === '/',
|
|
615
|
-
extra: { ...commentNotice(c, document, viewer), ...(listed ? {} : { noindex: true }) },
|
|
616
|
-
viewer,
|
|
617
|
-
})
|
|
618
|
-
: undefined;
|
|
619
|
-
const markdown = representation === 'markdown' || representation === 'text'
|
|
620
|
-
? documentMarkdown(document)
|
|
621
|
-
: undefined;
|
|
622
|
-
const body = markdown ??
|
|
623
|
-
(representation === 'json'
|
|
624
|
-
? documentJson(document, { baseUrl: c.var.config.baseUrl })
|
|
625
|
-
: page?.html);
|
|
626
|
-
const response = representationResponse({
|
|
627
|
-
body,
|
|
628
|
-
representation,
|
|
629
|
-
href: encodePath(href),
|
|
630
|
-
available: DOCUMENT_REPRESENTATIONS,
|
|
631
|
-
noindex: !listed,
|
|
632
|
-
// Where a webmention about this page is sent. It is a header rather than
|
|
633
|
-
// only a `<link>` because a sender is allowed to find the endpoint without
|
|
634
|
-
// parsing the page, and because the JSON and Markdown representations of a
|
|
635
|
-
// post have no head to put one in (TASK-51).
|
|
636
|
-
links: webmentionLinks(c),
|
|
637
|
-
// A page drawn for one named reader is that reader's page rather than the
|
|
638
|
-
// post, so nothing shared may hold it and it carries no validator. A page
|
|
639
|
-
// drawn for everybody is exactly what it has always been.
|
|
640
|
-
...(viewer === undefined ? {} : { private: true }),
|
|
641
|
-
// The JSON is the file, so the file's hash and dates validate it. The HTML
|
|
642
|
-
// also draws the theme, the conversation, the neighbours and whatever else
|
|
643
|
-
// the site holds, none of which the file's hash sees, so it is validated by
|
|
644
|
-
// the page it drew (TASK-181). Nothing records when a withdrawn reply
|
|
645
|
-
// stopped being shown, so the HTML has no date that could agree with that
|
|
646
|
-
// ETag and carries no Last-Modified.
|
|
647
|
-
...(page === undefined
|
|
648
|
-
? {
|
|
649
|
-
etag: representationEtag(representation, markdown ?? document.hash),
|
|
650
|
-
lastModified: lastModifiedOf(document),
|
|
651
|
-
}
|
|
652
|
-
: { etag: representationEtag(representation, page.fingerprint) }),
|
|
653
|
-
conditional: conditionalHeaders(c),
|
|
654
|
-
});
|
|
655
|
-
const pingback = pingbackEndpointFor(c.var.renderer.site(), document, c.var.config.now());
|
|
656
|
-
if (pingback !== undefined) {
|
|
657
|
-
response.headers.set('x-pingback', absoluteUrl(pingback, c.var.config.baseUrl));
|
|
658
|
-
}
|
|
659
|
-
return response;
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* The `Link` header advertising this site's webmention endpoint, or none when
|
|
663
|
-
* the site does not take them.
|
|
664
|
-
*
|
|
665
|
-
* Read per request off the settings, so turning webmentions off on the
|
|
666
|
-
* settings screen takes the advertisement off the very next page rather than
|
|
667
|
-
* off the next restart.
|
|
668
|
-
*/
|
|
669
|
-
function webmentionLinks(c) {
|
|
670
|
-
if (!readSiteSettings(c.var.config.contentDir).webmentionsReceive)
|
|
671
|
-
return [];
|
|
672
|
-
return [`<${WEBMENTION_PATH}>; rel="webmention"`];
|
|
673
|
-
}
|
|
674
|
-
/** The conditional request headers, as the negotiator wants them. */
|
|
675
|
-
function conditionalHeaders(c) {
|
|
676
|
-
return {
|
|
677
|
-
ifNoneMatch: c.req.header('if-none-match'),
|
|
678
|
-
ifModifiedSince: c.req.header('if-modified-since'),
|
|
679
|
-
};
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* The canonical URL for a path that arrived without its trailing slash, or
|
|
683
|
-
* `undefined` when adding one would not resolve either.
|
|
684
|
-
*
|
|
685
|
-
* Redirecting only to somewhere real means a genuinely missing URL costs one
|
|
686
|
-
* 404 rather than a redirect and then a 404. The target is the canonical URL
|
|
687
|
-
* itself rather than the path with a slash bolted on, so `/page/1` lands on
|
|
688
|
-
* `/` in one hop instead of two.
|
|
689
|
-
*/
|
|
690
|
-
function canonicalPath(c, pathname, bases, authors) {
|
|
691
|
-
if (pathname === '' || pathname.endsWith('/'))
|
|
692
|
-
return undefined;
|
|
693
|
-
const target = canonicalTarget(c, `${pathname}/`, bases, authors);
|
|
694
|
-
if (target === undefined)
|
|
695
|
-
return undefined;
|
|
696
|
-
return `${target}${new URL(c.req.url).search}`;
|
|
697
|
-
}
|
|
698
|
-
/** Where a path with a trailing slash canonically lives, if anywhere. */
|
|
699
|
-
function canonicalTarget(c, pathname, bases, authors) {
|
|
700
|
-
const { store, renderer } = c.var;
|
|
701
|
-
// A feed first: `/feed`, `/feed/atom`, `/{base}/x/feed`, `/comments/feed`
|
|
702
|
-
// and a document's `{permalink}feed` all lead somewhere real, and `/feed/rss`
|
|
703
|
-
// leads to `/feed/` in the same one hop rather than to a second redirect.
|
|
704
|
-
const feedRequest = parseFeedPath(c, pathname, bases, authors);
|
|
705
|
-
if (feedRequest !== undefined) {
|
|
706
|
-
const { target } = feedRequest;
|
|
707
|
-
if (target.kind === 'listing' &&
|
|
708
|
-
target.subject.term !== undefined &&
|
|
709
|
-
countListing(store, target.subject) === 0) {
|
|
710
|
-
return undefined;
|
|
711
|
-
}
|
|
712
|
-
return feedTargetHref(target, feedRequest.format, bases);
|
|
713
|
-
}
|
|
714
|
-
const pages = frontPages(c);
|
|
715
|
-
const document = store.getByPermalink(pathname);
|
|
716
|
-
if (document !== undefined) {
|
|
717
|
-
if (!isServed(document))
|
|
718
|
-
return undefined;
|
|
719
|
-
// The homepage's own URL leads to `/` rather than to the redirect that
|
|
720
|
-
// leads to `/`: one hop, the way `/page/1` reaches `/` in one.
|
|
721
|
-
return document.path === pages.home?.path ? '/' : encodePath(pathname);
|
|
722
|
-
}
|
|
723
|
-
const moved = movedHref(store, pages, pathname, undefined);
|
|
724
|
-
if (moved !== undefined)
|
|
725
|
-
return moved;
|
|
726
|
-
const listing = listingRequestAt(store, pages, pathname, bases, authors);
|
|
727
|
-
if (listing === undefined)
|
|
728
|
-
return undefined;
|
|
729
|
-
// The home listing and an author archive both exist with nothing on them; a
|
|
730
|
-
// taxonomy archive does not.
|
|
731
|
-
const total = countListing(store, listing);
|
|
732
|
-
if (listing.term !== undefined && total === 0)
|
|
733
|
-
return undefined;
|
|
734
|
-
const totalPages = Math.max(1, Math.ceil(total / renderer.pageSize()));
|
|
735
|
-
if (listing.pageNumber >= totalPages)
|
|
736
|
-
return undefined;
|
|
737
|
-
return listingHref(listing, listing.pageNumber, bases, listing.document?.permalink ?? '/');
|
|
738
|
-
}
|
|
739
|
-
/** {@link AuthorLookup} over one request's site. */
|
|
740
|
-
function authorsOf(c) {
|
|
741
|
-
let users;
|
|
742
|
-
return (username) => {
|
|
743
|
-
users ??= listUsers(c.var.config.dataDir);
|
|
744
|
-
const user = users.find((candidate) => candidate.username === username);
|
|
745
|
-
return user === undefined ? undefined : { user, names: authorNames(users, user) };
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
/**
|
|
749
|
-
* WordPress's Reading choice, resolved for this request.
|
|
750
|
-
*
|
|
751
|
-
* The setting holds slugs, and a slug is only a front page while it names a
|
|
752
|
-
* page the public site would serve: one drafted, trashed or deleted since it
|
|
753
|
-
* was picked resolves to nothing, and a site whose homepage resolves to
|
|
754
|
-
* nothing is a site showing its latest posts again. That is the whole of the
|
|
755
|
-
* fallback — there is no state to repair and nothing to write — and it is why
|
|
756
|
-
* the pick is kept rather than cleared: publishing the page again puts the
|
|
757
|
-
* front page back.
|
|
758
|
-
*/
|
|
759
|
-
function frontPages(c) {
|
|
760
|
-
const { homepage, postsPage } = c.var.renderer.frontPageSlugs();
|
|
761
|
-
const home = publicPage(c, homepage);
|
|
762
|
-
return {
|
|
763
|
-
home,
|
|
764
|
-
// Without a homepage there is no posts page: the listing is already at
|
|
765
|
-
// `/`, and a second URL for it is exactly what this pair exists to avoid.
|
|
766
|
-
posts: home === undefined ? undefined : publicPage(c, postsPage),
|
|
767
|
-
};
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* A path as the page of a listing it names, wherever the listing lives, or
|
|
771
|
-
* `undefined` when it names none.
|
|
772
|
-
*
|
|
773
|
-
* The posts page first, because its permalink is the listing's root on a site
|
|
774
|
-
* that has one; then the ordinary `/`, `/page/N/` and the taxonomy archives.
|
|
775
|
-
* A site whose homepage is a page and which named no posts page has no home
|
|
776
|
-
* listing at all, so nothing under the root is one either.
|
|
777
|
-
*/
|
|
778
|
-
function listingRequestAt(store, pages, pathname, bases, authors) {
|
|
779
|
-
const onPostsPage = pages.posts === undefined ? undefined : postsPageRequest(pages.posts, pathname);
|
|
780
|
-
if (onPostsPage !== undefined)
|
|
781
|
-
return onPostsPage;
|
|
782
|
-
const request = parseListingPath(store, pathname, bases, authors);
|
|
783
|
-
if (request === undefined)
|
|
784
|
-
return undefined;
|
|
785
|
-
// Only the home listing can be homeless. A tag archive and a person's
|
|
786
|
-
// archive have URLs of their own, whatever the Reading setting says `/` is.
|
|
787
|
-
if (request.term === undefined && request.author === undefined) {
|
|
788
|
-
if (listingRoot(pages) === undefined)
|
|
789
|
-
return undefined;
|
|
790
|
-
}
|
|
791
|
-
return request;
|
|
792
|
-
}
|
|
793
268
|
/**
|
|
794
|
-
* Where
|
|
269
|
+
* Where a renamed term's archive page or feed lives now, or `undefined` when
|
|
270
|
+
* the path is neither or the site records no rename of its term.
|
|
795
271
|
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
*
|
|
799
|
-
* screen offers the second pick. The feeds are unaffected either way.
|
|
272
|
+
* One hop: the list is stored with its chains already collapsed. A subscriber
|
|
273
|
+
* to the old feed follows it to the new one, exactly as a reader of the archive
|
|
274
|
+
* does.
|
|
800
275
|
*/
|
|
801
|
-
function
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}
|
|
806
|
-
/** The published page one slug names, or `undefined`. */
|
|
807
|
-
function publicPage(c, slug) {
|
|
808
|
-
if (slug === '')
|
|
809
|
-
return undefined;
|
|
810
|
-
const found = c.var.store.getBySlug(slug);
|
|
811
|
-
if (found?.type !== 'page')
|
|
812
|
-
return undefined;
|
|
813
|
-
return isServed(found, c.var.store.now()) ? found : undefined;
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* `{permalink}` or `{permalink}page/N/` as a page of the listing the posts
|
|
817
|
-
* page carries, or `undefined` when the path is neither.
|
|
818
|
-
*
|
|
819
|
-
* `page/1/` is not one: the first page of a listing lives at the listing's own
|
|
820
|
-
* URL, exactly as `/page/1/` collapses onto `/`, and the canonicalisation that
|
|
821
|
-
* says so is the ordinary one.
|
|
822
|
-
*/
|
|
823
|
-
function postsPageRequest(document, pathname) {
|
|
824
|
-
const { permalink } = document;
|
|
825
|
-
if (pathname === permalink)
|
|
826
|
-
return { term: undefined, pageNumber: 0, document };
|
|
827
|
-
if (!pathname.startsWith(permalink))
|
|
828
|
-
return undefined;
|
|
829
|
-
const segments = pathname
|
|
830
|
-
.slice(permalink.length)
|
|
831
|
-
.split('/')
|
|
832
|
-
.filter((segment) => segment !== '');
|
|
833
|
-
if (segments.length !== 2 || segments[0] !== PAGE_SEGMENT || !pathname.endsWith('/')) {
|
|
276
|
+
function renamedTermHref(c, view, pathname) {
|
|
277
|
+
const feedPath = splitFeedPath(pathname);
|
|
278
|
+
const asked = parseTermPath(view, feedPath?.root ?? pathname);
|
|
279
|
+
if (asked === undefined || (feedPath !== undefined && asked.pageNumber !== 0))
|
|
834
280
|
return undefined;
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
return page === undefined ? undefined : { term: undefined, pageNumber: page, document };
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* `/`, `/page/N/`, `/author/{username}/` and `/author/{username}/page/N/`, and
|
|
841
|
-
* either taxonomy's `/{base}/x/` and `/{base}/x/page/N/`, as a listing to
|
|
842
|
-
* check.
|
|
843
|
-
*/
|
|
844
|
-
function parseListingPath(store, pathname, bases, authors) {
|
|
845
|
-
const segments = pathname.split('/').filter((segment) => segment !== '');
|
|
846
|
-
if (segments.length === 0)
|
|
847
|
-
return { term: undefined, pageNumber: 0 };
|
|
848
|
-
if (segments[0] === PAGE_SEGMENT && segments.length === 2) {
|
|
849
|
-
const page = pageIndex(segments[1]);
|
|
850
|
-
return page === undefined ? undefined : { term: undefined, pageNumber: page };
|
|
851
|
-
}
|
|
852
|
-
// One person's archive, at the path decision-14 reserves. A username nobody
|
|
853
|
-
// has is not a listing at all, which is what turns it into one 404 rather
|
|
854
|
-
// than an empty archive.
|
|
855
|
-
const byAuthor = parseAuthorPath(pathname);
|
|
856
|
-
if (byAuthor !== undefined) {
|
|
857
|
-
const found = authors(byAuthor.username);
|
|
858
|
-
return found === undefined ? undefined : { author: found, pageNumber: byAuthor.pageNumber };
|
|
859
|
-
}
|
|
860
|
-
const taxonomy = taxonomyForSegment(segments[0], bases);
|
|
861
|
-
const named = segments[1];
|
|
862
|
-
if (taxonomy === undefined || named === undefined)
|
|
281
|
+
const to = redirectedTerm(c.var.renderer.termRedirects(), asked.term);
|
|
282
|
+
if (to === undefined)
|
|
863
283
|
return undefined;
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
const page = pageIndex(segments[3]);
|
|
869
|
-
return page === undefined ? undefined : { term, pageNumber: page };
|
|
870
|
-
}
|
|
871
|
-
return undefined;
|
|
872
|
-
}
|
|
873
|
-
function asTheSiteSpellsIt(store, taxonomy, term) {
|
|
874
|
-
return taxonomy === 'tag' ? (store.tagSpelling(term) ?? term) : term;
|
|
875
|
-
}
|
|
876
|
-
function isCarriedTagFeedInAnotherCasing(store, target, canonical, pathname) {
|
|
877
|
-
return (target.kind === 'listing' &&
|
|
878
|
-
target.subject.term?.taxonomy === 'tag' &&
|
|
879
|
-
canonical !== encodePath(pathname) &&
|
|
880
|
-
countListing(store, target.subject) > 0);
|
|
881
|
-
}
|
|
882
|
-
/** How many published documents a listing holds. */
|
|
883
|
-
function countListing(store, subject) {
|
|
884
|
-
const { term, author } = subject;
|
|
885
|
-
if (author !== undefined)
|
|
886
|
-
return store.countByAuthor(author.names);
|
|
887
|
-
if (term === undefined)
|
|
888
|
-
return store.counts().posts;
|
|
889
|
-
return term.taxonomy === 'tag' ? store.countByTag(term.term) : store.countByCategory(term.term);
|
|
890
|
-
}
|
|
891
|
-
/** One page of a listing's documents, newest first. */
|
|
892
|
-
function listListing(store, subject, paging) {
|
|
893
|
-
const { term, author } = subject;
|
|
894
|
-
if (author !== undefined)
|
|
895
|
-
return store.listByAuthor(author.names, paging);
|
|
896
|
-
if (term === undefined)
|
|
897
|
-
return store.listPosts(paging);
|
|
898
|
-
return term.taxonomy === 'tag'
|
|
899
|
-
? store.listByTag(term.term, paging)
|
|
900
|
-
: store.listByCategory(term.term, paging);
|
|
901
|
-
}
|
|
902
|
-
/**
|
|
903
|
-
* The URL of a page of a listing: the home archive's, or a taxonomy's.
|
|
904
|
-
*
|
|
905
|
-
* `root` is where the home listing lives — `/`, or the posts page's permalink
|
|
906
|
-
* on a site that has one — so every link the listing draws, every canonical
|
|
907
|
-
* redirect and the sitemap all spell its pages the same way.
|
|
908
|
-
*/
|
|
909
|
-
function listingHref(subject, index, bases, root = '/') {
|
|
910
|
-
const { term, author } = subject;
|
|
911
|
-
if (author !== undefined)
|
|
912
|
-
return authorHref(author.user.username, index);
|
|
913
|
-
return term === undefined ? listingPageHref(root, index) : termHref(term, index, bases);
|
|
914
|
-
}
|
|
915
|
-
/**
|
|
916
|
-
* The URL of one format of one listing's feed, whichever kind of listing it is.
|
|
917
|
-
*
|
|
918
|
-
* The site's and a taxonomy's hang off the listing root; a person's hangs off
|
|
919
|
-
* their archive, which decision-14 keeps at WordPress's `/author/{username}/`
|
|
920
|
-
* rather than under the listing machinery, because that root is also an actor
|
|
921
|
-
* id.
|
|
922
|
-
*/
|
|
923
|
-
function listingFeedHref(subject, format, bases) {
|
|
924
|
-
return subject.author === undefined
|
|
925
|
-
? feedHref(subject.term, format, bases)
|
|
926
|
-
: authorFeedHref(subject.author.user.username, format);
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* A `/page/N/` segment as a zero-based index. `page/1` parses to the first
|
|
930
|
-
* page, which lives at the listing root, so canonicalisation collapses it.
|
|
931
|
-
*/
|
|
932
|
-
function pageIndex(segment) {
|
|
933
|
-
if (segment === undefined || !/^[0-9]+$/.test(segment))
|
|
934
|
-
return undefined;
|
|
935
|
-
const requested = Number(segment);
|
|
936
|
-
return requested < 1 ? undefined : requested - 1;
|
|
937
|
-
}
|
|
938
|
-
/** One page of a listing, in whichever representation the request settled on. */
|
|
939
|
-
function listing(c, request, representation = selectFromAccept(c, LISTING_REPRESENTATIONS)) {
|
|
940
|
-
const { store, renderer } = c.var;
|
|
941
|
-
const { term, author } = request;
|
|
942
|
-
const size = renderer.pageSize();
|
|
943
|
-
const bases = renderer.taxonomyBases();
|
|
944
|
-
// Where this listing's pages live: the posts page's permalink when the site
|
|
945
|
-
// has one, and the site root otherwise.
|
|
946
|
-
const root = request.document?.permalink ?? '/';
|
|
947
|
-
// WordPress served every feed as a query on the listing before it served one
|
|
948
|
-
// at a path, and the links are still out there. `/?feed=rss2` and
|
|
949
|
-
// `/{base}/x/?feed=atom` land on the feed the listing now has.
|
|
950
|
-
const asked = queryFeedFormat(c);
|
|
951
|
-
if (asked !== undefined)
|
|
952
|
-
return c.redirect(listingFeedHref(request, asked, bases), 301);
|
|
953
|
-
// A taxonomy archive only exists while something carries the term; the home
|
|
954
|
-
// listing and a person's archive exist even with nothing on them.
|
|
955
|
-
const total = countListing(store, request);
|
|
956
|
-
if (term !== undefined && total === 0)
|
|
957
|
-
return notFound(c);
|
|
958
|
-
const href = listingHref(request, request.pageNumber, bases, root);
|
|
959
|
-
const pagination = paginate({
|
|
960
|
-
total,
|
|
961
|
-
size,
|
|
962
|
-
pageNumber: request.pageNumber,
|
|
963
|
-
hrefForPage: (index) => listingHref(request, index, bases, root),
|
|
964
|
-
});
|
|
965
|
-
if (request.pageNumber >= pagination.totalPages)
|
|
966
|
-
return notFound(c);
|
|
967
|
-
if (representation === undefined)
|
|
968
|
-
return notAcceptableResponse(href, LISTING_REPRESENTATIONS);
|
|
969
|
-
const paging = { limit: size, offset: offsetForPage(request.pageNumber, size) };
|
|
970
|
-
const documents = listListing(store, request, paging);
|
|
971
|
-
const title = term?.term ??
|
|
972
|
-
author?.user.profile?.displayName ??
|
|
973
|
-
author?.user.username ??
|
|
974
|
-
request.document?.title ??
|
|
975
|
-
renderer.site().title;
|
|
976
|
-
if (representation === 'markdown' || representation === 'text') {
|
|
977
|
-
return listingMarkdown(c, request, representation, { href, title, pagination, documents });
|
|
978
|
-
}
|
|
979
|
-
const full = wantsFullDocuments(c);
|
|
980
|
-
const body = representation === 'json'
|
|
981
|
-
? documents.map((document) => documentJson(document, { baseUrl: c.var.config.baseUrl, body: full }))
|
|
982
|
-
: renderer.renderListing({
|
|
983
|
-
title,
|
|
984
|
-
url: href,
|
|
985
|
-
documents,
|
|
986
|
-
pagination,
|
|
987
|
-
// And its words go above the posts, which is what a posts page is
|
|
988
|
-
// for: a theme prints `{{ content | safe }}` over the list.
|
|
989
|
-
...(request.document === undefined ? {} : { document: request.document }),
|
|
990
|
-
...(term === undefined ? {} : taxonomyContext(term)),
|
|
991
|
-
...(author === undefined ? {} : authorArchiveContext(author)),
|
|
992
|
-
});
|
|
993
|
-
const validated = representation !== 'html' || !c.var.config.watch;
|
|
994
|
-
return representationResponse({
|
|
995
|
-
body,
|
|
996
|
-
representation,
|
|
997
|
-
href,
|
|
998
|
-
available: LISTING_REPRESENTATIONS,
|
|
999
|
-
...(drawnForSomebody(c, representation) ? { private: true } : {}),
|
|
1000
|
-
...(validated
|
|
1001
|
-
? {
|
|
1002
|
-
etag: representationEtag(representation, listingFingerprint(href, pagination, documents, full)),
|
|
1003
|
-
lastModified: latestModified(documents),
|
|
1004
|
-
}
|
|
1005
|
-
: {}),
|
|
1006
|
-
conditional: conditionalHeaders(c),
|
|
1007
|
-
});
|
|
1008
|
-
}
|
|
1009
|
-
function listingMarkdown(c, request, representation, page) {
|
|
1010
|
-
const { next, previous } = page.pagination.href;
|
|
1011
|
-
const home = frontPages(c).home;
|
|
1012
|
-
const latestPosts = request.term === undefined && request.author === undefined;
|
|
1013
|
-
const description = request.document?.description ?? (latestPosts ? c.var.renderer.site().tagline : undefined);
|
|
1014
|
-
const body = llmsListingTxt({
|
|
1015
|
-
title: page.title,
|
|
1016
|
-
description,
|
|
1017
|
-
posts: page.documents.map((document) => llmsEntry(c, document, home)),
|
|
1018
|
-
newer: previous === null ? undefined : representationHref(previous, 'markdown'),
|
|
1019
|
-
older: next === null ? undefined : representationHref(next, 'markdown'),
|
|
1020
|
-
}, c.var.config.baseUrl);
|
|
1021
|
-
return representationResponse({
|
|
1022
|
-
body,
|
|
1023
|
-
representation,
|
|
1024
|
-
href: page.href,
|
|
1025
|
-
available: LISTING_REPRESENTATIONS,
|
|
1026
|
-
etag: representationEtag(representation, body),
|
|
1027
|
-
lastModified: latestModified(page.documents),
|
|
1028
|
-
conditional: conditionalHeaders(c),
|
|
1029
|
-
});
|
|
1030
|
-
}
|
|
1031
|
-
function documentMarkdown(document) {
|
|
1032
|
-
const title = document.title.replace(/\s+/g, ' ').trim();
|
|
1033
|
-
if (title === '' || /^#[ \t]/.test(document.body.trimStart()))
|
|
1034
|
-
return serializeDocument(document);
|
|
1035
|
-
return serializeDocument({ ...document, body: `# ${title}\n\n${document.body}` });
|
|
1036
|
-
}
|
|
1037
|
-
/**
|
|
1038
|
-
* One page of search results, in whichever representation the request settled
|
|
1039
|
-
* on.
|
|
1040
|
-
*
|
|
1041
|
-
* What it finds is what the listings would show: the index holds the search to
|
|
1042
|
-
* published, untrashed, already-due documents, so a draft cannot be found by
|
|
1043
|
-
* its words any more than it can be found by its URL. A search with no query
|
|
1044
|
-
* is the page with the form on it and nothing found, rather than an error,
|
|
1045
|
-
* because that is where a link to the search from a theme lands. A page past
|
|
1046
|
-
* the last one 404s, as it does on a listing.
|
|
1047
|
-
*/
|
|
1048
|
-
function search(c, representation) {
|
|
1049
|
-
const { store, renderer, config } = c.var;
|
|
1050
|
-
const query = searchQuery(c.req.query(SEARCH_QUERY_PARAM));
|
|
1051
|
-
const pageNumber = searchPageIndex(c.req.query(SEARCH_PAGE_PARAM));
|
|
1052
|
-
if (pageNumber === undefined)
|
|
1053
|
-
return notFound(c);
|
|
1054
|
-
const size = renderer.pageSize();
|
|
1055
|
-
const pagination = paginate({
|
|
1056
|
-
total: store.countSearch(query),
|
|
1057
|
-
size,
|
|
1058
|
-
pageNumber,
|
|
1059
|
-
hrefForPage: (index) => searchHref(query, index),
|
|
1060
|
-
});
|
|
1061
|
-
if (pageNumber >= pagination.totalPages)
|
|
1062
|
-
return notFound(c);
|
|
1063
|
-
const href = searchHref(query, pageNumber);
|
|
1064
|
-
if (representation === undefined)
|
|
1065
|
-
return notAcceptableResponse(href, SEARCH_REPRESENTATIONS);
|
|
1066
|
-
const hits = store.search(query, { limit: size, offset: offsetForPage(pageNumber, size) });
|
|
1067
|
-
const documents = hits.map((hit) => hit.document);
|
|
1068
|
-
const full = wantsFullDocuments(c);
|
|
1069
|
-
const body = representation === 'json'
|
|
1070
|
-
? searchJson({ query, hits, pagination, baseUrl: config.baseUrl, body: full })
|
|
1071
|
-
: renderer.renderSearch({ query, url: href, hits, pagination });
|
|
1072
|
-
const validated = representation !== 'html' || !config.watch;
|
|
1073
|
-
return representationResponse({
|
|
1074
|
-
body,
|
|
1075
|
-
representation,
|
|
1076
|
-
href,
|
|
1077
|
-
// The alternates are spelled here rather than by the negotiator, because
|
|
1078
|
-
// they carry the query and a listing's never have one to carry.
|
|
1079
|
-
available: [representation],
|
|
1080
|
-
links: SEARCH_REPRESENTATIONS.filter((other) => other !== representation).map((other) => `<${searchHref(query, pageNumber, other)}>; rel="alternate"; type="${MEDIA_TYPES[other]}"`),
|
|
1081
|
-
...(drawnForSomebody(c, representation) ? { private: true } : {}),
|
|
1082
|
-
...(validated
|
|
1083
|
-
? {
|
|
1084
|
-
etag: representationEtag(representation, listingFingerprint(href, pagination, documents, full)),
|
|
1085
|
-
lastModified: latestModified(documents),
|
|
1086
|
-
}
|
|
1087
|
-
: {}),
|
|
1088
|
-
conditional: conditionalHeaders(c),
|
|
1089
|
-
});
|
|
1090
|
-
}
|
|
1091
|
-
/**
|
|
1092
|
-
* Whether this is a page drawn for a signed-in reader, which carries the admin
|
|
1093
|
-
* bar (TASK-183) and so must never be answered with a 304 off the validators of
|
|
1094
|
-
* the copy an anonymous visit left in their browser.
|
|
1095
|
-
*/
|
|
1096
|
-
function drawnForSomebody(c, representation) {
|
|
1097
|
-
return representation === 'html' && c.var.signedIn !== undefined;
|
|
1098
|
-
}
|
|
1099
|
-
/**
|
|
1100
|
-
* Whether the request asked for whole documents rather than summaries.
|
|
1101
|
-
*
|
|
1102
|
-
* Anything but an explicit denial counts, so `?full`, `?full=1` and `?full=yes`
|
|
1103
|
-
* all mean the same thing to someone typing a URL by hand.
|
|
1104
|
-
*/
|
|
1105
|
-
function wantsFullDocuments(c) {
|
|
1106
|
-
const value = c.req.query('full');
|
|
1107
|
-
return value !== undefined && value !== '0' && value.toLowerCase() !== 'false';
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* What a listing page is made of, as one string to hash.
|
|
1111
|
-
*
|
|
1112
|
-
* The documents on the page are not the whole story: the same two posts on a
|
|
1113
|
-
* differently sized archive are a different page, and a summary is not the
|
|
1114
|
-
* body, so the pagination and the `full` flag are in the fingerprint too.
|
|
1115
|
-
*/
|
|
1116
|
-
function listingFingerprint(href, pagination, documents, full) {
|
|
1117
|
-
return [
|
|
1118
|
-
href,
|
|
1119
|
-
`${String(pagination.pageNumber)}/${String(pagination.totalPages)}/${String(pagination.total)}`,
|
|
1120
|
-
full ? 'full' : 'summary',
|
|
1121
|
-
...documents.map((document) => document.hash),
|
|
1122
|
-
].join('\n');
|
|
1123
|
-
}
|
|
1124
|
-
/**
|
|
1125
|
-
* The site's feed, or one archive's, in one format.
|
|
1126
|
-
*
|
|
1127
|
-
* A term with nothing published under it 404s exactly as its archive does: a
|
|
1128
|
-
* feed reader should be told the URL is wrong rather than handed an empty feed
|
|
1129
|
-
* it will poll forever.
|
|
1130
|
-
*/
|
|
1131
|
-
function feed(c, format, subject) {
|
|
1132
|
-
const { store, renderer, config } = c.var;
|
|
1133
|
-
const site = renderer.site();
|
|
1134
|
-
const bases = renderer.taxonomyBases();
|
|
1135
|
-
const { term, author } = subject;
|
|
1136
|
-
if (term !== undefined && countListing(store, subject) === 0) {
|
|
1137
|
-
// A subscriber to a renamed archive's feed follows it to the new one
|
|
1138
|
-
// rather than being dropped, exactly as a reader of the archive does.
|
|
1139
|
-
const moved = movedTerm(c, term);
|
|
1140
|
-
if (moved === undefined)
|
|
1141
|
-
return notFound(c);
|
|
1142
|
-
return c.redirect(feedHref(moved, format, bases), 301);
|
|
1143
|
-
}
|
|
1144
|
-
const documents = listListing(store, subject, { limit: feedSize(site) });
|
|
1145
|
-
const href = listingHref(subject, 0, bases);
|
|
1146
|
-
// What the feed calls itself: the site, and then the term or the person it
|
|
1147
|
-
// is about, so a reader subscribed to several of a site's feeds can tell
|
|
1148
|
-
// them apart in a list.
|
|
1149
|
-
const about = term?.term ?? author?.user.profile?.displayName ?? author?.user.username;
|
|
1150
|
-
const source = {
|
|
1151
|
-
site,
|
|
1152
|
-
users: listUsers(config.dataDir),
|
|
1153
|
-
documents,
|
|
1154
|
-
title: about === undefined ? site.title : `${site.title}: ${about}`,
|
|
1155
|
-
href,
|
|
1156
|
-
feedHref: listingFeedHref(subject, format, bases),
|
|
1157
|
-
baseUrl: config.baseUrl,
|
|
1158
|
-
// Only RSS carries the comment pointers; the other two formats have no
|
|
1159
|
-
// vocabulary for them, and counting for a feed that cannot say the number
|
|
1160
|
-
// would be a query per item for nothing.
|
|
1161
|
-
...(format === 'rss' ? { commentCounts: c.var.conversation.counts(documents) } : {}),
|
|
1162
|
-
altTexts: readAltTexts(config.contentDir),
|
|
1163
|
-
replyContext: (target) => c.var.replyContexts.read(target),
|
|
1164
|
-
};
|
|
1165
|
-
return feedResponse({ format, source, conditional: conditionalHeaders(c) });
|
|
1166
|
-
}
|
|
1167
|
-
/**
|
|
1168
|
-
* A post's or page's comments, or the whole site's, as RSS 2.0.
|
|
1169
|
-
*
|
|
1170
|
-
* A document with no replies answers an empty feed rather than a 404: it
|
|
1171
|
-
* exists, and a reader that subscribed before anybody answered should keep
|
|
1172
|
-
* polling. Which documents have a feed at all is {@link parseFeedPath}'s to say.
|
|
1173
|
-
*/
|
|
1174
|
-
function comments(c, document) {
|
|
1175
|
-
const { conversation, renderer, config } = c.var;
|
|
1176
|
-
const site = renderer.site();
|
|
1177
|
-
const limit = feedSize(site);
|
|
1178
|
-
// The same reading the page is drawn from, which is the point: a subscriber
|
|
1179
|
-
// to a post's comments and a reader who scrolls to the bottom of it are
|
|
1180
|
-
// looking at one conversation. A post's own feed hands the builder entries
|
|
1181
|
-
// with no post attached, and so its items name no post: there, every item
|
|
1182
|
-
// answers the same one.
|
|
1183
|
-
const found = feedComments(document === undefined ? conversation.latest(limit) : spokenIn(conversation.thread(document)), {
|
|
1184
|
-
baseUrl: config.baseUrl,
|
|
1185
|
-
limit,
|
|
1186
|
-
cited: (url) => c.var.replyContexts.read(url),
|
|
1187
|
-
post: document,
|
|
1188
|
-
});
|
|
1189
|
-
const source = {
|
|
1190
|
-
site,
|
|
1191
|
-
comments: found,
|
|
1192
|
-
title: document === undefined
|
|
1193
|
-
? `${site.title}: comments`
|
|
1194
|
-
: `${COMMENTS_TITLE_PREFIX}${postLabel(document, (url) => c.var.replyContexts.read(url))}`,
|
|
1195
|
-
href: document?.permalink ?? '/',
|
|
1196
|
-
feedHref: commentsFeedHref(document),
|
|
1197
|
-
baseUrl: config.baseUrl,
|
|
1198
|
-
};
|
|
1199
|
-
return commentsFeedResponse(source, conditionalHeaders(c));
|
|
1200
|
-
}
|
|
1201
|
-
/**
|
|
1202
|
-
* The feed of one item's direct replies (TASK-324): a post's or page's, or a
|
|
1203
|
-
* reply's, so a reader can walk a thread one level at a time through
|
|
1204
|
-
* `source:comments`. An item nobody answered has an empty feed; a segment
|
|
1205
|
-
* naming nothing a reader can see 404s, as does one on a document not showing
|
|
1206
|
-
* its conversation, by the rule `{permalink}feed/` follows.
|
|
1207
|
-
*/
|
|
1208
|
-
function repliesFeed(c, segment) {
|
|
1209
|
-
const { conversation, renderer, config } = c.var;
|
|
1210
|
-
const found = conversation.repliesTo(segment);
|
|
1211
|
-
if (found === undefined || !showsConversation(c, found.post))
|
|
1212
|
-
return notFound(c);
|
|
1213
|
-
const site = renderer.site();
|
|
1214
|
-
const cited = (url) => c.var.replyContexts.read(url);
|
|
1215
|
-
const label = postLabel(found.post, cited);
|
|
1216
|
-
const source = {
|
|
1217
|
-
site,
|
|
1218
|
-
comments: feedComments(found.replies, {
|
|
1219
|
-
baseUrl: config.baseUrl,
|
|
1220
|
-
limit: feedSize(site),
|
|
1221
|
-
cited,
|
|
1222
|
-
post: found.post,
|
|
1223
|
-
}),
|
|
1224
|
-
title: found.reply === null
|
|
1225
|
-
? `Replies to: ${label}`
|
|
1226
|
-
: `Replies to ${found.reply.author.name} on ${label}`,
|
|
1227
|
-
href: found.reply?.url ?? found.post.permalink,
|
|
1228
|
-
feedHref: repliesFeedPath(segment),
|
|
1229
|
-
baseUrl: config.baseUrl,
|
|
1230
|
-
};
|
|
1231
|
-
return commentsFeedResponse(source, conditionalHeaders(c));
|
|
1232
|
-
}
|
|
1233
|
-
/**
|
|
1234
|
-
* One native comment on a page of its own (TASK-318), answering as its post
|
|
1235
|
-
* would: 410 once the post is deleted, and 404 while it is not served or not
|
|
1236
|
-
* showing its conversation. It is never listed anywhere, so it is noindex.
|
|
1237
|
-
*/
|
|
1238
|
-
function commentPage(c, id) {
|
|
1239
|
-
const { conversation, renderer, store } = c.var;
|
|
1240
|
-
const found = conversation.comment(id);
|
|
1241
|
-
if (found === undefined)
|
|
1242
|
-
return notFound(c);
|
|
1243
|
-
const now = store.now();
|
|
1244
|
-
if (isGone(found.post, now))
|
|
1245
|
-
return gone(c);
|
|
1246
|
-
if (!isServed(found.post, now) || !showsConversation(c, found.post))
|
|
1247
|
-
return notFound(c);
|
|
1248
|
-
return c.html(renderer.renderComment(found), 200, { 'x-robots-tag': 'noindex' });
|
|
1249
|
-
}
|
|
1250
|
-
/**
|
|
1251
|
-
* The sitemap, or one of its children once the site is too big for one file.
|
|
1252
|
-
*
|
|
1253
|
-
* A child that does not exist 404s through the theme like any other missing
|
|
1254
|
-
* URL: `/sitemap-1.xml` names nothing at all on a site whose whole sitemap
|
|
1255
|
-
* fits, and a crawler asking for one should be told so rather than handed an
|
|
1256
|
-
* empty file it would come back to.
|
|
1257
|
-
*/
|
|
1258
|
-
function sitemap(c, page) {
|
|
1259
|
-
const response = sitemapResponse({
|
|
1260
|
-
urls: sitemapUrls(c),
|
|
1261
|
-
baseUrl: c.var.config.baseUrl,
|
|
1262
|
-
page,
|
|
1263
|
-
conditional: conditionalHeaders(c),
|
|
1264
|
-
});
|
|
1265
|
-
return response ?? notFound(c);
|
|
1266
|
-
}
|
|
1267
|
-
/**
|
|
1268
|
-
* Every URL the public site publishes, in the order the sitemap lists them:
|
|
1269
|
-
* the home archive's pages, then every post and page, then every tag archive
|
|
1270
|
-
* and every category archive with their own pages.
|
|
1271
|
-
*
|
|
1272
|
-
* Everything here is spelled by the same functions the site's own links go
|
|
1273
|
-
* through — {@link homeHref}, the permalinks, {@link termHref} — and drawn
|
|
1274
|
-
* from the same queries the listings use, so a sitemap can never advertise a
|
|
1275
|
-
* URL the site does not serve. Nothing hidden reaches it either: the index's
|
|
1276
|
-
* listing queries already exclude drafts, the trash, posts whose date has not
|
|
1277
|
-
* arrived and unlisted documents, and {@link isListed} is asked again with the
|
|
1278
|
-
* store's own clock so the two answers cannot drift apart.
|
|
1279
|
-
*/
|
|
1280
|
-
function sitemapUrls(c) {
|
|
1281
|
-
const { store, renderer } = c.var;
|
|
1282
|
-
const now = store.now();
|
|
1283
|
-
const size = renderer.pageSize();
|
|
1284
|
-
const bases = renderer.taxonomyBases();
|
|
1285
|
-
const pages = frontPages(c);
|
|
1286
|
-
const urls = [];
|
|
1287
|
-
/** The pages of one listing, each dated by the newest document on it. */
|
|
1288
|
-
const listingPages = (documents, hrefForPage) => {
|
|
1289
|
-
const totalPages = Math.max(1, Math.ceil(documents.length / size));
|
|
1290
|
-
for (let index = 0; index < totalPages; index += 1) {
|
|
1291
|
-
const onPage = documents.slice(index * size, (index + 1) * size);
|
|
1292
|
-
urls.push({ loc: hrefForPage(index), lastmod: latestModified(onPage) });
|
|
1293
|
-
}
|
|
1294
|
-
};
|
|
1295
|
-
const posts = store.listPosts().filter((document) => isListed(document, now));
|
|
1296
|
-
// The listing's pages, wherever it lives: under `/`, under the posts page,
|
|
1297
|
-
// or nowhere at all on a site whose homepage is a page and which named no
|
|
1298
|
-
// posts page. Its first page is that root, which is why `/` and the posts
|
|
1299
|
-
// page's own URL are listed here rather than with the documents.
|
|
1300
|
-
const root = listingRoot(pages);
|
|
1301
|
-
if (root !== undefined)
|
|
1302
|
-
listingPages(posts, (index) => listingPageHref(root, index));
|
|
1303
|
-
// And `/` itself when it is a page rather than the listing: the front page
|
|
1304
|
-
// is published at one URL, and it is this one.
|
|
1305
|
-
if (pages.home !== undefined)
|
|
1306
|
-
urls.push({ loc: '/', lastmod: lastModifiedOf(pages.home) });
|
|
1307
|
-
const documents = store
|
|
1308
|
-
.listAll({ type: 'page', draft: false, trashed: false, scheduled: false })
|
|
1309
|
-
.filter((document) => isListed(document, now));
|
|
1310
|
-
for (const document of [...posts, ...documents]) {
|
|
1311
|
-
// The homepage answers at `/` and redirects from its own permalink, and
|
|
1312
|
-
// the posts page is the listing's first page, which is already listed:
|
|
1313
|
-
// neither is advertised twice.
|
|
1314
|
-
if (document.path === pages.home?.path || document.path === pages.posts?.path)
|
|
1315
|
-
continue;
|
|
1316
|
-
urls.push({ loc: document.permalink, lastmod: lastModifiedOf(document) });
|
|
1317
|
-
}
|
|
1318
|
-
// A taxonomy archive exists only while something public carries the term,
|
|
1319
|
-
// which is exactly what these two queries report.
|
|
1320
|
-
for (const { tag } of store.listTags()) {
|
|
1321
|
-
const term = { taxonomy: 'tag', term: tag };
|
|
1322
|
-
listingPages(store.listByTag(tag), (index) => termHref(term, index, bases));
|
|
1323
|
-
}
|
|
1324
|
-
for (const { category } of store.listCategories()) {
|
|
1325
|
-
const term = { taxonomy: 'category', term: category };
|
|
1326
|
-
listingPages(store.listByCategory(category), (index) => termHref(term, index, bases));
|
|
1327
|
-
}
|
|
1328
|
-
return urls;
|
|
1329
|
-
}
|
|
1330
|
-
/**
|
|
1331
|
-
* What a generated `/llms.txt` lists: every public page by title, then the
|
|
1332
|
-
* posts the feeds carry, newest first, each linked to its Markdown.
|
|
1333
|
-
*
|
|
1334
|
-
* The homepage is listed at `/`, which is where it is published; its own
|
|
1335
|
-
* permalink redirects there.
|
|
1336
|
-
*/
|
|
1337
|
-
function llmsIndex(c) {
|
|
1338
|
-
const { store, renderer } = c.var;
|
|
1339
|
-
const site = renderer.site();
|
|
1340
|
-
const now = store.now();
|
|
1341
|
-
const home = frontPages(c).home;
|
|
1342
|
-
const entry = (document) => llmsEntry(c, document, home);
|
|
1343
|
-
const pages = store
|
|
1344
|
-
.listAll({ type: 'page', draft: false, trashed: false, scheduled: false })
|
|
1345
|
-
.filter((document) => isListed(document, now))
|
|
1346
|
-
.sort((a, b) => llmsLabel(c, a).localeCompare(llmsLabel(c, b)));
|
|
1347
|
-
const posts = store
|
|
1348
|
-
.listPosts({ limit: feedSize(site) })
|
|
1349
|
-
.filter((document) => isListed(document, now));
|
|
1350
|
-
return {
|
|
1351
|
-
title: site.title,
|
|
1352
|
-
description: site.tagline ?? '',
|
|
1353
|
-
pages: pages.map(entry),
|
|
1354
|
-
posts: posts.map(entry),
|
|
1355
|
-
};
|
|
1356
|
-
}
|
|
1357
|
-
function llmsLabel(c, document) {
|
|
1358
|
-
return postLabel(document, (url) => c.var.replyContexts.read(url));
|
|
1359
|
-
}
|
|
1360
|
-
function llmsEntry(c, document, home) {
|
|
1361
|
-
return {
|
|
1362
|
-
title: llmsLabel(c, document),
|
|
1363
|
-
href: representationHref(document.path === home?.path ? '/' : encodePath(document.permalink), 'markdown'),
|
|
1364
|
-
description: document.description,
|
|
1365
|
-
lastModified: lastModifiedOf(document),
|
|
1366
|
-
};
|
|
1367
|
-
}
|
|
1368
|
-
/**
|
|
1369
|
-
* A file from the theme's `static/` directory, the site's copy first.
|
|
1370
|
-
*
|
|
1371
|
-
* Assets are cacheable and validated, so a browser that already has one pays a
|
|
1372
|
-
* conditional request rather than a download. A URL whose `v` is the hash of
|
|
1373
|
-
* the bytes being served, which is what the `asset` filter writes, is cached
|
|
1374
|
-
* for a year without revalidation. Any other `v`, or none, gets the short
|
|
1375
|
-
* lifetime: a stale hash from a cached page still gets the file, but the
|
|
1376
|
-
* current bytes are never pinned under a name that describes older ones.
|
|
1377
|
-
*/
|
|
1378
|
-
function themeAsset(c) {
|
|
1379
|
-
const relative = requestPath(c).slice(THEME_ASSET_PREFIX.length);
|
|
1380
|
-
const asset = findThemeAsset(relative, c.var.renderer.themeDirs());
|
|
1381
|
-
if (asset === undefined)
|
|
1382
|
-
return notFound(c);
|
|
1383
|
-
const fingerprinted = c.req.query(ASSET_VERSION_PARAM) === assetVersion(asset);
|
|
1384
|
-
const options = fingerprinted ? IMMUTABLE_ASSET : {};
|
|
1385
|
-
return matchesEtag(c.req.header('if-none-match'), asset.etag)
|
|
1386
|
-
? assetNotModified(asset, options)
|
|
1387
|
-
: assetResponse(asset, options);
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* One derived copy of an upload, generated on the spot if it is not there.
|
|
1391
|
-
*
|
|
1392
|
-
* The directory these live in is disposable (decision-9): deleting it costs
|
|
1393
|
-
* the next reader of each picture one encode and costs the site nothing else,
|
|
1394
|
-
* which is what this handler is for. A width or a format the site does not
|
|
1395
|
-
* offer is a 404 and encodes nothing, so the URL space cannot be used to make
|
|
1396
|
-
* the server work.
|
|
1397
|
-
*
|
|
1398
|
-
* A variant is cached for a year without revalidation only when its `v` is
|
|
1399
|
-
* the hash of the upload it was derived from, which is what the page markup
|
|
1400
|
-
* and the icon links write. The name alone cannot promise that: deleting an
|
|
1401
|
-
* upload frees its name for different bytes. Any other `v`, or none, as in a
|
|
1402
|
-
* page cached before URLs carried one, still gets the file, for a day.
|
|
1403
|
-
*/
|
|
1404
|
-
async function imageVariant(c) {
|
|
1405
|
-
const relative = decodeVariantPath(requestPath(c).slice(VARIANT_ASSET_PREFIX.length));
|
|
1406
|
-
const asset = await findImageVariant(c.var.config, relative);
|
|
1407
|
-
if (asset === undefined)
|
|
1408
|
-
return notFound(c);
|
|
1409
|
-
const source = relative.slice(0, relative.lastIndexOf('/'));
|
|
1410
|
-
const version = sourceVersion(c.var.config, source);
|
|
1411
|
-
const fingerprinted = version !== undefined && c.req.query(ASSET_VERSION_PARAM) === version;
|
|
1412
|
-
const options = fingerprinted ? IMMUTABLE_ASSET : { maxAge: UPLOAD_ASSET_MAX_AGE };
|
|
1413
|
-
return matchesEtag(c.req.header('if-none-match'), asset.etag)
|
|
1414
|
-
? assetNotModified(asset, options)
|
|
1415
|
-
: assetResponse(asset, options);
|
|
1416
|
-
}
|
|
1417
|
-
/**
|
|
1418
|
-
* `/favicon.ico`, derived from the site's icon beside its other icons.
|
|
1419
|
-
*
|
|
1420
|
-
* Its URL carries no version, so it is cached like an upload rather than for
|
|
1421
|
-
* a year: a site that changes its icon is seen with the new one within a day.
|
|
1422
|
-
*/
|
|
1423
|
-
async function favicon(c) {
|
|
1424
|
-
const source = siteIconSource(c.var.config, iconSetting(c.var.renderer.site()));
|
|
1425
|
-
if (source === undefined)
|
|
1426
|
-
return notFound(c);
|
|
1427
|
-
const asset = await findImageVariant(c.var.config, `${source}/${FAVICON_FILE}`);
|
|
1428
|
-
if (asset === undefined)
|
|
1429
|
-
return notFound(c);
|
|
1430
|
-
const options = { maxAge: UPLOAD_ASSET_MAX_AGE };
|
|
1431
|
-
return matchesEtag(c.req.header('if-none-match'), asset.etag)
|
|
1432
|
-
? assetNotModified(asset, options)
|
|
1433
|
-
: assetResponse(asset, options);
|
|
1434
|
-
}
|
|
1435
|
-
/** A request path as a path on disk: percent-encoding off, segment by segment. */
|
|
1436
|
-
function decodeVariantPath(relative) {
|
|
1437
|
-
try {
|
|
1438
|
-
return relative.split('/').map(decodeURIComponent).join('/');
|
|
1439
|
-
}
|
|
1440
|
-
catch {
|
|
1441
|
-
return relative;
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
/**
|
|
1445
|
-
* A file from `content/uploads/`, at the URL Eleventy's passthrough copy puts
|
|
1446
|
-
* it at.
|
|
1447
|
-
*
|
|
1448
|
-
* Uploads are not documents — the index never sees them — so they are served
|
|
1449
|
-
* as files, with the same validators and the same traversal check the theme's
|
|
1450
|
-
* assets get. The cache lifetime is longer than a theme asset's because an
|
|
1451
|
-
* upload's URL names one set of bytes: the upload endpoint never overwrites,
|
|
1452
|
-
* it suffixes.
|
|
1453
|
-
*/
|
|
1454
|
-
function upload(c) {
|
|
1455
|
-
const relative = requestPath(c).slice(UPLOAD_ASSET_PREFIX.length);
|
|
1456
|
-
const asset = findUpload(relative, c.var.config.contentDir);
|
|
1457
|
-
if (asset === undefined)
|
|
1458
|
-
return notFound(c);
|
|
1459
|
-
const options = { maxAge: UPLOAD_ASSET_MAX_AGE };
|
|
1460
|
-
if (matchesEtag(c.req.header('if-none-match'), asset.etag)) {
|
|
1461
|
-
return assetNotModified(asset, options);
|
|
1462
|
-
}
|
|
1463
|
-
const part = assetRangeResponse(asset, c.req.header('range'), c.req.header('if-range'), options);
|
|
1464
|
-
const whole = part ?? assetResponse(asset, options);
|
|
1465
|
-
whole.headers.set('accept-ranges', 'bytes');
|
|
1466
|
-
return whole;
|
|
1467
|
-
}
|
|
1468
|
-
/** The URL of a page of the home listing, by zero-based index. */
|
|
1469
|
-
export function homeHref(index) {
|
|
1470
|
-
return listingPageHref('/', index);
|
|
1471
|
-
}
|
|
1472
|
-
/**
|
|
1473
|
-
* The URL of a page of the listing that hangs off `root`, by zero-based index.
|
|
1474
|
-
*
|
|
1475
|
-
* The first page is the root itself: `/` or the posts page's own permalink,
|
|
1476
|
-
* which is what makes a posts page one URL rather than two.
|
|
1477
|
-
*/
|
|
1478
|
-
export function listingPageHref(root, index) {
|
|
1479
|
-
return index === 0 ? root : `${root}${PAGE_SEGMENT}/${String(index + 1)}/`;
|
|
1480
|
-
}
|
|
1481
|
-
/**
|
|
1482
|
-
* What the theme is told about a taxonomy archive: the term under the name of
|
|
1483
|
-
* its taxonomy, and the layout that taxonomy uses.
|
|
1484
|
-
*/
|
|
1485
|
-
function taxonomyContext(term) {
|
|
1486
|
-
return term.taxonomy === 'tag'
|
|
1487
|
-
? { tag: term.term, template: TEMPLATES.tag }
|
|
1488
|
-
: { category: term.term, template: TEMPLATES.category };
|
|
1489
|
-
}
|
|
1490
|
-
/**
|
|
1491
|
-
* What the theme is told about an author archive: the person's profile under
|
|
1492
|
-
* `author`, the same shape a post's byline gets, and the layout an archive of
|
|
1493
|
-
* theirs uses.
|
|
1494
|
-
*
|
|
1495
|
-
* One shape for both places is the point. A theme that knows how to print a
|
|
1496
|
-
* byline already knows how to print the heading of the archive that byline
|
|
1497
|
-
* links to, and neither has to ask whether the site has users.
|
|
1498
|
-
*/
|
|
1499
|
-
function authorArchiveContext(author) {
|
|
1500
|
-
return { author: profileContext(author.user), template: TEMPLATES.author };
|
|
1501
|
-
}
|
|
1502
|
-
/**
|
|
1503
|
-
* The URL of a feed: the whole site's, or one taxonomy archive's.
|
|
1504
|
-
*
|
|
1505
|
-
* WordPress's layout, so a subscriber of a migrated site keeps polling the URL
|
|
1506
|
-
* they already hold: `/feed/` is RSS 2.0, `/feed/atom/` and `/feed/json/` are
|
|
1507
|
-
* its siblings, and an archive's feeds hang off the archive.
|
|
1508
|
-
*/
|
|
1509
|
-
export function feedHref(term, format, bases) {
|
|
1510
|
-
return feedPathUnder(listingHref({ term }, 0, bases), format);
|
|
1511
|
-
}
|
|
1512
|
-
/**
|
|
1513
|
-
* Where the site's comments feed lives, and where one document's does.
|
|
1514
|
-
*
|
|
1515
|
-
* WordPress's URLs, so a site migrated from it keeps both: the whole site's
|
|
1516
|
-
* comments at `/comments/feed/`, and a document's under its own permalink. There
|
|
1517
|
-
* is one format, RSS 2.0, because that is what a comments feed is read in.
|
|
1518
|
-
*/
|
|
1519
|
-
export function commentsFeedHref(document) {
|
|
1520
|
-
return commentsFeedPath(document === undefined ? undefined : encodePath(document.permalink));
|
|
1521
|
-
}
|
|
1522
|
-
function gone(c) {
|
|
1523
|
-
return c.html(c.var.renderer.renderGone(requestPath(c)), 410);
|
|
1524
|
-
}
|
|
1525
|
-
/** The theme's 404 page. */
|
|
1526
|
-
export function notFound(c) {
|
|
1527
|
-
return c.html(c.var.renderer.renderNotFound(requestPath(c)), 404);
|
|
1528
|
-
}
|
|
1529
|
-
/**
|
|
1530
|
-
* The requested path, percent-decoded, because permalinks are stored decoded.
|
|
1531
|
-
* A path whose escapes are malformed is used as it arrived, which resolves to
|
|
1532
|
-
* nothing and so 404s.
|
|
1533
|
-
*/
|
|
1534
|
-
export function requestPath(c) {
|
|
1535
|
-
const { pathname } = new URL(c.req.url);
|
|
1536
|
-
try {
|
|
1537
|
-
return decodeURIComponent(pathname);
|
|
1538
|
-
}
|
|
1539
|
-
catch {
|
|
1540
|
-
return pathname;
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
/** A decoded path back into one safe to put in a `Location` header. */
|
|
1544
|
-
function encodePath(pathname) {
|
|
1545
|
-
return pathname
|
|
1546
|
-
.split('/')
|
|
1547
|
-
.map((segment) => encodeURIComponent(segment))
|
|
1548
|
-
.join('/');
|
|
284
|
+
const moved = { taxonomy: asked.term.taxonomy, term: to };
|
|
285
|
+
return feedPath === undefined
|
|
286
|
+
? termHref(moved, asked.pageNumber, view.bases)
|
|
287
|
+
: feedHref(moved, feedPath.format, view.bases);
|
|
1549
288
|
}
|
|
1550
289
|
//# sourceMappingURL=routes.js.map
|