@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.
Files changed (1393) hide show
  1. package/README.md +26 -4214
  2. package/admin/pages/settings/privacy.njk +1 -1
  3. package/dist/access-log.d.ts +2 -10
  4. package/dist/access-log.d.ts.map +1 -1
  5. package/dist/access-log.js +1 -1
  6. package/dist/access-log.js.map +1 -1
  7. package/dist/{web → admin}/admin-bar.d.ts +3 -2
  8. package/dist/admin/admin-bar.d.ts.map +1 -0
  9. package/dist/{web → admin}/admin-bar.js +20 -17
  10. package/dist/admin/admin-bar.js.map +1 -0
  11. package/dist/{indieauth → admin}/app-activity.d.ts +2 -2
  12. package/dist/admin/app-activity.d.ts.map +1 -0
  13. package/dist/{indieauth → admin}/app-activity.js +5 -5
  14. package/dist/admin/app-activity.js.map +1 -0
  15. package/dist/admin/appearance.d.ts +3 -3
  16. package/dist/admin/appearance.d.ts.map +1 -1
  17. package/dist/admin/appearance.js +12 -6
  18. package/dist/admin/appearance.js.map +1 -1
  19. package/dist/admin/assets.d.ts +1 -8
  20. package/dist/admin/assets.d.ts.map +1 -1
  21. package/dist/admin/assets.js +2 -9
  22. package/dist/admin/assets.js.map +1 -1
  23. package/dist/admin/comments.d.ts +2 -2
  24. package/dist/admin/comments.d.ts.map +1 -1
  25. package/dist/admin/comments.js +16 -17
  26. package/dist/admin/comments.js.map +1 -1
  27. package/dist/{indieauth → admin}/connected-apps.d.ts +2 -2
  28. package/dist/admin/connected-apps.d.ts.map +1 -0
  29. package/dist/{indieauth → admin}/connected-apps.js +18 -19
  30. package/dist/admin/connected-apps.js.map +1 -0
  31. package/dist/admin/credentials.js +1 -1
  32. package/dist/admin/credentials.js.map +1 -1
  33. package/dist/admin/dev-mode.d.ts +1 -1
  34. package/dist/admin/dev-mode.d.ts.map +1 -1
  35. package/dist/admin/documents.d.ts +16 -301
  36. package/dist/admin/documents.d.ts.map +1 -1
  37. package/dist/admin/documents.js +74 -1032
  38. package/dist/admin/documents.js.map +1 -1
  39. package/dist/admin/editor-actions.d.ts +3 -2
  40. package/dist/admin/editor-actions.d.ts.map +1 -1
  41. package/dist/admin/editor-actions.js +8 -8
  42. package/dist/admin/editor-actions.js.map +1 -1
  43. package/dist/admin/editor-fields.d.ts +45 -0
  44. package/dist/admin/editor-fields.d.ts.map +1 -0
  45. package/dist/admin/editor-fields.js +71 -0
  46. package/dist/admin/editor-fields.js.map +1 -0
  47. package/dist/admin/editor-layout.d.ts +2 -10
  48. package/dist/admin/editor-layout.d.ts.map +1 -1
  49. package/dist/admin/editor-layout.js +1 -1
  50. package/dist/admin/editor-layout.js.map +1 -1
  51. package/dist/admin/federation.d.ts +5 -5
  52. package/dist/admin/federation.d.ts.map +1 -1
  53. package/dist/admin/federation.js +16 -18
  54. package/dist/admin/federation.js.map +1 -1
  55. package/dist/admin/flash.d.ts +2 -2
  56. package/dist/admin/flash.d.ts.map +1 -1
  57. package/dist/admin/headers.d.ts +1 -1
  58. package/dist/admin/headers.d.ts.map +1 -1
  59. package/dist/admin/headers.js +1 -1
  60. package/dist/admin/headers.js.map +1 -1
  61. package/dist/admin/index.d.ts +38 -20
  62. package/dist/admin/index.d.ts.map +1 -1
  63. package/dist/admin/index.js +27 -13
  64. package/dist/admin/index.js.map +1 -1
  65. package/dist/{indieauth/consent.d.ts → admin/indieauth-consent.d.ts} +4 -4
  66. package/dist/admin/indieauth-consent.d.ts.map +1 -0
  67. package/dist/{indieauth/consent.js → admin/indieauth-consent.js} +17 -18
  68. package/dist/admin/indieauth-consent.js.map +1 -0
  69. package/dist/admin/legacy-migrations.d.ts +131 -0
  70. package/dist/admin/legacy-migrations.d.ts.map +1 -0
  71. package/dist/admin/legacy-migrations.js +235 -0
  72. package/dist/admin/legacy-migrations.js.map +1 -0
  73. package/dist/admin/media.d.ts +4 -108
  74. package/dist/admin/media.d.ts.map +1 -1
  75. package/dist/admin/media.js +19 -187
  76. package/dist/admin/media.js.map +1 -1
  77. package/dist/admin/menu.d.ts.map +1 -1
  78. package/dist/admin/menu.js +7 -7
  79. package/dist/admin/menu.js.map +1 -1
  80. package/dist/admin/messages.d.ts +1 -1
  81. package/dist/admin/messages.d.ts.map +1 -1
  82. package/dist/admin/messages.js +10 -12
  83. package/dist/admin/messages.js.map +1 -1
  84. package/dist/admin/navigation.d.ts +3 -3
  85. package/dist/admin/navigation.d.ts.map +1 -1
  86. package/dist/admin/navigation.js +9 -12
  87. package/dist/admin/navigation.js.map +1 -1
  88. package/dist/admin/personal-data.d.ts +1 -1
  89. package/dist/admin/personal-data.d.ts.map +1 -1
  90. package/dist/admin/personal-data.js +3 -6
  91. package/dist/admin/personal-data.js.map +1 -1
  92. package/dist/admin/plugins.d.ts +1 -1
  93. package/dist/admin/plugins.d.ts.map +1 -1
  94. package/dist/admin/plugins.js +11 -15
  95. package/dist/admin/plugins.js.map +1 -1
  96. package/dist/admin/preview.d.ts +2 -1
  97. package/dist/admin/preview.d.ts.map +1 -1
  98. package/dist/admin/preview.js +28 -32
  99. package/dist/admin/preview.js.map +1 -1
  100. package/dist/admin/recovery.d.ts +3 -3
  101. package/dist/admin/recovery.d.ts.map +1 -1
  102. package/dist/admin/recovery.js +10 -12
  103. package/dist/admin/recovery.js.map +1 -1
  104. package/dist/admin/routes.d.ts +1 -3
  105. package/dist/admin/routes.d.ts.map +1 -1
  106. package/dist/admin/routes.js +28 -26
  107. package/dist/admin/routes.js.map +1 -1
  108. package/dist/admin/settings-discussion.d.ts.map +1 -1
  109. package/dist/admin/settings-discussion.js +7 -4
  110. package/dist/admin/settings-discussion.js.map +1 -1
  111. package/dist/admin/settings-email.d.ts +1 -1
  112. package/dist/admin/settings-email.d.ts.map +1 -1
  113. package/dist/admin/settings-email.js +13 -10
  114. package/dist/admin/settings-email.js.map +1 -1
  115. package/dist/admin/settings-general.d.ts.map +1 -1
  116. package/dist/admin/settings-general.js +10 -7
  117. package/dist/admin/settings-general.js.map +1 -1
  118. package/dist/admin/settings-page.d.ts +3 -4
  119. package/dist/admin/settings-page.d.ts.map +1 -1
  120. package/dist/admin/settings-page.js +5 -6
  121. package/dist/admin/settings-page.js.map +1 -1
  122. package/dist/admin/settings-pages.d.ts +1 -1
  123. package/dist/admin/settings-pages.d.ts.map +1 -1
  124. package/dist/admin/settings-permalinks.js +1 -1
  125. package/dist/admin/settings-permalinks.js.map +1 -1
  126. package/dist/admin/settings-reading.d.ts +2 -2
  127. package/dist/admin/settings-reading.d.ts.map +1 -1
  128. package/dist/admin/settings-reading.js +4 -3
  129. package/dist/admin/settings-reading.js.map +1 -1
  130. package/dist/admin/settings.d.ts +0 -579
  131. package/dist/admin/settings.d.ts.map +1 -1
  132. package/dist/admin/settings.js +1 -1155
  133. package/dist/admin/settings.js.map +1 -1
  134. package/dist/admin/syndication-targets.d.ts +1 -1
  135. package/dist/admin/syndication-targets.d.ts.map +1 -1
  136. package/dist/admin/syndication-targets.js +11 -15
  137. package/dist/admin/syndication-targets.js.map +1 -1
  138. package/dist/admin/taxonomy.d.ts +2 -2
  139. package/dist/admin/taxonomy.d.ts.map +1 -1
  140. package/dist/admin/taxonomy.js +8 -11
  141. package/dist/admin/taxonomy.js.map +1 -1
  142. package/dist/admin/templates.js +1 -1
  143. package/dist/admin/templates.js.map +1 -1
  144. package/dist/admin/tools.d.ts +4 -4
  145. package/dist/admin/tools.d.ts.map +1 -1
  146. package/dist/admin/tools.js +3 -6
  147. package/dist/admin/tools.js.map +1 -1
  148. package/dist/admin/uploads.d.ts +1 -106
  149. package/dist/admin/uploads.d.ts.map +1 -1
  150. package/dist/admin/uploads.js +2 -191
  151. package/dist/admin/uploads.js.map +1 -1
  152. package/dist/admin/users.d.ts +20 -15
  153. package/dist/admin/users.d.ts.map +1 -1
  154. package/dist/admin/users.js +83 -80
  155. package/dist/admin/users.js.map +1 -1
  156. package/dist/avatars/avatars.d.ts +2 -2
  157. package/dist/avatars/avatars.d.ts.map +1 -1
  158. package/dist/avatars/avatars.js +6 -9
  159. package/dist/avatars/avatars.js.map +1 -1
  160. package/dist/avatars/index.d.ts +0 -1
  161. package/dist/avatars/index.d.ts.map +1 -1
  162. package/dist/avatars/index.js +0 -1
  163. package/dist/avatars/index.js.map +1 -1
  164. package/dist/cache.d.ts +4 -2
  165. package/dist/cache.d.ts.map +1 -1
  166. package/dist/cache.js +11 -5
  167. package/dist/cache.js.map +1 -1
  168. package/dist/cli.d.ts +2 -33
  169. package/dist/cli.d.ts.map +1 -1
  170. package/dist/cli.js +245 -267
  171. package/dist/cli.js.map +1 -1
  172. package/dist/cms/app.d.ts +11 -0
  173. package/dist/cms/app.d.ts.map +1 -0
  174. package/dist/cms/app.js +115 -0
  175. package/dist/cms/app.js.map +1 -0
  176. package/dist/cms/boot.d.ts +14 -0
  177. package/dist/cms/boot.d.ts.map +1 -0
  178. package/dist/cms/boot.js +107 -0
  179. package/dist/cms/boot.js.map +1 -0
  180. package/dist/cms/create.d.ts +248 -0
  181. package/dist/cms/create.d.ts.map +1 -0
  182. package/dist/cms/create.js +167 -0
  183. package/dist/cms/create.js.map +1 -0
  184. package/dist/cms/lifecycle.d.ts +11 -0
  185. package/dist/cms/lifecycle.d.ts.map +1 -0
  186. package/dist/cms/lifecycle.js +15 -0
  187. package/dist/cms/lifecycle.js.map +1 -0
  188. package/dist/{web/errors.d.ts → cms/server-error.d.ts} +2 -8
  189. package/dist/cms/server-error.d.ts.map +1 -0
  190. package/dist/{web/errors.js → cms/server-error.js} +4 -14
  191. package/dist/cms/server-error.js.map +1 -0
  192. package/dist/cms/services.d.ts +55 -0
  193. package/dist/cms/services.d.ts.map +1 -0
  194. package/dist/cms/services.js +353 -0
  195. package/dist/cms/services.js.map +1 -0
  196. package/dist/cms/site-records.d.ts +4 -0
  197. package/dist/cms/site-records.d.ts.map +1 -0
  198. package/dist/cms/site-records.js +15 -0
  199. package/dist/cms/site-records.js.map +1 -0
  200. package/dist/comments/akismet.d.ts +1 -1
  201. package/dist/comments/akismet.d.ts.map +1 -1
  202. package/dist/comments/akismet.js +1 -3
  203. package/dist/comments/akismet.js.map +1 -1
  204. package/dist/comments/conversation.d.ts +334 -0
  205. package/dist/comments/conversation.d.ts.map +1 -0
  206. package/dist/comments/conversation.js +51 -0
  207. package/dist/comments/conversation.js.map +1 -0
  208. package/dist/comments/form.d.ts +2 -2
  209. package/dist/comments/form.d.ts.map +1 -1
  210. package/dist/comments/form.js +2 -2
  211. package/dist/comments/form.js.map +1 -1
  212. package/dist/comments/index.d.ts +12 -6
  213. package/dist/comments/index.d.ts.map +1 -1
  214. package/dist/comments/index.js +7 -4
  215. package/dist/comments/index.js.map +1 -1
  216. package/dist/comments/intake.d.ts +147 -0
  217. package/dist/comments/intake.d.ts.map +1 -0
  218. package/dist/comments/intake.js +161 -0
  219. package/dist/comments/intake.js.map +1 -0
  220. package/dist/comments/markdown.d.ts.map +1 -1
  221. package/dist/comments/markdown.js +2 -9
  222. package/dist/comments/markdown.js.map +1 -1
  223. package/dist/comments/migrations.d.ts +45 -0
  224. package/dist/comments/migrations.d.ts.map +1 -0
  225. package/dist/comments/migrations.js +194 -0
  226. package/dist/comments/migrations.js.map +1 -0
  227. package/dist/comments/moderate.d.ts +2 -2
  228. package/dist/comments/moderate.d.ts.map +1 -1
  229. package/dist/comments/moderate.js +3 -13
  230. package/dist/comments/moderate.js.map +1 -1
  231. package/dist/comments/page-form.d.ts +52 -0
  232. package/dist/comments/page-form.d.ts.map +1 -0
  233. package/dist/comments/page-form.js +62 -0
  234. package/dist/comments/page-form.js.map +1 -0
  235. package/dist/comments/policy.d.ts +1 -9
  236. package/dist/comments/policy.d.ts.map +1 -1
  237. package/dist/comments/policy.js +3 -18
  238. package/dist/comments/policy.js.map +1 -1
  239. package/dist/comments/records.d.ts +25 -173
  240. package/dist/comments/records.d.ts.map +1 -1
  241. package/dist/comments/records.js +69 -265
  242. package/dist/comments/records.js.map +1 -1
  243. package/dist/comments/reply-notices.d.ts +5 -5
  244. package/dist/comments/reply-notices.d.ts.map +1 -1
  245. package/dist/comments/reply-notices.js +6 -6
  246. package/dist/comments/reply-notices.js.map +1 -1
  247. package/dist/comments/reply-post.d.ts +2 -2
  248. package/dist/comments/reply-post.d.ts.map +1 -1
  249. package/dist/comments/reply-post.js +7 -5
  250. package/dist/comments/reply-post.js.map +1 -1
  251. package/dist/comments/routes.d.ts +3 -3
  252. package/dist/comments/routes.d.ts.map +1 -1
  253. package/dist/comments/routes.js +22 -34
  254. package/dist/comments/routes.js.map +1 -1
  255. package/dist/comments/submission.d.ts +5 -100
  256. package/dist/comments/submission.d.ts.map +1 -1
  257. package/dist/comments/submission.js +5 -20
  258. package/dist/comments/submission.js.map +1 -1
  259. package/dist/comments/viewer.d.ts +1 -25
  260. package/dist/comments/viewer.d.ts.map +1 -1
  261. package/dist/comments/viewer.js +1 -44
  262. package/dist/comments/viewer.js.map +1 -1
  263. package/dist/config-loader.d.ts +35 -0
  264. package/dist/config-loader.d.ts.map +1 -0
  265. package/dist/config-loader.js +116 -0
  266. package/dist/config-loader.js.map +1 -0
  267. package/dist/config.d.ts +72 -50
  268. package/dist/config.d.ts.map +1 -1
  269. package/dist/config.js +132 -180
  270. package/dist/config.js.map +1 -1
  271. package/dist/contact/delivery.d.ts +1 -1
  272. package/dist/contact/delivery.d.ts.map +1 -1
  273. package/dist/contact/delivery.js +5 -13
  274. package/dist/contact/delivery.js.map +1 -1
  275. package/dist/contact/form.d.ts +2 -4
  276. package/dist/contact/form.d.ts.map +1 -1
  277. package/dist/contact/form.js +3 -4
  278. package/dist/contact/form.js.map +1 -1
  279. package/dist/contact/index.d.ts +2 -2
  280. package/dist/contact/index.d.ts.map +1 -1
  281. package/dist/contact/index.js +2 -2
  282. package/dist/contact/index.js.map +1 -1
  283. package/dist/contact/records.d.ts.map +1 -1
  284. package/dist/contact/records.js +8 -11
  285. package/dist/contact/records.js.map +1 -1
  286. package/dist/contact/submission.d.ts +2 -2
  287. package/dist/contact/submission.d.ts.map +1 -1
  288. package/dist/contact/submission.js +7 -16
  289. package/dist/contact/submission.js.map +1 -1
  290. package/dist/{images → content}/alt-text.d.ts +1 -1
  291. package/dist/content/alt-text.d.ts.map +1 -0
  292. package/dist/{images → content}/alt-text.js +3 -5
  293. package/dist/content/alt-text.js.map +1 -0
  294. package/dist/content/authors.d.ts +79 -0
  295. package/dist/content/authors.d.ts.map +1 -0
  296. package/dist/content/authors.js +106 -0
  297. package/dist/content/authors.js.map +1 -0
  298. package/dist/content/citation.d.ts +3 -0
  299. package/dist/content/citation.d.ts.map +1 -1
  300. package/dist/content/citation.js +3 -0
  301. package/dist/content/citation.js.map +1 -1
  302. package/dist/content/comments.d.ts +3 -0
  303. package/dist/content/comments.d.ts.map +1 -0
  304. package/dist/content/comments.js +3 -0
  305. package/dist/content/comments.js.map +1 -0
  306. package/dist/content/contact.d.ts +3 -0
  307. package/dist/content/contact.d.ts.map +1 -0
  308. package/dist/content/contact.js +3 -0
  309. package/dist/content/contact.js.map +1 -0
  310. package/dist/content/document-form.d.ts +195 -0
  311. package/dist/content/document-form.d.ts.map +1 -0
  312. package/dist/content/document-form.js +201 -0
  313. package/dist/content/document-form.js.map +1 -0
  314. package/dist/content/document-kind.d.ts +55 -0
  315. package/dist/content/document-kind.d.ts.map +1 -0
  316. package/dist/content/document-kind.js +30 -0
  317. package/dist/content/document-kind.js.map +1 -0
  318. package/dist/{admin/enclosure-field.d.ts → content/enclosure-form.d.ts} +14 -34
  319. package/dist/content/enclosure-form.d.ts.map +1 -0
  320. package/dist/{admin/enclosure-field.js → content/enclosure-form.js} +39 -76
  321. package/dist/content/enclosure-form.js.map +1 -0
  322. package/dist/content/enclosure.d.ts.map +1 -1
  323. package/dist/content/enclosure.js +3 -4
  324. package/dist/content/enclosure.js.map +1 -1
  325. package/dist/{admin/event-field.d.ts → content/event-form.d.ts} +6 -5
  326. package/dist/content/event-form.d.ts.map +1 -0
  327. package/dist/{admin/event-field.js → content/event-form.js} +45 -12
  328. package/dist/content/event-form.js.map +1 -0
  329. package/dist/content/excerpt.d.ts +25 -0
  330. package/dist/content/excerpt.d.ts.map +1 -0
  331. package/dist/content/excerpt.js +43 -0
  332. package/dist/content/excerpt.js.map +1 -0
  333. package/dist/content/form-error.d.ts +10 -0
  334. package/dist/content/form-error.d.ts.map +1 -0
  335. package/dist/content/form-error.js +2 -0
  336. package/dist/content/form-error.js.map +1 -0
  337. package/dist/{web → content}/guids.d.ts +14 -19
  338. package/dist/content/guids.d.ts.map +1 -0
  339. package/dist/{web → content}/guids.js +30 -19
  340. package/dist/content/guids.js.map +1 -0
  341. package/dist/content/image-tags.d.ts +25 -0
  342. package/dist/content/image-tags.d.ts.map +1 -0
  343. package/dist/content/image-tags.js +55 -0
  344. package/dist/content/image-tags.js.map +1 -0
  345. package/dist/content/index.d.ts +9 -4
  346. package/dist/content/index.d.ts.map +1 -1
  347. package/dist/content/index.js +5 -2
  348. package/dist/content/index.js.map +1 -1
  349. package/dist/content/language.d.ts +19 -0
  350. package/dist/content/language.d.ts.map +1 -0
  351. package/dist/content/language.js +19 -0
  352. package/dist/content/language.js.map +1 -0
  353. package/dist/content/license.d.ts.map +1 -0
  354. package/dist/content/license.js.map +1 -0
  355. package/dist/{web → content}/locale.d.ts +0 -6
  356. package/dist/content/locale.d.ts.map +1 -0
  357. package/dist/{web → content}/locale.js +1 -6
  358. package/dist/content/locale.js.map +1 -0
  359. package/dist/content/location-form.d.ts +17 -0
  360. package/dist/content/location-form.d.ts.map +1 -0
  361. package/dist/{admin/location-field.js → content/location-form.js} +2 -23
  362. package/dist/content/location-form.js.map +1 -0
  363. package/dist/content/location.d.ts.map +1 -1
  364. package/dist/content/location.js +1 -3
  365. package/dist/content/location.js.map +1 -1
  366. package/dist/content/markdown-links.d.ts +11 -0
  367. package/dist/content/markdown-links.d.ts.map +1 -0
  368. package/dist/content/markdown-links.js +223 -0
  369. package/dist/content/markdown-links.js.map +1 -0
  370. package/dist/content/markdown.d.ts +2 -1
  371. package/dist/content/markdown.d.ts.map +1 -1
  372. package/dist/content/markdown.js +1 -1
  373. package/dist/content/markdown.js.map +1 -1
  374. package/dist/content/migrated.js +1 -1
  375. package/dist/content/migrated.js.map +1 -1
  376. package/dist/content/parser.d.ts.map +1 -1
  377. package/dist/content/parser.js +1 -12
  378. package/dist/content/parser.js.map +1 -1
  379. package/dist/content/permalinks.d.ts +34 -0
  380. package/dist/content/permalinks.d.ts.map +1 -0
  381. package/dist/{web/documents.js → content/permalinks.js} +6 -56
  382. package/dist/content/permalinks.js.map +1 -0
  383. package/dist/content/photo-form.d.ts +28 -0
  384. package/dist/content/photo-form.d.ts.map +1 -0
  385. package/dist/{admin/photo-field.js → content/photo-form.js} +36 -36
  386. package/dist/content/photo-form.js.map +1 -0
  387. package/dist/content/photo.d.ts +1 -1
  388. package/dist/content/photo.d.ts.map +1 -1
  389. package/dist/content/photo.js +1 -1
  390. package/dist/content/photo.js.map +1 -1
  391. package/dist/content/post-fields.d.ts +40 -0
  392. package/dist/content/post-fields.d.ts.map +1 -0
  393. package/dist/content/post-fields.js +256 -0
  394. package/dist/content/post-fields.js.map +1 -0
  395. package/dist/{admin/read-field.d.ts → content/read-form.d.ts} +6 -4
  396. package/dist/content/read-form.d.ts.map +1 -0
  397. package/dist/content/read-form.js +99 -0
  398. package/dist/content/read-form.js.map +1 -0
  399. package/dist/content/read.d.ts.map +1 -1
  400. package/dist/content/read.js +7 -11
  401. package/dist/content/read.js.map +1 -1
  402. package/dist/content/redirects.d.ts +84 -0
  403. package/dist/content/redirects.d.ts.map +1 -0
  404. package/dist/content/redirects.js +234 -0
  405. package/dist/content/redirects.js.map +1 -0
  406. package/dist/content/sanitize.d.ts +13 -0
  407. package/dist/content/sanitize.d.ts.map +1 -0
  408. package/dist/{web → content}/sanitize.js +4 -71
  409. package/dist/content/sanitize.js.map +1 -0
  410. package/dist/content/save.d.ts +5 -8
  411. package/dist/content/save.d.ts.map +1 -1
  412. package/dist/content/save.js +5 -26
  413. package/dist/content/save.js.map +1 -1
  414. package/dist/content/schedule.d.ts +2 -2
  415. package/dist/content/schedule.d.ts.map +1 -1
  416. package/dist/content/schedule.js +1 -3
  417. package/dist/content/schedule.js.map +1 -1
  418. package/dist/content/served.d.ts +58 -0
  419. package/dist/content/served.d.ts.map +1 -0
  420. package/dist/content/served.js +65 -0
  421. package/dist/content/served.js.map +1 -0
  422. package/dist/content/site-links.d.ts +72 -0
  423. package/dist/content/site-links.d.ts.map +1 -0
  424. package/dist/content/site-links.js +191 -0
  425. package/dist/content/site-links.js.map +1 -0
  426. package/dist/content/sqlite/archive.d.ts +4 -0
  427. package/dist/content/sqlite/archive.d.ts.map +1 -0
  428. package/dist/content/sqlite/archive.js +96 -0
  429. package/dist/content/sqlite/archive.js.map +1 -0
  430. package/dist/content/sqlite/backlinks.d.ts +4 -0
  431. package/dist/content/sqlite/backlinks.d.ts.map +1 -0
  432. package/dist/content/sqlite/backlinks.js +46 -0
  433. package/dist/content/sqlite/backlinks.js.map +1 -0
  434. package/dist/content/sqlite/catalog.d.ts +4 -0
  435. package/dist/content/sqlite/catalog.d.ts.map +1 -0
  436. package/dist/content/sqlite/catalog.js +62 -0
  437. package/dist/content/sqlite/catalog.js.map +1 -0
  438. package/dist/content/sqlite/clauses.d.ts +57 -0
  439. package/dist/content/sqlite/clauses.d.ts.map +1 -0
  440. package/dist/content/sqlite/clauses.js +76 -0
  441. package/dist/content/sqlite/clauses.js.map +1 -0
  442. package/dist/content/sqlite/database.d.ts +26 -0
  443. package/dist/content/sqlite/database.d.ts.map +1 -0
  444. package/dist/content/sqlite/database.js +27 -0
  445. package/dist/content/sqlite/database.js.map +1 -0
  446. package/dist/content/sqlite/documents.d.ts +12 -0
  447. package/dist/content/sqlite/documents.d.ts.map +1 -0
  448. package/dist/content/sqlite/documents.js +40 -0
  449. package/dist/content/sqlite/documents.js.map +1 -0
  450. package/dist/content/sqlite/lookups.d.ts +6 -0
  451. package/dist/content/sqlite/lookups.d.ts.map +1 -0
  452. package/dist/content/sqlite/lookups.js +25 -0
  453. package/dist/content/sqlite/lookups.js.map +1 -0
  454. package/dist/content/sqlite/open.d.ts +8 -0
  455. package/dist/content/sqlite/open.d.ts.map +1 -0
  456. package/dist/content/sqlite/open.js +63 -0
  457. package/dist/content/sqlite/open.js.map +1 -0
  458. package/dist/content/sqlite/replies.d.ts +4 -0
  459. package/dist/content/sqlite/replies.d.ts.map +1 -0
  460. package/dist/content/sqlite/replies.js +21 -0
  461. package/dist/content/sqlite/replies.js.map +1 -0
  462. package/dist/content/sqlite/rows.d.ts +22 -0
  463. package/dist/content/sqlite/rows.d.ts.map +1 -0
  464. package/dist/content/sqlite/rows.js +93 -0
  465. package/dist/content/sqlite/rows.js.map +1 -0
  466. package/dist/content/sqlite/schedule.d.ts +4 -0
  467. package/dist/content/sqlite/schedule.d.ts.map +1 -0
  468. package/dist/content/sqlite/schedule.js +16 -0
  469. package/dist/content/sqlite/schedule.js.map +1 -0
  470. package/dist/content/sqlite/schema.d.ts +10 -0
  471. package/dist/content/sqlite/schema.d.ts.map +1 -0
  472. package/dist/content/sqlite/schema.js +209 -0
  473. package/dist/content/sqlite/schema.js.map +1 -0
  474. package/dist/content/sqlite/search.d.ts +4 -0
  475. package/dist/content/sqlite/search.d.ts.map +1 -0
  476. package/dist/content/sqlite/search.js +54 -0
  477. package/dist/content/sqlite/search.js.map +1 -0
  478. package/dist/content/sqlite/spellings.d.ts +6 -0
  479. package/dist/content/sqlite/spellings.d.ts.map +1 -0
  480. package/dist/content/sqlite/spellings.js +80 -0
  481. package/dist/content/sqlite/spellings.js.map +1 -0
  482. package/dist/content/sqlite/taxonomy.d.ts +4 -0
  483. package/dist/content/sqlite/taxonomy.d.ts.map +1 -0
  484. package/dist/content/sqlite/taxonomy.js +75 -0
  485. package/dist/content/sqlite/taxonomy.js.map +1 -0
  486. package/dist/content/sqlite/writes.d.ts +9 -0
  487. package/dist/content/sqlite/writes.d.ts.map +1 -0
  488. package/dist/content/sqlite/writes.js +164 -0
  489. package/dist/content/sqlite/writes.js.map +1 -0
  490. package/dist/content/store.d.ts +142 -137
  491. package/dist/content/store.d.ts.map +1 -1
  492. package/dist/content/store.js +0 -1050
  493. package/dist/content/store.js.map +1 -1
  494. package/dist/content/sync.d.ts +12 -4
  495. package/dist/content/sync.d.ts.map +1 -1
  496. package/dist/content/sync.js +24 -41
  497. package/dist/content/sync.js.map +1 -1
  498. package/dist/content/syndicate-to.d.ts +25 -0
  499. package/dist/content/syndicate-to.d.ts.map +1 -0
  500. package/dist/content/syndicate-to.js +8 -0
  501. package/dist/content/syndicate-to.js.map +1 -0
  502. package/dist/{web → content}/taxonomy.d.ts +1 -1
  503. package/dist/content/taxonomy.d.ts.map +1 -0
  504. package/dist/{web → content}/taxonomy.js +2 -2
  505. package/dist/content/taxonomy.js.map +1 -0
  506. package/dist/content/time.d.ts +2 -2
  507. package/dist/content/time.d.ts.map +1 -1
  508. package/dist/content/time.js +3 -3
  509. package/dist/content/time.js.map +1 -1
  510. package/dist/content/trash.d.ts +35 -0
  511. package/dist/content/trash.d.ts.map +1 -0
  512. package/dist/content/trash.js +83 -0
  513. package/dist/content/trash.js.map +1 -0
  514. package/dist/content/uploads.d.ts +24 -0
  515. package/dist/content/uploads.d.ts.map +1 -0
  516. package/dist/content/uploads.js +27 -0
  517. package/dist/content/uploads.js.map +1 -0
  518. package/dist/content/video.d.ts.map +1 -1
  519. package/dist/content/video.js +3 -5
  520. package/dist/content/video.js.map +1 -1
  521. package/dist/content/write.d.ts +84 -0
  522. package/dist/content/write.d.ts.map +1 -0
  523. package/dist/content/write.js +566 -0
  524. package/dist/content/write.js.map +1 -0
  525. package/dist/content/writer.d.ts.map +1 -1
  526. package/dist/content/writer.js +1 -2
  527. package/dist/content/writer.js.map +1 -1
  528. package/dist/dev-mode.d.ts +5 -3
  529. package/dist/dev-mode.d.ts.map +1 -1
  530. package/dist/dev-mode.js +3 -3
  531. package/dist/dev-mode.js.map +1 -1
  532. package/dist/drain.d.ts +2 -3
  533. package/dist/drain.d.ts.map +1 -1
  534. package/dist/drain.js +2 -1
  535. package/dist/drain.js.map +1 -1
  536. package/dist/exports.d.ts +26 -0
  537. package/dist/exports.d.ts.map +1 -0
  538. package/dist/exports.js +8 -0
  539. package/dist/exports.js.map +1 -0
  540. package/dist/federation/actor.d.ts +1 -1
  541. package/dist/federation/actor.d.ts.map +1 -1
  542. package/dist/federation/actor.js +6 -13
  543. package/dist/federation/actor.js.map +1 -1
  544. package/dist/federation/article.d.ts +4 -14
  545. package/dist/federation/article.d.ts.map +1 -1
  546. package/dist/federation/article.js +19 -32
  547. package/dist/federation/article.js.map +1 -1
  548. package/dist/federation/backfill.d.ts +4 -4
  549. package/dist/federation/backfill.d.ts.map +1 -1
  550. package/dist/federation/backfill.js +12 -13
  551. package/dist/federation/backfill.js.map +1 -1
  552. package/dist/federation/citations.d.ts.map +1 -1
  553. package/dist/federation/citations.js.map +1 -1
  554. package/dist/federation/cited-post.d.ts.map +1 -1
  555. package/dist/federation/cited-post.js +2 -4
  556. package/dist/federation/cited-post.js.map +1 -1
  557. package/dist/federation/delivery-plan.d.ts +85 -0
  558. package/dist/federation/delivery-plan.d.ts.map +1 -0
  559. package/dist/federation/delivery-plan.js +137 -0
  560. package/dist/federation/delivery-plan.js.map +1 -0
  561. package/dist/federation/delivery.d.ts +7 -32
  562. package/dist/federation/delivery.d.ts.map +1 -1
  563. package/dist/federation/delivery.js +64 -201
  564. package/dist/federation/delivery.js.map +1 -1
  565. package/dist/federation/federation.d.ts +5 -5
  566. package/dist/federation/federation.d.ts.map +1 -1
  567. package/dist/federation/federation.js +7 -6
  568. package/dist/federation/federation.js.map +1 -1
  569. package/dist/federation/followers.d.ts +1 -1
  570. package/dist/federation/followers.d.ts.map +1 -1
  571. package/dist/federation/inbox.d.ts +1 -1
  572. package/dist/federation/inbox.d.ts.map +1 -1
  573. package/dist/federation/inbox.js +5 -4
  574. package/dist/federation/inbox.js.map +1 -1
  575. package/dist/federation/index.d.ts +10 -8
  576. package/dist/federation/index.d.ts.map +1 -1
  577. package/dist/federation/index.js +7 -5
  578. package/dist/federation/index.js.map +1 -1
  579. package/dist/federation/keys.d.ts +8 -27
  580. package/dist/federation/keys.d.ts.map +1 -1
  581. package/dist/federation/keys.js +4 -47
  582. package/dist/federation/keys.js.map +1 -1
  583. package/dist/federation/mount.d.ts +2 -2
  584. package/dist/federation/mount.d.ts.map +1 -1
  585. package/dist/federation/mount.js +9 -7
  586. package/dist/federation/mount.js.map +1 -1
  587. package/dist/federation/paths.d.ts +1 -9
  588. package/dist/federation/paths.d.ts.map +1 -1
  589. package/dist/federation/paths.js +2 -12
  590. package/dist/federation/paths.js.map +1 -1
  591. package/dist/federation/profiles.d.ts +1 -1
  592. package/dist/federation/profiles.d.ts.map +1 -1
  593. package/dist/federation/profiles.js +5 -8
  594. package/dist/federation/profiles.js.map +1 -1
  595. package/dist/federation/quotes.d.ts +2 -2
  596. package/dist/federation/quotes.d.ts.map +1 -1
  597. package/dist/federation/quotes.js +4 -4
  598. package/dist/federation/quotes.js.map +1 -1
  599. package/dist/federation/records.d.ts +2 -2
  600. package/dist/federation/records.d.ts.map +1 -1
  601. package/dist/federation/records.js +12 -19
  602. package/dist/federation/records.js.map +1 -1
  603. package/dist/federation/relays.d.ts +2 -3
  604. package/dist/federation/relays.d.ts.map +1 -1
  605. package/dist/federation/relays.js +22 -30
  606. package/dist/federation/relays.js.map +1 -1
  607. package/dist/federation/site-loaders.js +1 -1
  608. package/dist/federation/site-loaders.js.map +1 -1
  609. package/dist/federation/webfinger.d.ts +23 -0
  610. package/dist/federation/webfinger.d.ts.map +1 -0
  611. package/dist/federation/webfinger.js +70 -0
  612. package/dist/federation/webfinger.js.map +1 -0
  613. package/dist/files/atomic.d.ts.map +1 -1
  614. package/dist/files/atomic.js +4 -9
  615. package/dist/files/atomic.js.map +1 -1
  616. package/dist/files/static-files.d.ts +21 -0
  617. package/dist/files/static-files.d.ts.map +1 -0
  618. package/dist/files/static-files.js +88 -0
  619. package/dist/files/static-files.js.map +1 -0
  620. package/dist/forms/checker.d.ts +93 -0
  621. package/dist/forms/checker.d.ts.map +1 -0
  622. package/dist/forms/checker.js +2 -0
  623. package/dist/forms/checker.js.map +1 -0
  624. package/dist/forms/protection.d.ts +3 -1
  625. package/dist/forms/protection.d.ts.map +1 -1
  626. package/dist/forms/protection.js +3 -1
  627. package/dist/forms/protection.js.map +1 -1
  628. package/dist/images/icons.js +2 -2
  629. package/dist/images/icons.js.map +1 -1
  630. package/dist/images/index.d.ts +2 -1
  631. package/dist/images/index.d.ts.map +1 -1
  632. package/dist/images/index.js +2 -1
  633. package/dist/images/index.js.map +1 -1
  634. package/dist/images/markup.d.ts +0 -20
  635. package/dist/images/markup.d.ts.map +1 -1
  636. package/dist/images/markup.js +5 -64
  637. package/dist/images/markup.js.map +1 -1
  638. package/dist/images/paths.d.ts +0 -10
  639. package/dist/images/paths.d.ts.map +1 -1
  640. package/dist/images/paths.js +3 -11
  641. package/dist/images/paths.js.map +1 -1
  642. package/dist/images/variants.d.ts +2 -2
  643. package/dist/images/variants.d.ts.map +1 -1
  644. package/dist/images/variants.js +4 -3
  645. package/dist/images/variants.js.map +1 -1
  646. package/dist/index.d.ts +3 -291
  647. package/dist/index.d.ts.map +1 -1
  648. package/dist/index.js +2 -838
  649. package/dist/index.js.map +1 -1
  650. package/dist/indexnow.d.ts.map +1 -1
  651. package/dist/indexnow.js +21 -26
  652. package/dist/indexnow.js.map +1 -1
  653. package/dist/indieauth/client.d.ts +1 -1
  654. package/dist/indieauth/client.d.ts.map +1 -1
  655. package/dist/indieauth/client.js +1 -1
  656. package/dist/indieauth/client.js.map +1 -1
  657. package/dist/indieauth/grants.d.ts +1 -1
  658. package/dist/indieauth/grants.d.ts.map +1 -1
  659. package/dist/indieauth/identity.d.ts +2 -2
  660. package/dist/indieauth/identity.d.ts.map +1 -1
  661. package/dist/indieauth/identity.js +5 -7
  662. package/dist/indieauth/identity.js.map +1 -1
  663. package/dist/indieauth/redeem.d.ts +1 -1
  664. package/dist/indieauth/redeem.d.ts.map +1 -1
  665. package/dist/indieauth/redeem.js.map +1 -1
  666. package/dist/indieauth/request.d.ts +5 -1
  667. package/dist/indieauth/request.d.ts.map +1 -1
  668. package/dist/indieauth/request.js +6 -2
  669. package/dist/indieauth/request.js.map +1 -1
  670. package/dist/indieauth/tokens.d.ts +1 -1
  671. package/dist/indieauth/tokens.d.ts.map +1 -1
  672. package/dist/indieauth/tokens.js +2 -2
  673. package/dist/indieauth/tokens.js.map +1 -1
  674. package/dist/mail/index.d.ts +1 -5
  675. package/dist/mail/index.d.ts.map +1 -1
  676. package/dist/mail/index.js +0 -2
  677. package/dist/mail/index.js.map +1 -1
  678. package/dist/mail/provider.d.ts +7 -0
  679. package/dist/mail/provider.d.ts.map +1 -1
  680. package/dist/maintenance.d.ts +1 -1
  681. package/dist/maintenance.d.ts.map +1 -1
  682. package/dist/media/library.d.ts +99 -0
  683. package/dist/media/library.d.ts.map +1 -0
  684. package/dist/media/library.js +157 -0
  685. package/dist/media/library.js.map +1 -0
  686. package/dist/media/uploads.d.ts +106 -0
  687. package/dist/media/uploads.d.ts.map +1 -0
  688. package/dist/media/uploads.js +192 -0
  689. package/dist/media/uploads.js.map +1 -0
  690. package/dist/micropub/content.js +1 -1
  691. package/dist/micropub/content.js.map +1 -1
  692. package/dist/micropub/create.d.ts +7 -15
  693. package/dist/micropub/create.d.ts.map +1 -1
  694. package/dist/micropub/create.js +48 -184
  695. package/dist/micropub/create.js.map +1 -1
  696. package/dist/micropub/endpoint.d.ts +2 -2
  697. package/dist/micropub/endpoint.d.ts.map +1 -1
  698. package/dist/micropub/endpoint.js +29 -40
  699. package/dist/micropub/endpoint.js.map +1 -1
  700. package/dist/micropub/media.d.ts +1 -1
  701. package/dist/micropub/media.d.ts.map +1 -1
  702. package/dist/micropub/media.js +6 -6
  703. package/dist/micropub/media.js.map +1 -1
  704. package/dist/micropub/update.d.ts +6 -14
  705. package/dist/micropub/update.d.ts.map +1 -1
  706. package/dist/micropub/update.js +37 -90
  707. package/dist/micropub/update.js.map +1 -1
  708. package/dist/notifications/comments.d.ts +4 -4
  709. package/dist/notifications/comments.d.ts.map +1 -1
  710. package/dist/notifications/comments.js +6 -14
  711. package/dist/notifications/comments.js.map +1 -1
  712. package/dist/notifications/digest.d.ts +4 -4
  713. package/dist/notifications/digest.d.ts.map +1 -1
  714. package/dist/notifications/digest.js +6 -16
  715. package/dist/notifications/digest.js.map +1 -1
  716. package/dist/notifications/index.d.ts +6 -3
  717. package/dist/notifications/index.d.ts.map +1 -1
  718. package/dist/notifications/index.js +3 -2
  719. package/dist/notifications/index.js.map +1 -1
  720. package/dist/notifications/links.d.ts.map +1 -1
  721. package/dist/notifications/links.js +2 -2
  722. package/dist/notifications/links.js.map +1 -1
  723. package/dist/{mail/service.d.ts → notifications/mail-service.d.ts} +7 -13
  724. package/dist/notifications/mail-service.d.ts.map +1 -0
  725. package/dist/{mail/service.js → notifications/mail-service.js} +33 -54
  726. package/dist/notifications/mail-service.js.map +1 -0
  727. package/dist/{mail/templates.d.ts → notifications/mail-templates.d.ts} +4 -2
  728. package/dist/notifications/mail-templates.d.ts.map +1 -0
  729. package/dist/{mail/templates.js → notifications/mail-templates.js} +5 -3
  730. package/dist/notifications/mail-templates.js.map +1 -0
  731. package/dist/notifications/tokens.d.ts +2 -2
  732. package/dist/notifications/tokens.d.ts.map +1 -1
  733. package/dist/notifications/tokens.js +2 -2
  734. package/dist/notifications/tokens.js.map +1 -1
  735. package/dist/notify.d.ts.map +1 -1
  736. package/dist/notify.js +12 -24
  737. package/dist/notify.js.map +1 -1
  738. package/dist/plugin.d.ts +48 -2
  739. package/dist/plugin.d.ts.map +1 -1
  740. package/dist/plugin.js +28 -2
  741. package/dist/plugin.js.map +1 -1
  742. package/dist/plugins/enabled.d.ts.map +1 -1
  743. package/dist/plugins/enabled.js +2 -4
  744. package/dist/plugins/enabled.js.map +1 -1
  745. package/dist/plugins/fetch.d.ts +1 -1
  746. package/dist/plugins/fetch.d.ts.map +1 -1
  747. package/dist/plugins/fetch.js +1 -1
  748. package/dist/plugins/fetch.js.map +1 -1
  749. package/dist/plugins/folder.d.ts.map +1 -1
  750. package/dist/plugins/folder.js +1 -3
  751. package/dist/plugins/folder.js.map +1 -1
  752. package/dist/plugins/install.d.ts.map +1 -1
  753. package/dist/plugins/install.js +7 -3
  754. package/dist/plugins/install.js.map +1 -1
  755. package/dist/plugins/manage.d.ts +1 -1
  756. package/dist/plugins/manage.d.ts.map +1 -1
  757. package/dist/plugins/registry.d.ts.map +1 -1
  758. package/dist/plugins/registry.js +7 -9
  759. package/dist/plugins/registry.js.map +1 -1
  760. package/dist/plugins/settings.d.ts.map +1 -1
  761. package/dist/plugins/settings.js +2 -3
  762. package/dist/plugins/settings.js.map +1 -1
  763. package/dist/plugins/site.d.ts +1 -1
  764. package/dist/plugins/site.d.ts.map +1 -1
  765. package/dist/plugins/site.js +10 -4
  766. package/dist/plugins/site.js.map +1 -1
  767. package/dist/plugins/upgrade.d.ts.map +1 -1
  768. package/dist/plugins/upgrade.js +4 -3
  769. package/dist/plugins/upgrade.js.map +1 -1
  770. package/dist/privacy/erase.d.ts +1 -1
  771. package/dist/privacy/erase.d.ts.map +1 -1
  772. package/dist/privacy/retention.d.ts +2 -2
  773. package/dist/privacy/retention.d.ts.map +1 -1
  774. package/dist/privacy/retention.js +9 -11
  775. package/dist/privacy/retention.js.map +1 -1
  776. package/dist/site/admin-paths.d.ts +23 -0
  777. package/dist/site/admin-paths.d.ts.map +1 -0
  778. package/dist/site/admin-paths.js +25 -0
  779. package/dist/site/admin-paths.js.map +1 -0
  780. package/dist/site/admin-theme.d.ts.map +1 -0
  781. package/dist/site/admin-theme.js.map +1 -0
  782. package/dist/{web → site}/authors.d.ts +1 -72
  783. package/dist/site/authors.d.ts.map +1 -0
  784. package/dist/site/authors.js +107 -0
  785. package/dist/site/authors.js.map +1 -0
  786. package/dist/site/feed-settings.d.ts +28 -0
  787. package/dist/site/feed-settings.d.ts.map +1 -0
  788. package/dist/site/feed-settings.js +22 -0
  789. package/dist/site/feed-settings.js.map +1 -0
  790. package/dist/{web/indexnow.d.ts → site/indexnow-key.d.ts} +1 -1
  791. package/dist/site/indexnow-key.d.ts.map +1 -0
  792. package/dist/{web/indexnow.js → site/indexnow-key.js} +1 -1
  793. package/dist/site/indexnow-key.js.map +1 -0
  794. package/dist/{web → site}/navigation.d.ts +7 -1
  795. package/dist/site/navigation.d.ts.map +1 -0
  796. package/dist/{web → site}/navigation.js +18 -0
  797. package/dist/site/navigation.js.map +1 -0
  798. package/dist/{notifications/preferences.d.ts → site/notification-preferences.d.ts} +2 -2
  799. package/dist/site/notification-preferences.d.ts.map +1 -0
  800. package/dist/{notifications/preferences.js → site/notification-preferences.js} +1 -1
  801. package/dist/site/notification-preferences.js.map +1 -0
  802. package/dist/site/passwords.d.ts.map +1 -0
  803. package/dist/site/passwords.js.map +1 -0
  804. package/dist/{privacy/policy.d.ts → site/retention-policy.d.ts} +1 -1
  805. package/dist/site/retention-policy.d.ts.map +1 -0
  806. package/dist/{privacy/policy.js → site/retention-policy.js} +1 -1
  807. package/dist/site/retention-policy.js.map +1 -0
  808. package/dist/site/robots.d.ts +62 -0
  809. package/dist/site/robots.d.ts.map +1 -0
  810. package/dist/site/robots.js +130 -0
  811. package/dist/site/robots.js.map +1 -0
  812. package/dist/site/setting-rows.d.ts +46 -0
  813. package/dist/site/setting-rows.d.ts.map +1 -0
  814. package/dist/site/setting-rows.js +480 -0
  815. package/dist/site/setting-rows.js.map +1 -0
  816. package/dist/site/setting-values.d.ts +63 -0
  817. package/dist/site/setting-values.d.ts.map +1 -0
  818. package/dist/site/setting-values.js +170 -0
  819. package/dist/site/setting-values.js.map +1 -0
  820. package/dist/site/settings-form.d.ts +30 -0
  821. package/dist/site/settings-form.d.ts.map +1 -0
  822. package/dist/site/settings-form.js +58 -0
  823. package/dist/site/settings-form.js.map +1 -0
  824. package/dist/site/settings.d.ts +345 -0
  825. package/dist/site/settings.d.ts.map +1 -0
  826. package/dist/site/settings.js +107 -0
  827. package/dist/site/settings.js.map +1 -0
  828. package/dist/site/site-json.d.ts +69 -0
  829. package/dist/site/site-json.d.ts.map +1 -0
  830. package/dist/site/site-json.js +113 -0
  831. package/dist/site/site-json.js.map +1 -0
  832. package/dist/{admin/accounts.d.ts → site/users.d.ts} +25 -41
  833. package/dist/site/users.d.ts.map +1 -0
  834. package/dist/{admin/accounts.js → site/users.js} +49 -155
  835. package/dist/site/users.js.map +1 -0
  836. package/dist/store/admin-store.d.ts +72 -0
  837. package/dist/store/admin-store.d.ts.map +1 -0
  838. package/dist/store/admin-store.js +62 -0
  839. package/dist/store/admin-store.js.map +1 -0
  840. package/dist/store/comments.d.ts +253 -0
  841. package/dist/store/comments.d.ts.map +1 -0
  842. package/dist/store/comments.js +234 -0
  843. package/dist/store/comments.js.map +1 -0
  844. package/dist/store/conversation.d.ts +28 -0
  845. package/dist/store/conversation.d.ts.map +1 -0
  846. package/dist/store/conversation.js +16 -0
  847. package/dist/store/conversation.js.map +1 -0
  848. package/dist/store/deliveries.d.ts +92 -0
  849. package/dist/store/deliveries.d.ts.map +1 -0
  850. package/dist/store/deliveries.js +88 -0
  851. package/dist/store/deliveries.js.map +1 -0
  852. package/dist/store/followers.d.ts +91 -0
  853. package/dist/store/followers.d.ts.map +1 -0
  854. package/dist/store/followers.js +79 -0
  855. package/dist/store/followers.js.map +1 -0
  856. package/dist/{federation/replies.d.ts → store/inbox-replies.d.ts} +2 -2
  857. package/dist/store/inbox-replies.d.ts.map +1 -0
  858. package/dist/{federation/replies.js → store/inbox-replies.js} +2 -4
  859. package/dist/store/inbox-replies.js.map +1 -0
  860. package/dist/store/inbox.d.ts +132 -0
  861. package/dist/store/inbox.d.ts.map +1 -0
  862. package/dist/store/inbox.js +157 -0
  863. package/dist/store/inbox.js.map +1 -0
  864. package/dist/store/profiles.d.ts +49 -0
  865. package/dist/store/profiles.d.ts.map +1 -0
  866. package/dist/store/profiles.js +71 -0
  867. package/dist/store/profiles.js.map +1 -0
  868. package/dist/store/relays.d.ts +66 -0
  869. package/dist/store/relays.d.ts.map +1 -0
  870. package/dist/store/relays.js +69 -0
  871. package/dist/store/relays.js.map +1 -0
  872. package/dist/store/rows.d.ts +33 -0
  873. package/dist/store/rows.d.ts.map +1 -0
  874. package/dist/store/rows.js +44 -0
  875. package/dist/store/rows.js.map +1 -0
  876. package/dist/store/schema.d.ts +14 -0
  877. package/dist/store/schema.d.ts.map +1 -0
  878. package/dist/store/schema.js +588 -0
  879. package/dist/store/schema.js.map +1 -0
  880. package/dist/store/sessions.d.ts +90 -0
  881. package/dist/store/sessions.d.ts.map +1 -0
  882. package/dist/store/sessions.js +107 -0
  883. package/dist/store/sessions.js.map +1 -0
  884. package/dist/store/state.d.ts +18 -0
  885. package/dist/store/state.d.ts.map +1 -0
  886. package/dist/store/state.js +19 -0
  887. package/dist/store/state.js.map +1 -0
  888. package/dist/store/tokens.d.ts +75 -0
  889. package/dist/store/tokens.d.ts.map +1 -0
  890. package/dist/store/tokens.js +82 -0
  891. package/dist/store/tokens.js.map +1 -0
  892. package/dist/store/webmentions.d.ts +66 -0
  893. package/dist/store/webmentions.d.ts.map +1 -0
  894. package/dist/store/webmentions.js +84 -0
  895. package/dist/store/webmentions.js.map +1 -0
  896. package/dist/supervisor/primary.d.ts +1 -1
  897. package/dist/supervisor/primary.d.ts.map +1 -1
  898. package/dist/supervisor/primary.js +31 -11
  899. package/dist/supervisor/primary.js.map +1 -1
  900. package/dist/supervisor/worker.d.ts +6 -2
  901. package/dist/supervisor/worker.d.ts.map +1 -1
  902. package/dist/supervisor/worker.js +4 -4
  903. package/dist/supervisor/worker.js.map +1 -1
  904. package/dist/testing.d.ts +8 -0
  905. package/dist/testing.d.ts.map +1 -0
  906. package/dist/testing.js +6 -0
  907. package/dist/testing.js.map +1 -0
  908. package/dist/{web → theme}/assets.d.ts +1 -32
  909. package/dist/theme/assets.d.ts.map +1 -0
  910. package/dist/{web → theme}/assets.js +2 -100
  911. package/dist/theme/assets.js.map +1 -0
  912. package/dist/theme/site-data.d.ts +187 -0
  913. package/dist/theme/site-data.d.ts.map +1 -0
  914. package/dist/theme/site-data.js +160 -0
  915. package/dist/theme/site-data.js.map +1 -0
  916. package/dist/{web → theme}/templates.d.ts +2 -0
  917. package/dist/theme/templates.d.ts.map +1 -0
  918. package/dist/{web → theme}/templates.js +9 -32
  919. package/dist/theme/templates.js.map +1 -0
  920. package/dist/{web → theme}/themes.d.ts +1 -0
  921. package/dist/theme/themes.d.ts.map +1 -0
  922. package/dist/{web → theme}/themes.js +6 -3
  923. package/dist/theme/themes.js.map +1 -0
  924. package/dist/util/client-id.d.ts.map +1 -0
  925. package/dist/util/client-id.js.map +1 -0
  926. package/dist/util/clock.d.ts +9 -0
  927. package/dist/util/clock.d.ts.map +1 -0
  928. package/dist/util/clock.js +2 -0
  929. package/dist/util/clock.js.map +1 -0
  930. package/dist/util/errors.d.ts +3 -0
  931. package/dist/util/errors.d.ts.map +1 -0
  932. package/dist/util/errors.js +5 -0
  933. package/dist/util/errors.js.map +1 -0
  934. package/dist/util/files.d.ts +5 -0
  935. package/dist/util/files.d.ts.map +1 -0
  936. package/dist/util/files.js +38 -0
  937. package/dist/util/files.js.map +1 -0
  938. package/dist/util/forms.d.ts +5 -0
  939. package/dist/util/forms.d.ts.map +1 -0
  940. package/dist/util/forms.js +17 -0
  941. package/dist/util/forms.js.map +1 -0
  942. package/dist/util/guards.d.ts +4 -0
  943. package/dist/util/guards.d.ts.map +1 -0
  944. package/dist/util/guards.js +12 -0
  945. package/dist/util/guards.js.map +1 -0
  946. package/dist/{webmention/html.d.ts → util/html-tree.d.ts} +2 -2
  947. package/dist/util/html-tree.d.ts.map +1 -0
  948. package/dist/{webmention/html.js → util/html-tree.js} +3 -64
  949. package/dist/util/html-tree.js.map +1 -0
  950. package/dist/util/html.d.ts +4 -0
  951. package/dist/util/html.d.ts.map +1 -0
  952. package/dist/util/html.js +34 -0
  953. package/dist/util/html.js.map +1 -0
  954. package/dist/util/public-address.d.ts.map +1 -0
  955. package/dist/util/public-address.js.map +1 -0
  956. package/dist/util/queue.d.ts +7 -0
  957. package/dist/util/queue.d.ts.map +1 -0
  958. package/dist/util/queue.js +23 -0
  959. package/dist/util/queue.js.map +1 -0
  960. package/dist/util/retry.d.ts +11 -0
  961. package/dist/util/retry.d.ts.map +1 -0
  962. package/dist/util/retry.js +14 -0
  963. package/dist/util/retry.js.map +1 -0
  964. package/dist/util/url.d.ts +11 -0
  965. package/dist/util/url.d.ts.map +1 -0
  966. package/dist/util/url.js +20 -0
  967. package/dist/util/url.js.map +1 -0
  968. package/dist/web/absolute-urls.js +1 -1
  969. package/dist/web/absolute-urls.js.map +1 -1
  970. package/dist/web/archive.js +2 -2
  971. package/dist/web/archive.js.map +1 -1
  972. package/dist/web/asset-routes.d.ts +48 -0
  973. package/dist/web/asset-routes.d.ts.map +1 -0
  974. package/dist/web/asset-routes.js +107 -0
  975. package/dist/web/asset-routes.js.map +1 -0
  976. package/dist/{avatars/routes.d.ts → web/avatar-routes.d.ts} +2 -2
  977. package/dist/web/avatar-routes.d.ts.map +1 -0
  978. package/dist/{avatars/routes.js → web/avatar-routes.js} +3 -3
  979. package/dist/web/avatar-routes.js.map +1 -0
  980. package/dist/web/comment-routes.d.ts +18 -0
  981. package/dist/web/comment-routes.d.ts.map +1 -0
  982. package/dist/web/comment-routes.js +177 -0
  983. package/dist/web/comment-routes.js.map +1 -0
  984. package/dist/web/compression.d.ts.map +1 -1
  985. package/dist/web/compression.js +1 -2
  986. package/dist/web/compression.js.map +1 -1
  987. package/dist/{contact/routes.d.ts → web/contact-routes.d.ts} +2 -2
  988. package/dist/web/contact-routes.d.ts.map +1 -0
  989. package/dist/{contact/routes.js → web/contact-routes.js} +14 -17
  990. package/dist/web/contact-routes.js.map +1 -0
  991. package/dist/web/context.d.ts +1 -187
  992. package/dist/web/context.d.ts.map +1 -1
  993. package/dist/web/context.js +5 -171
  994. package/dist/web/context.js.map +1 -1
  995. package/dist/web/conversation.d.ts +6 -333
  996. package/dist/web/conversation.d.ts.map +1 -1
  997. package/dist/web/conversation.js +280 -220
  998. package/dist/web/conversation.js.map +1 -1
  999. package/dist/web/document-page.d.ts +13 -0
  1000. package/dist/web/document-page.d.ts.map +1 -0
  1001. package/dist/web/document-page.js +136 -0
  1002. package/dist/web/document-page.js.map +1 -0
  1003. package/dist/web/document-site.d.ts +14 -0
  1004. package/dist/web/document-site.d.ts.map +1 -0
  1005. package/dist/web/document-site.js +28 -0
  1006. package/dist/web/document-site.js.map +1 -0
  1007. package/dist/web/embed.d.ts +13 -0
  1008. package/dist/web/embed.d.ts.map +1 -0
  1009. package/dist/web/embed.js +66 -0
  1010. package/dist/web/embed.js.map +1 -0
  1011. package/dist/{env.d.ts → web/env.d.ts} +27 -26
  1012. package/dist/web/env.d.ts.map +1 -0
  1013. package/dist/web/env.js.map +1 -0
  1014. package/dist/web/federation-routes.d.ts +33 -0
  1015. package/dist/web/federation-routes.d.ts.map +1 -0
  1016. package/dist/web/federation-routes.js +280 -0
  1017. package/dist/web/federation-routes.js.map +1 -0
  1018. package/dist/web/feed-atom.d.ts.map +1 -1
  1019. package/dist/web/feed-atom.js +4 -3
  1020. package/dist/web/feed-atom.js.map +1 -1
  1021. package/dist/web/feed-item.d.ts +4 -39
  1022. package/dist/web/feed-item.d.ts.map +1 -1
  1023. package/dist/web/feed-item.js +8 -72
  1024. package/dist/web/feed-item.js.map +1 -1
  1025. package/dist/web/feed-json.js +2 -2
  1026. package/dist/web/feed-json.js.map +1 -1
  1027. package/dist/web/feed-routes.d.ts +36 -0
  1028. package/dist/web/feed-routes.d.ts.map +1 -0
  1029. package/dist/web/feed-routes.js +124 -0
  1030. package/dist/web/feed-routes.js.map +1 -0
  1031. package/dist/web/feed-rss.d.ts.map +1 -1
  1032. package/dist/web/feed-rss.js +9 -6
  1033. package/dist/web/feed-rss.js.map +1 -1
  1034. package/dist/web/feed-source.d.ts +13 -40
  1035. package/dist/web/feed-source.d.ts.map +1 -1
  1036. package/dist/web/feed-source.js +14 -43
  1037. package/dist/web/feed-source.js.map +1 -1
  1038. package/dist/web/feeds.d.ts +4 -2
  1039. package/dist/web/feeds.d.ts.map +1 -1
  1040. package/dist/web/feeds.js +8 -5
  1041. package/dist/web/feeds.js.map +1 -1
  1042. package/dist/web/health.d.ts +1 -1
  1043. package/dist/web/health.d.ts.map +1 -1
  1044. package/dist/web/index.d.ts +53 -29
  1045. package/dist/web/index.d.ts.map +1 -1
  1046. package/dist/web/index.js +37 -18
  1047. package/dist/web/index.js.map +1 -1
  1048. package/dist/{indieauth/activity-log.d.ts → web/indieauth-activity-log.d.ts} +3 -3
  1049. package/dist/web/indieauth-activity-log.d.ts.map +1 -0
  1050. package/dist/{indieauth/activity-log.js → web/indieauth-activity-log.js} +5 -6
  1051. package/dist/web/indieauth-activity-log.js.map +1 -0
  1052. package/dist/{indieauth/bearer.d.ts → web/indieauth-bearer.d.ts} +5 -5
  1053. package/dist/web/indieauth-bearer.d.ts.map +1 -0
  1054. package/dist/{indieauth/bearer.js → web/indieauth-bearer.js} +4 -4
  1055. package/dist/web/indieauth-bearer.js.map +1 -0
  1056. package/dist/{indieauth/discovery.d.ts → web/indieauth-discovery.d.ts} +2 -7
  1057. package/dist/web/indieauth-discovery.d.ts.map +1 -0
  1058. package/dist/{indieauth/discovery.js → web/indieauth-discovery.js} +6 -9
  1059. package/dist/web/indieauth-discovery.js.map +1 -0
  1060. package/dist/{indieauth/token.d.ts → web/indieauth-token.d.ts} +2 -2
  1061. package/dist/web/indieauth-token.d.ts.map +1 -0
  1062. package/dist/{indieauth/token.js → web/indieauth-token.js} +7 -7
  1063. package/dist/web/indieauth-token.js.map +1 -0
  1064. package/dist/web/listing-pages.d.ts +19 -0
  1065. package/dist/web/listing-pages.d.ts.map +1 -0
  1066. package/dist/web/listing-pages.js +148 -0
  1067. package/dist/web/listing-pages.js.map +1 -0
  1068. package/dist/web/listing-subject.d.ts +58 -0
  1069. package/dist/web/listing-subject.d.ts.map +1 -0
  1070. package/dist/web/listing-subject.js +89 -0
  1071. package/dist/web/listing-subject.js.map +1 -0
  1072. package/dist/web/llms.d.ts +16 -15
  1073. package/dist/web/llms.d.ts.map +1 -1
  1074. package/dist/web/llms.js +23 -35
  1075. package/dist/web/llms.js.map +1 -1
  1076. package/dist/web/maintenance.d.ts +1 -1
  1077. package/dist/web/maintenance.d.ts.map +1 -1
  1078. package/dist/web/maintenance.js +7 -13
  1079. package/dist/web/maintenance.js.map +1 -1
  1080. package/dist/web/manifest.d.ts +1 -1
  1081. package/dist/web/manifest.d.ts.map +1 -1
  1082. package/dist/web/manifest.js +2 -1
  1083. package/dist/web/manifest.js.map +1 -1
  1084. package/dist/web/markdown-page.d.ts +76 -0
  1085. package/dist/web/markdown-page.d.ts.map +1 -0
  1086. package/dist/web/markdown-page.js +79 -0
  1087. package/dist/web/markdown-page.js.map +1 -0
  1088. package/dist/web/markdown-representation.d.ts +15 -0
  1089. package/dist/web/markdown-representation.d.ts.map +1 -0
  1090. package/dist/web/markdown-representation.js +130 -0
  1091. package/dist/web/markdown-representation.js.map +1 -0
  1092. package/dist/web/negotiate.d.ts +5 -12
  1093. package/dist/web/negotiate.d.ts.map +1 -1
  1094. package/dist/web/negotiate.js +11 -18
  1095. package/dist/web/negotiate.js.map +1 -1
  1096. package/dist/{notifications/routes.d.ts → web/notification-routes.d.ts} +2 -2
  1097. package/dist/web/notification-routes.d.ts.map +1 -0
  1098. package/dist/{notifications/routes.js → web/notification-routes.js} +24 -29
  1099. package/dist/web/notification-routes.js.map +1 -0
  1100. package/dist/web/oembed.d.ts +2 -2
  1101. package/dist/web/oembed.d.ts.map +1 -1
  1102. package/dist/web/oembed.js +5 -4
  1103. package/dist/web/oembed.js.map +1 -1
  1104. package/dist/web/opensearch.d.ts.map +1 -1
  1105. package/dist/web/opensearch.js +2 -1
  1106. package/dist/web/opensearch.js.map +1 -1
  1107. package/dist/web/page-sources.d.ts +15 -0
  1108. package/dist/web/page-sources.d.ts.map +1 -0
  1109. package/dist/web/page-sources.js +44 -0
  1110. package/dist/web/page-sources.js.map +1 -0
  1111. package/dist/web/pagination.d.ts +1 -0
  1112. package/dist/web/pagination.d.ts.map +1 -1
  1113. package/dist/web/pagination.js +4 -1
  1114. package/dist/web/pagination.js.map +1 -1
  1115. package/dist/web/paths.d.ts +52 -0
  1116. package/dist/web/paths.d.ts.map +1 -0
  1117. package/dist/web/paths.js +208 -0
  1118. package/dist/web/paths.js.map +1 -0
  1119. package/dist/web/pingback-routes.d.ts +5 -0
  1120. package/dist/web/pingback-routes.d.ts.map +1 -0
  1121. package/dist/web/pingback-routes.js +100 -0
  1122. package/dist/web/pingback-routes.js.map +1 -0
  1123. package/dist/{plugins/federation.d.ts → web/plugin-federation.d.ts} +3 -3
  1124. package/dist/web/plugin-federation.d.ts.map +1 -0
  1125. package/dist/{plugins/federation.js → web/plugin-federation.js} +5 -5
  1126. package/dist/web/plugin-federation.js.map +1 -0
  1127. package/dist/{plugins/mount.d.ts → web/plugin-routes.d.ts} +3 -3
  1128. package/dist/web/plugin-routes.d.ts.map +1 -0
  1129. package/dist/{plugins/mount.js → web/plugin-routes.js} +2 -2
  1130. package/dist/web/plugin-routes.js.map +1 -0
  1131. package/dist/web/redirects.d.ts +1 -84
  1132. package/dist/web/redirects.d.ts.map +1 -1
  1133. package/dist/web/redirects.js +0 -232
  1134. package/dist/web/redirects.js.map +1 -1
  1135. package/dist/web/render.d.ts +43 -7
  1136. package/dist/web/render.d.ts.map +1 -1
  1137. package/dist/web/render.js +96 -48
  1138. package/dist/web/render.js.map +1 -1
  1139. package/dist/web/request.d.ts +44 -0
  1140. package/dist/web/request.d.ts.map +1 -0
  1141. package/dist/web/request.js +82 -0
  1142. package/dist/web/request.js.map +1 -0
  1143. package/dist/web/robots.d.ts +1 -46
  1144. package/dist/web/robots.d.ts.map +1 -1
  1145. package/dist/web/robots.js +5 -131
  1146. package/dist/web/robots.js.map +1 -1
  1147. package/dist/web/routes.d.ts +5 -39
  1148. package/dist/web/routes.d.ts.map +1 -1
  1149. package/dist/web/routes.js +112 -1373
  1150. package/dist/web/routes.js.map +1 -1
  1151. package/dist/web/search.d.ts.map +1 -1
  1152. package/dist/web/search.js +2 -9
  1153. package/dist/web/search.js.map +1 -1
  1154. package/dist/{admin → web}/session.d.ts +1 -5
  1155. package/dist/web/session.d.ts.map +1 -0
  1156. package/dist/{admin → web}/session.js +0 -4
  1157. package/dist/web/session.js.map +1 -0
  1158. package/dist/web/share-image.d.ts.map +1 -1
  1159. package/dist/web/share-image.js +3 -2
  1160. package/dist/web/share-image.js.map +1 -1
  1161. package/dist/web/signed-in.d.ts +27 -0
  1162. package/dist/web/signed-in.d.ts.map +1 -0
  1163. package/dist/web/signed-in.js +45 -0
  1164. package/dist/web/signed-in.js.map +1 -0
  1165. package/dist/web/site-index.d.ts +13 -0
  1166. package/dist/web/site-index.d.ts.map +1 -0
  1167. package/dist/web/site-index.js +143 -0
  1168. package/dist/web/site-index.js.map +1 -0
  1169. package/dist/web/site-view.d.ts +45 -0
  1170. package/dist/web/site-view.d.ts.map +1 -0
  1171. package/dist/web/site-view.js +67 -0
  1172. package/dist/web/site-view.js.map +1 -0
  1173. package/dist/web/sitemap.d.ts.map +1 -1
  1174. package/dist/web/sitemap.js +5 -7
  1175. package/dist/web/sitemap.js.map +1 -1
  1176. package/dist/{admin → web}/throttle.d.ts +3 -4
  1177. package/dist/web/throttle.d.ts.map +1 -0
  1178. package/dist/{admin → web}/throttle.js +1 -2
  1179. package/dist/web/throttle.js.map +1 -0
  1180. package/dist/web/webmention-routes.d.ts +11 -0
  1181. package/dist/web/webmention-routes.d.ts.map +1 -0
  1182. package/dist/web/webmention-routes.js +51 -0
  1183. package/dist/web/webmention-routes.js.map +1 -0
  1184. package/dist/web/well-known.d.ts +2 -2
  1185. package/dist/web/well-known.d.ts.map +1 -1
  1186. package/dist/web/well-known.js +5 -14
  1187. package/dist/web/well-known.js.map +1 -1
  1188. package/dist/webmention/cited-picture.d.ts +1 -2
  1189. package/dist/webmention/cited-picture.d.ts.map +1 -1
  1190. package/dist/webmention/cited-picture.js +4 -6
  1191. package/dist/webmention/cited-picture.js.map +1 -1
  1192. package/dist/webmention/discovery.d.ts +2 -13
  1193. package/dist/webmention/discovery.d.ts.map +1 -1
  1194. package/dist/webmention/discovery.js +18 -73
  1195. package/dist/webmention/discovery.js.map +1 -1
  1196. package/dist/webmention/endpoint.d.ts +27 -0
  1197. package/dist/webmention/endpoint.d.ts.map +1 -0
  1198. package/dist/webmention/endpoint.js +26 -0
  1199. package/dist/webmention/endpoint.js.map +1 -0
  1200. package/dist/webmention/fetch-public.d.ts +18 -1
  1201. package/dist/webmention/fetch-public.d.ts.map +1 -1
  1202. package/dist/webmention/fetch-public.js +57 -23
  1203. package/dist/webmention/fetch-public.js.map +1 -1
  1204. package/dist/webmention/index.d.ts +11 -9
  1205. package/dist/webmention/index.d.ts.map +1 -1
  1206. package/dist/webmention/index.js +7 -6
  1207. package/dist/webmention/index.js.map +1 -1
  1208. package/dist/webmention/links.d.ts +0 -55
  1209. package/dist/webmention/links.d.ts.map +1 -1
  1210. package/dist/webmention/links.js +2 -185
  1211. package/dist/webmention/links.js.map +1 -1
  1212. package/dist/webmention/microformats.d.ts +1 -1
  1213. package/dist/webmention/microformats.d.ts.map +1 -1
  1214. package/dist/webmention/microformats.js +1 -1
  1215. package/dist/webmention/microformats.js.map +1 -1
  1216. package/dist/webmention/pingback.d.ts +12 -4
  1217. package/dist/webmention/pingback.d.ts.map +1 -1
  1218. package/dist/webmention/pingback.js +4 -102
  1219. package/dist/webmention/pingback.js.map +1 -1
  1220. package/dist/webmention/receive.d.ts +7 -4
  1221. package/dist/webmention/receive.d.ts.map +1 -1
  1222. package/dist/webmention/receive.js +34 -42
  1223. package/dist/webmention/receive.js.map +1 -1
  1224. package/dist/webmention/reply-context/fediverse.d.ts +29 -0
  1225. package/dist/webmention/reply-context/fediverse.d.ts.map +1 -0
  1226. package/dist/webmention/reply-context/fediverse.js +59 -0
  1227. package/dist/webmention/reply-context/fediverse.js.map +1 -0
  1228. package/dist/webmention/reply-context/json-ld.d.ts +5 -0
  1229. package/dist/webmention/reply-context/json-ld.d.ts.map +1 -0
  1230. package/dist/webmention/reply-context/json-ld.js +78 -0
  1231. package/dist/webmention/reply-context/json-ld.js.map +1 -0
  1232. package/dist/webmention/reply-context/oembed.d.ts +21 -0
  1233. package/dist/webmention/reply-context/oembed.d.ts.map +1 -0
  1234. package/dist/webmention/reply-context/oembed.js +137 -0
  1235. package/dist/webmention/reply-context/oembed.js.map +1 -0
  1236. package/dist/webmention/reply-context/page.d.ts +30 -0
  1237. package/dist/webmention/reply-context/page.d.ts.map +1 -0
  1238. package/dist/webmention/reply-context/page.js +134 -0
  1239. package/dist/webmention/reply-context/page.js.map +1 -0
  1240. package/dist/webmention/reply-context/source.d.ts +29 -0
  1241. package/dist/webmention/reply-context/source.d.ts.map +1 -0
  1242. package/dist/webmention/reply-context/source.js +46 -0
  1243. package/dist/webmention/reply-context/source.js.map +1 -0
  1244. package/dist/webmention/reply-context.d.ts +5 -34
  1245. package/dist/webmention/reply-context.d.ts.map +1 -1
  1246. package/dist/webmention/reply-context.js +9 -432
  1247. package/dist/webmention/reply-context.js.map +1 -1
  1248. package/dist/webmention/reply-contexts.d.ts +3 -3
  1249. package/dist/webmention/reply-contexts.d.ts.map +1 -1
  1250. package/dist/webmention/reply-contexts.js +7 -10
  1251. package/dist/webmention/reply-contexts.js.map +1 -1
  1252. package/dist/webmention/routes.d.ts +1 -1
  1253. package/dist/webmention/routes.d.ts.map +1 -1
  1254. package/dist/webmention/routes.js +5 -8
  1255. package/dist/webmention/routes.js.map +1 -1
  1256. package/dist/webmention/service.d.ts +7 -7
  1257. package/dist/webmention/service.d.ts.map +1 -1
  1258. package/dist/webmention/service.js +49 -61
  1259. package/dist/webmention/service.js.map +1 -1
  1260. package/dist/webmention/syndication.d.ts +3 -26
  1261. package/dist/webmention/syndication.d.ts.map +1 -1
  1262. package/dist/webmention/syndication.js +6 -20
  1263. package/dist/webmention/syndication.js.map +1 -1
  1264. package/package.json +5 -1
  1265. package/themes/default/README.md +36 -2329
  1266. package/themes/default/layouts/base.njk +5 -4
  1267. package/themes/default/layouts/comment.njk +3 -3
  1268. package/themes/default/layouts/front-page.njk +4 -3
  1269. package/themes/default/layouts/page.njk +2 -0
  1270. package/themes/default/partials/comment-form.njk +1 -1
  1271. package/themes/default/partials/comment.njk +5 -5
  1272. package/themes/default/partials/contact-form.njk +1 -2
  1273. package/themes/default/partials/conversation.njk +1 -2
  1274. package/themes/default/partials/markdown-footer.md.njk +24 -0
  1275. package/themes/default/partials/markdown-header.md.njk +31 -0
  1276. package/themes/default/src/style.css +6 -6
  1277. package/dist/admin/accounts.d.ts.map +0 -1
  1278. package/dist/admin/accounts.js.map +0 -1
  1279. package/dist/admin/admin-theme.d.ts.map +0 -1
  1280. package/dist/admin/admin-theme.js.map +0 -1
  1281. package/dist/admin/enclosure-field.d.ts.map +0 -1
  1282. package/dist/admin/enclosure-field.js.map +0 -1
  1283. package/dist/admin/event-field.d.ts.map +0 -1
  1284. package/dist/admin/event-field.js.map +0 -1
  1285. package/dist/admin/location-field.d.ts +0 -27
  1286. package/dist/admin/location-field.d.ts.map +0 -1
  1287. package/dist/admin/location-field.js.map +0 -1
  1288. package/dist/admin/passwords.d.ts.map +0 -1
  1289. package/dist/admin/passwords.js.map +0 -1
  1290. package/dist/admin/photo-field.d.ts +0 -38
  1291. package/dist/admin/photo-field.d.ts.map +0 -1
  1292. package/dist/admin/photo-field.js.map +0 -1
  1293. package/dist/admin/read-field.d.ts.map +0 -1
  1294. package/dist/admin/read-field.js +0 -61
  1295. package/dist/admin/read-field.js.map +0 -1
  1296. package/dist/admin/session.d.ts.map +0 -1
  1297. package/dist/admin/session.js.map +0 -1
  1298. package/dist/admin/store.d.ts +0 -998
  1299. package/dist/admin/store.d.ts.map +0 -1
  1300. package/dist/admin/store.js +0 -1588
  1301. package/dist/admin/store.js.map +0 -1
  1302. package/dist/admin/throttle.d.ts.map +0 -1
  1303. package/dist/admin/throttle.js.map +0 -1
  1304. package/dist/avatars/routes.d.ts.map +0 -1
  1305. package/dist/avatars/routes.js.map +0 -1
  1306. package/dist/contact/routes.d.ts.map +0 -1
  1307. package/dist/contact/routes.js.map +0 -1
  1308. package/dist/env.d.ts.map +0 -1
  1309. package/dist/env.js.map +0 -1
  1310. package/dist/federation/replies.d.ts.map +0 -1
  1311. package/dist/federation/replies.js.map +0 -1
  1312. package/dist/images/alt-text.d.ts.map +0 -1
  1313. package/dist/images/alt-text.js.map +0 -1
  1314. package/dist/indieauth/activity-log.d.ts.map +0 -1
  1315. package/dist/indieauth/activity-log.js.map +0 -1
  1316. package/dist/indieauth/app-activity.d.ts.map +0 -1
  1317. package/dist/indieauth/app-activity.js.map +0 -1
  1318. package/dist/indieauth/bearer.d.ts.map +0 -1
  1319. package/dist/indieauth/bearer.js.map +0 -1
  1320. package/dist/indieauth/client-id.d.ts.map +0 -1
  1321. package/dist/indieauth/client-id.js.map +0 -1
  1322. package/dist/indieauth/connected-apps.d.ts.map +0 -1
  1323. package/dist/indieauth/connected-apps.js.map +0 -1
  1324. package/dist/indieauth/consent.d.ts.map +0 -1
  1325. package/dist/indieauth/consent.js.map +0 -1
  1326. package/dist/indieauth/discovery.d.ts.map +0 -1
  1327. package/dist/indieauth/discovery.js.map +0 -1
  1328. package/dist/indieauth/token.d.ts.map +0 -1
  1329. package/dist/indieauth/token.js.map +0 -1
  1330. package/dist/mail/service.d.ts.map +0 -1
  1331. package/dist/mail/service.js.map +0 -1
  1332. package/dist/mail/templates.d.ts.map +0 -1
  1333. package/dist/mail/templates.js.map +0 -1
  1334. package/dist/notifications/preferences.d.ts.map +0 -1
  1335. package/dist/notifications/preferences.js.map +0 -1
  1336. package/dist/notifications/routes.d.ts.map +0 -1
  1337. package/dist/notifications/routes.js.map +0 -1
  1338. package/dist/plugins/federation.d.ts.map +0 -1
  1339. package/dist/plugins/federation.js.map +0 -1
  1340. package/dist/plugins/mount.d.ts.map +0 -1
  1341. package/dist/plugins/mount.js.map +0 -1
  1342. package/dist/privacy/policy.d.ts.map +0 -1
  1343. package/dist/privacy/policy.js.map +0 -1
  1344. package/dist/web/admin-bar.d.ts.map +0 -1
  1345. package/dist/web/admin-bar.js.map +0 -1
  1346. package/dist/web/assets.d.ts.map +0 -1
  1347. package/dist/web/assets.js.map +0 -1
  1348. package/dist/web/authors.d.ts.map +0 -1
  1349. package/dist/web/authors.js +0 -211
  1350. package/dist/web/authors.js.map +0 -1
  1351. package/dist/web/documents.d.ts +0 -81
  1352. package/dist/web/documents.d.ts.map +0 -1
  1353. package/dist/web/documents.js.map +0 -1
  1354. package/dist/web/errors.d.ts.map +0 -1
  1355. package/dist/web/errors.js.map +0 -1
  1356. package/dist/web/guids.d.ts.map +0 -1
  1357. package/dist/web/guids.js.map +0 -1
  1358. package/dist/web/indexnow.d.ts.map +0 -1
  1359. package/dist/web/indexnow.js.map +0 -1
  1360. package/dist/web/license.d.ts.map +0 -1
  1361. package/dist/web/license.js.map +0 -1
  1362. package/dist/web/locale.d.ts.map +0 -1
  1363. package/dist/web/locale.js.map +0 -1
  1364. package/dist/web/navigation.d.ts.map +0 -1
  1365. package/dist/web/navigation.js.map +0 -1
  1366. package/dist/web/recent.d.ts +0 -43
  1367. package/dist/web/recent.d.ts.map +0 -1
  1368. package/dist/web/recent.js +0 -37
  1369. package/dist/web/recent.js.map +0 -1
  1370. package/dist/web/sanitize.d.ts +0 -29
  1371. package/dist/web/sanitize.d.ts.map +0 -1
  1372. package/dist/web/sanitize.js.map +0 -1
  1373. package/dist/web/taxonomy.d.ts.map +0 -1
  1374. package/dist/web/taxonomy.js.map +0 -1
  1375. package/dist/web/templates.d.ts.map +0 -1
  1376. package/dist/web/templates.js.map +0 -1
  1377. package/dist/web/themes.d.ts.map +0 -1
  1378. package/dist/web/themes.js.map +0 -1
  1379. package/dist/webmention/html.d.ts.map +0 -1
  1380. package/dist/webmention/html.js.map +0 -1
  1381. package/dist/webmention/public-address.d.ts.map +0 -1
  1382. package/dist/webmention/public-address.js.map +0 -1
  1383. /package/dist/{web → content}/license.d.ts +0 -0
  1384. /package/dist/{web → content}/license.js +0 -0
  1385. /package/dist/{admin → site}/admin-theme.d.ts +0 -0
  1386. /package/dist/{admin → site}/admin-theme.js +0 -0
  1387. /package/dist/{admin → site}/passwords.d.ts +0 -0
  1388. /package/dist/{admin → site}/passwords.js +0 -0
  1389. /package/dist/{indieauth → util}/client-id.d.ts +0 -0
  1390. /package/dist/{indieauth → util}/client-id.js +0 -0
  1391. /package/dist/{webmention → util}/public-address.d.ts +0 -0
  1392. /package/dist/{webmention → util}/public-address.js +0 -0
  1393. /package/dist/{env.js → web/env.js} +0 -0
@@ -1,42 +1,39 @@
1
- import { listUsers } from '../admin/accounts.js';
2
- import { readSiteSettings, robotsPolicyOf } from '../admin/settings.js';
3
- import { postLabel } from '../content/post-type.js';
4
- import { serializeDocument } from '../content/writer.js';
5
- import { mountAvatars } from '../avatars/routes.js';
6
- import { readAltTexts } from '../images/alt-text.js';
7
- import { FAVICON_FILE, iconSetting, siteIconSource } from '../images/icons.js';
8
- import { sourceVersion } from '../images/paths.js';
9
- import { findImageVariant, VARIANT_ASSET_PREFIX } from '../images/variants.js';
10
- import { ASSET_VERSION_PARAM, assetNotModified, assetRangeResponse, assetResponse, assetVersion, findThemeAsset, findUpload, IMMUTABLE_ASSET, matchesEtag, THEME_ASSET_PREFIX, UPLOAD_ASSET_MAX_AGE, UPLOAD_ASSET_PREFIX, } from './assets.js';
11
- import { COMMENT_NOTICE_PARAM, COMMENT_REPLY_PARAM } from '../comments/form.js';
12
- import { answerable, commentPolicyOf } from '../comments/policy.js';
13
- import { commentNoticeFor, commentReplyTarget, mountComments } from '../comments/routes.js';
14
- import { commenterOf } from '../comments/viewer.js';
15
- import { CONTACT_NOTICE_PARAM, contactNoticeFor } from '../contact/form.js';
16
- import { mountContact } from '../contact/routes.js';
17
- import { mountPingbacks, pingbackEndpointFor } from '../webmention/pingback.js';
18
- import { mountWebmentions, WEBMENTION_PATH } from '../webmention/routes.js';
19
- import { mountNotificationLinks } from '../notifications/routes.js';
20
- import { advertiseIdentityEndpoints } from '../indieauth/discovery.js';
21
- import { publicAdminBar } from './admin-bar.js';
22
- import { authorFeedHref, authorContext, authorHref, authorNames, parseAuthorPath, profileContext, siteAuthorContext, } from './authors.js';
23
- import { feedComments, spokenIn } from './conversation.js';
24
- import { COMMENT_PAGE_PREFIX } from './guids.js';
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 { EMBED_PATH, embedPage, embedResponse, OEMBED_PATH, oEmbedFor, oEmbedRequest, oEmbedResponse, } from './oembed.js';
35
- import { generatedLlmsTxt, llmsListingTxt, LLMS_TXT_LINK, LLMS_TXT_PATH, llmsTxtResponse, ownLlmsTxt, } from './llms.js';
36
- import { indexNowKeyPath, indexNowKeyResponse } from './indexnow.js';
37
- import { searchHref, searchJson, searchPageIndex, searchQuery, SEARCH_PAGE_PARAM, SEARCH_PATH, SEARCH_QUERY_PARAM, } from './search.js';
38
- import { findPathRedirect, findQueryRedirect, redirectLocation } from './redirects.js';
39
- import { PAGE_SEGMENT, redirectedTerm, taxonomyForSegment, termHref } from './taxonomy.js';
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
- // First, so every page below it, the 404 and the 500 included, is drawn
50
- // knowing whether a signed-in user is reading it (TASK-183).
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 = frontPages(c).home;
78
+ const home = siteView(c).pages.home;
83
79
  const response = home === undefined
84
- ? listing(c, { term: undefined, pageNumber: 0 })
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. Off is a 404; a file of the site's own wins over the
157
- // generated one.
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}${new URL(c.req.url).search}`, 301));
186
- // The taxonomy archives are deliberately not routes. A route table is fixed
187
- // when the app is built and the bases are a setting, so an archive is
188
- // resolved per request in the not-found handler, from the base the site
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 { search } = new URL(c.req.url);
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 { store, renderer } = c.var;
183
+ const view = siteView(c);
284
184
  const pathname = requestPath(c);
285
- const bases = renderer.taxonomyBases();
286
- const authors = authorsOf(c);
287
- const pages = frontPages(c);
288
- // The posts page carries the listing at its own URL, so it is answered
289
- // before the document lookup that would otherwise render it as the page it
290
- // also is. Its pagination hangs off it: `{permalink}page/2/`.
291
- if (pages.posts !== undefined) {
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 target.kind === 'listing'
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 canonicalRedirect = (candidate) => {
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
- // `/index.md` and `/index.json` are the front page's own
352
- // representations on a site whose `/` is a page: the document is at `/`
353
- // however it is asked for.
354
- const found = candidate === '/' ? pages.home : publicDocumentAt(store, candidate);
355
- const servesListing = found !== undefined && found.path === pages.posts?.path;
356
- if (found !== undefined && !servesListing) {
357
- const canonical = canonicalRedirect(candidate);
358
- if (canonical !== undefined)
359
- return c.redirect(canonical, 301);
360
- return negotiateDocument(c, found, extension.representation, candidate === '/' ? '/' : undefined);
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
- const formerly = movedHref(store, pages, pathname, undefined) ??
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(store, pages, candidate, extension.representation))
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 canonical = canonicalPath(c, pathname, bases, authors);
391
- if (canonical !== undefined)
392
- return c.redirect(canonical, 301);
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
- * Where the document that used to live at a URL lives now, in the
404
- * representation asked for, or `undefined` when no published document names
405
- * the URL in its `redirect_from` (TASK-127).
406
- */
407
- function movedHref(store, pages, pathname, representation) {
408
- const document = store.getByFormerPermalink(pathname);
409
- if (document === undefined)
410
- return undefined;
411
- const href = document.path === pages.home?.path ? '/' : encodePath(document.permalink);
412
- return representation === undefined ? href : representationHref(href, representation);
413
- }
414
- /**
415
- * One taxonomy archive, the redirect that puts it at its canonical URL, or
416
- * `undefined` when the path is not one.
417
- *
418
- * `/{base}/x/page/1/` collapses onto the archive root the way `/page/1/`
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 the post listing lives, or `undefined` when it has no page at all.
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
- * A site showing its latest posts has it at `/`; a site with a posts page has
797
- * it there; a site whose homepage is a page and which named no posts page has
798
- * nowhere for it, which is WordPress's own answer and the reason its Reading
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 listingRoot(pages) {
802
- if (pages.posts !== undefined)
803
- return pages.posts.permalink;
804
- return pages.home === undefined ? '/' : undefined;
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
- const page = pageIndex(segments[1]);
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 term = { taxonomy, term: asTheSiteSpellsIt(store, taxonomy, named) };
865
- if (segments.length === 2)
866
- return { term, pageNumber: 0 };
867
- if (segments.length === 4 && segments[2] === PAGE_SEGMENT) {
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