@geekity/cms 0.5.0 → 0.7.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 (172) hide show
  1. package/README.md +78 -24
  2. package/admin/pages/documents/editor.njk +13 -1
  3. package/admin/pages/navigation/menus.njk +8 -5
  4. package/admin/pages/users/edit.njk +25 -2
  5. package/admin/static/admin.css +18 -3
  6. package/dist/admin/accounts.d.ts +10 -0
  7. package/dist/admin/accounts.d.ts.map +1 -1
  8. package/dist/admin/accounts.js +15 -3
  9. package/dist/admin/accounts.js.map +1 -1
  10. package/dist/admin/comments.d.ts.map +1 -1
  11. package/dist/admin/comments.js +2 -1
  12. package/dist/admin/comments.js.map +1 -1
  13. package/dist/admin/documents.d.ts +3 -0
  14. package/dist/admin/documents.d.ts.map +1 -1
  15. package/dist/admin/documents.js +51 -11
  16. package/dist/admin/documents.js.map +1 -1
  17. package/dist/admin/federation.d.ts.map +1 -1
  18. package/dist/admin/federation.js +3 -2
  19. package/dist/admin/federation.js.map +1 -1
  20. package/dist/admin/preview.js +3 -0
  21. package/dist/admin/preview.js.map +1 -1
  22. package/dist/admin/routes.d.ts.map +1 -1
  23. package/dist/admin/routes.js +2 -1
  24. package/dist/admin/routes.js.map +1 -1
  25. package/dist/admin/users.d.ts +24 -0
  26. package/dist/admin/users.d.ts.map +1 -1
  27. package/dist/admin/users.js +102 -30
  28. package/dist/admin/users.js.map +1 -1
  29. package/dist/comments/submission.d.ts.map +1 -1
  30. package/dist/comments/submission.js +2 -1
  31. package/dist/comments/submission.js.map +1 -1
  32. package/dist/config.d.ts +10 -0
  33. package/dist/config.d.ts.map +1 -1
  34. package/dist/config.js +2 -0
  35. package/dist/config.js.map +1 -1
  36. package/dist/content/document.d.ts +18 -7
  37. package/dist/content/document.d.ts.map +1 -1
  38. package/dist/content/document.js +1 -0
  39. package/dist/content/document.js.map +1 -1
  40. package/dist/content/index.d.ts +2 -0
  41. package/dist/content/index.d.ts.map +1 -1
  42. package/dist/content/index.js +1 -0
  43. package/dist/content/index.js.map +1 -1
  44. package/dist/content/parser.d.ts.map +1 -1
  45. package/dist/content/parser.js +19 -1
  46. package/dist/content/parser.js.map +1 -1
  47. package/dist/content/post-type.d.ts +48 -0
  48. package/dist/content/post-type.d.ts.map +1 -0
  49. package/dist/content/post-type.js +79 -0
  50. package/dist/content/post-type.js.map +1 -0
  51. package/dist/content/store.d.ts.map +1 -1
  52. package/dist/content/store.js +17 -2
  53. package/dist/content/store.js.map +1 -1
  54. package/dist/content/sync.d.ts.map +1 -1
  55. package/dist/content/sync.js +6 -0
  56. package/dist/content/sync.js.map +1 -1
  57. package/dist/content/writer.d.ts +1 -1
  58. package/dist/content/writer.d.ts.map +1 -1
  59. package/dist/content/writer.js +9 -2
  60. package/dist/content/writer.js.map +1 -1
  61. package/dist/federation/article.d.ts +18 -9
  62. package/dist/federation/article.d.ts.map +1 -1
  63. package/dist/federation/article.js +87 -17
  64. package/dist/federation/article.js.map +1 -1
  65. package/dist/federation/index.d.ts +1 -1
  66. package/dist/federation/index.d.ts.map +1 -1
  67. package/dist/federation/index.js +1 -1
  68. package/dist/federation/index.js.map +1 -1
  69. package/dist/federation/mount.d.ts.map +1 -1
  70. package/dist/federation/mount.js +19 -6
  71. package/dist/federation/mount.js.map +1 -1
  72. package/dist/index.d.ts +13 -6
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +23 -4
  75. package/dist/index.js.map +1 -1
  76. package/dist/notifications/comments.d.ts.map +1 -1
  77. package/dist/notifications/comments.js +2 -1
  78. package/dist/notifications/comments.js.map +1 -1
  79. package/dist/notifications/digest.d.ts.map +1 -1
  80. package/dist/notifications/digest.js +2 -1
  81. package/dist/notifications/digest.js.map +1 -1
  82. package/dist/web/archive.d.ts +1 -1
  83. package/dist/web/archive.d.ts.map +1 -1
  84. package/dist/web/archive.js +2 -1
  85. package/dist/web/archive.js.map +1 -1
  86. package/dist/web/authors.d.ts +15 -1
  87. package/dist/web/authors.d.ts.map +1 -1
  88. package/dist/web/authors.js +9 -1
  89. package/dist/web/authors.js.map +1 -1
  90. package/dist/web/context.d.ts +22 -2
  91. package/dist/web/context.d.ts.map +1 -1
  92. package/dist/web/context.js +5 -0
  93. package/dist/web/context.js.map +1 -1
  94. package/dist/web/conversation.d.ts.map +1 -1
  95. package/dist/web/conversation.js +2 -1
  96. package/dist/web/conversation.js.map +1 -1
  97. package/dist/web/feed-atom.d.ts.map +1 -1
  98. package/dist/web/feed-atom.js +14 -2
  99. package/dist/web/feed-atom.js.map +1 -1
  100. package/dist/web/feed-item.d.ts +21 -7
  101. package/dist/web/feed-item.d.ts.map +1 -1
  102. package/dist/web/feed-item.js +13 -6
  103. package/dist/web/feed-item.js.map +1 -1
  104. package/dist/web/feed-json.d.ts +13 -2
  105. package/dist/web/feed-json.d.ts.map +1 -1
  106. package/dist/web/feed-json.js +3 -1
  107. package/dist/web/feed-json.js.map +1 -1
  108. package/dist/web/feed-rss.d.ts.map +1 -1
  109. package/dist/web/feed-rss.js +2 -2
  110. package/dist/web/feed-rss.js.map +1 -1
  111. package/dist/web/feed-xml.d.ts +2 -0
  112. package/dist/web/feed-xml.d.ts.map +1 -1
  113. package/dist/web/feed-xml.js +2 -0
  114. package/dist/web/feed-xml.js.map +1 -1
  115. package/dist/web/feeds.d.ts +1 -1
  116. package/dist/web/feeds.d.ts.map +1 -1
  117. package/dist/web/feeds.js.map +1 -1
  118. package/dist/web/index.d.ts +4 -4
  119. package/dist/web/index.d.ts.map +1 -1
  120. package/dist/web/index.js +1 -1
  121. package/dist/web/index.js.map +1 -1
  122. package/dist/web/navigation.d.ts +106 -28
  123. package/dist/web/navigation.d.ts.map +1 -1
  124. package/dist/web/navigation.js +135 -49
  125. package/dist/web/navigation.js.map +1 -1
  126. package/dist/web/render.d.ts +9 -0
  127. package/dist/web/render.d.ts.map +1 -1
  128. package/dist/web/render.js +19 -1
  129. package/dist/web/render.js.map +1 -1
  130. package/dist/web/routes.d.ts.map +1 -1
  131. package/dist/web/routes.js +2 -1
  132. package/dist/web/routes.js.map +1 -1
  133. package/dist/webmention/index.d.ts +6 -0
  134. package/dist/webmention/index.d.ts.map +1 -1
  135. package/dist/webmention/index.js +3 -0
  136. package/dist/webmention/index.js.map +1 -1
  137. package/dist/webmention/links.d.ts +5 -0
  138. package/dist/webmention/links.d.ts.map +1 -1
  139. package/dist/webmention/links.js +14 -7
  140. package/dist/webmention/links.js.map +1 -1
  141. package/dist/webmention/microformats.d.ts +21 -0
  142. package/dist/webmention/microformats.d.ts.map +1 -1
  143. package/dist/webmention/microformats.js +35 -5
  144. package/dist/webmention/microformats.js.map +1 -1
  145. package/dist/webmention/public-address.d.ts +30 -0
  146. package/dist/webmention/public-address.d.ts.map +1 -0
  147. package/dist/webmention/public-address.js +71 -0
  148. package/dist/webmention/public-address.js.map +1 -0
  149. package/dist/webmention/receive.d.ts.map +1 -1
  150. package/dist/webmention/receive.js +1 -23
  151. package/dist/webmention/receive.js.map +1 -1
  152. package/dist/webmention/reply-context.d.ts +67 -0
  153. package/dist/webmention/reply-context.d.ts.map +1 -0
  154. package/dist/webmention/reply-context.js +189 -0
  155. package/dist/webmention/reply-context.js.map +1 -0
  156. package/dist/webmention/reply-contexts.d.ts +50 -0
  157. package/dist/webmention/reply-contexts.d.ts.map +1 -0
  158. package/dist/webmention/reply-contexts.js +163 -0
  159. package/dist/webmention/reply-contexts.js.map +1 -0
  160. package/dist/webmention/service.d.ts.map +1 -1
  161. package/dist/webmention/service.js +9 -2
  162. package/dist/webmention/service.js.map +1 -1
  163. package/package.json +10 -10
  164. package/themes/default/README.md +25 -10
  165. package/themes/default/layouts/base.njk +5 -3
  166. package/themes/default/layouts/post.njk +8 -0
  167. package/themes/default/layouts/search.njk +4 -2
  168. package/themes/default/partials/bio.njk +5 -1
  169. package/themes/default/partials/menu.njk +6 -4
  170. package/themes/default/partials/post-list.njk +17 -5
  171. package/themes/default/partials/reply-context.njk +29 -0
  172. package/themes/default/static/style.css +28 -10
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC9F,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,mBAAmB,CA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a,CAAC;AACrB,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrF,YAAY,EAAE,gCAAgC,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,GACZ,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,U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,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrF,YAAY,EAAE,gCAAgC,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,GACZ,MAAM,aAAa,CAAC"}
package/dist/web/index.js CHANGED
@@ -6,7 +6,7 @@ export { commentAnchor, createConversation, feedComments, spokenIn } from './con
6
6
  export { activityStreamsId, isPublicDocument, postObjectId, publicDocumentAt, } from './documents.js';
7
7
  export { atomEntry, atomFeed, cdata, commentsFeedPath, commentsFeedResponse, commentsRssFeed, COMMENTS_ROOT, COMMENTS_TITLE_PREFIX, contentTypeOf, DC_NAMESPACE, DEFAULT_FEED_LANGUAGE, DEFAULT_FEED_SIZE, DEFAULT_NOTIFY_SERVER, escapeXml, excerptFromHtml, EXCERPT_WORDS, FEED_ALIASES, FEED_CONTENT_TYPES, FEED_FORMATS, FEED_GENERATOR, FEED_GENERATOR_URI, FEED_ITEM_REVISION, FEED_SEGMENT, FEED_SEGMENTS, feedExcerpt, feedItem, feedItems, feedLanguage, feedLinkHeader, feedPathUnder, feedResponse, feedSize, jsonFeed, jsonFeedItem, JSON_FEED_HUB_TYPE, JSON_FEED_VERSION, NOTIFY_CLOUD_PORT, NOTIFY_CLOUD_PROTOCOL, NOTIFY_PATHS, notifyEndpoints, notifyServerOf, rfc822, rssFeed, rssItem, SOURCE_NAMESPACE, splitFeedPath, WFW_NAMESPACE, } from './feeds.js';
8
8
  export { absoluteUrl, ACTIVITY_STREAMS_MEDIA_TYPES, alternateLinks, contentEtag, DOCUMENT_REPRESENTATIONS, documentJson, isNotModified, latestModified, JSON_SCHEMA_VERSION, lastModifiedOf, LISTING_REPRESENTATIONS, MEDIA_TYPES, notAcceptableResponse, parseAccept, prefersActivityStreams, representationEtag, representationHref, REPRESENTATION_EXTENSIONS, representationResponse, selectRepresentation, splitRepresentationExtension, } from './negotiate.js';
9
- export { DEFAULT_MENU_NAME, MENU_ITEM_FLAGS, MENU_NAME_MAX_LENGTH, MENU_NAME_PATTERN, menuItemLineProblem, menuItemOf, menuItemsFromText, menuItemsText, menuNameProblem, menusOf, navigationItems, navigationItemsOf, navigationMenu, navigationMenus, siteMenus, } from './navigation.js';
9
+ export { DEFAULT_MENU_NAME, isLinkUrl, LINK_REL_RULE, LINK_URL_RULE, MENU_NAME_MAX_LENGTH, MENU_NAME_PATTERN, menuItemLineProblem, menuItemOf, menuItemsFromText, menuItemsText, menuNameProblem, menusOf, navigationItems, navigationItemsOf, navigationMenu, navigationMenus, REL_VALUE_PATTERN, relText, relValuesOf, siteMenus, splitLinkRel, } from './navigation.js';
10
10
  export { HEALTH_PATH, mountHealth } from './health.js';
11
11
  export { offsetForPage, paginate } from './pagination.js';
12
12
  export { recentPosts, RECENT_POSTS, startOfMonth } from './recent.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,GACV,MAAM,cAAc,CAAC;AAStB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAa9F,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,EACT,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,aAAa,EACb,YAAY,EACZ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,EACR,QAAQ,EACR,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,GACT,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAErF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EA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BAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,GACT,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAErF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC"}
@@ -5,17 +5,64 @@ import type { SiteData } from './context.ts';
5
5
  */
6
6
  export declare const DEFAULT_MENU_NAME = "primary";
7
7
  /**
8
- * The flags one menu item may carry, as `site.json` spells them and as the
9
- * settings screen writes them at the end of a line.
8
+ * What one `rel` value may be spelled with: letters and dashes, which is what
9
+ * every HTML link type is spelled with.
10
10
  *
11
- * A flag is a word rather than a value, and the list is here rather than
12
- * spread through the parsers so that a second one — `nofollow`, say, or a flag
13
- * that opens a link in its own tab — is one entry and its handling in the
14
- * theme, not a new shape for an item.
11
+ * Deliberately not a list of the values this CMS knows about (TASK-114). The
12
+ * trailing part of a link line is whatever `rel` values the person typed —
13
+ * `me`, `nofollow`, `author`, `noopener`, one somebody's own reader looks for
14
+ * — and all of them reach the rendered attribute. A closed list would mean
15
+ * every value anybody wanted had to be added here first, and `me` was never a
16
+ * flag in the first place: it is a `rel` value that this CMS happened to be
17
+ * the only one to know.
15
18
  */
16
- export declare const MENU_ITEM_FLAGS: readonly ['me'];
17
- /** One of {@link MENU_ITEM_FLAGS}. */
18
- export type MenuItemFlag = (typeof MENU_ITEM_FLAGS)[number];
19
+ export declare const REL_VALUE_PATTERN: RegExp;
20
+ /**
21
+ * What a link line's trailing part may be, in the words both boxes explain it
22
+ * in, beside {@link LINK_URL_RULE}.
23
+ */
24
+ export declare const LINK_REL_RULE = "the rel values the link carries, a word each \u2014 \"| me\", \"| nofollow noopener\"";
25
+ /**
26
+ * One bar-separated part as the `rel` values it names, or `undefined` when it
27
+ * is not a list of them.
28
+ *
29
+ * Every word has to be one: `nofollow noopener` is a list, `a=1|2`'s `2` is
30
+ * not, and that is what keeps a bar inside a URL a bar. An empty part names no
31
+ * values rather than an empty list, because `About | /about/ |` is a line with
32
+ * a trailing bar, not a line with a rel.
33
+ */
34
+ export declare function relValuesOf(text: string): string[] | undefined;
35
+ /**
36
+ * Some `rel` values as one attribute holds them: lower case, each said once,
37
+ * in the order they were first typed.
38
+ *
39
+ * A theme prints this string and nothing else, so it never joins a list itself
40
+ * and never emits two `rel` attributes on one link. Lower case is what makes
41
+ * saying a value twice — `me` typed on a profile link that already carries it
42
+ * — a no-op rather than `rel="me ME"`.
43
+ */
44
+ export declare function relText(values: Iterable<string>): string;
45
+ /** A link line split at the point where its `rel` values begin. */
46
+ export interface LinkLine {
47
+ /** The line with its trailing `rel` values taken off: the label and the URL. */
48
+ text: string;
49
+ /** The values that were typed, as one attribute holds them. Empty for none. */
50
+ rel: string;
51
+ }
52
+ /**
53
+ * One typed link line, with the `rel` values taken off the end of it.
54
+ *
55
+ * The values come off the right, one bar-separated part at a time, and only
56
+ * while the last part is a list of rel values — so `Mastodon |
57
+ * https://example.social/@me | me | nofollow` and `... | me nofollow` are the
58
+ * same line, and `Odd | /odd/?a=1|2` keeps its bar because `2` is not one.
59
+ *
60
+ * The one place a link line is split, for the reason the URL rule is worded
61
+ * once (TASK-114): the menu box on the Navigation screen and the Links box on
62
+ * a profile take the same line, so somebody who learns one box has learned the
63
+ * other.
64
+ */
65
+ export declare function splitLinkRel(line: string): LinkLine;
19
66
  /**
20
67
  * What a menu name may be spelled with.
21
68
  *
@@ -51,16 +98,17 @@ export interface NavigationItem {
51
98
  /** Where it goes: a site-root path, or an absolute URL for somewhere else. */
52
99
  url: string;
53
100
  /**
54
- * Whether the link carries `rel="me"`, which is how Mastodon and the rest of
55
- * the IndieWeb verify that the site and the profile it links are the same
56
- * person.
101
+ * What the link's `rel` attribute says, as one string holding every value:
102
+ * `me` for a profile that is you, `nofollow noopener` for somewhere you are
103
+ * only pointing at, whatever else a reader of this site looks for.
57
104
  *
58
- * Present only when it is set. An unmarked item is spelled exactly as every
59
- * item was before flags existed, so a `site.json` holding a plain
60
- * `{ label, url }` is a complete item rather than one missing a key, and a
61
- * flag added later never has to be written across a file to mean nothing.
105
+ * Present only when there is something to say, so a `site.json` holding a
106
+ * plain `{ label, url }` is a complete item rather than one missing a key.
107
+ * Already lower case and deduplicated ({@link relText}), because a theme
108
+ * prints it as it stands and no theme should be joining a list or emitting
109
+ * two `rel` attributes on one link.
62
110
  */
63
- me?: true;
111
+ rel?: string;
64
112
  }
65
113
  /** Every menu one site stores, by name. */
66
114
  export type NavigationMenus = Record<string, NavigationItem[]>;
@@ -148,10 +196,15 @@ export declare function menusOf(value: unknown): NavigationMenus;
148
196
  * One menu's stored value as the items it names, ignoring anything that is not
149
197
  * one.
150
198
  *
151
- * A flag is read only when it is spelled exactly `true`: `"yes"`, `1` and
152
- * `false` all leave the item unmarked, so a flag is either set or it is not
153
- * and a theme writes `{% if item.me %}` without wondering what else the file
154
- * might have put there.
199
+ * `rel` is read through {@link relText}, so a file that wrote it in capitals
200
+ * or said a value twice renders one attribute either way, and a `rel` that is
201
+ * not a string is an item with none rather than an item dropped.
202
+ *
203
+ * `me: true` is still read, as `rel: "me"`. It is how every marked item was
204
+ * spelled before the trailing part of a line was a list of rel values
205
+ * (TASK-107, TASK-114), and a site that had set the only flag there was must
206
+ * not lose it on upgrade; the Navigation screen writes `rel` the next time
207
+ * that menu is saved. Only the literal `true` counts, the way it always did.
155
208
  */
156
209
  export declare function navigationItemsOf(value: unknown): NavigationItem[];
157
210
  /**
@@ -161,13 +214,9 @@ export declare function navigationItemsOf(value: unknown): NavigationItem[];
161
214
  * `about/` would be resolved against whatever page it was printed on, which is
162
215
  * never what a menu means.
163
216
  *
164
- * A line may end in the flags the item carries, one per bar — `Mastodon |
165
- * https://example.social/@me | me` — and those are taken off the end first,
166
- * from the right, and only while the last part is the name of a flag this CMS
167
- * actually has ({@link MENU_ITEM_FLAGS}). That is what lets a URL still hold a
168
- * bar, a query string say: a trailing `| elsewhere` is not a flag, so it stays
169
- * part of the URL and the line is refused for not naming one, rather than
170
- * being quietly read as a flag nobody asked for.
217
+ * A line may end in the `rel` values the link carries — `Mastodon |
218
+ * https://example.social/@me | me`, `A source | https://example.com/thing |
219
+ * nofollow noopener` — which {@link splitLinkRel} takes off the end first.
171
220
  *
172
221
  * What is left splits at its first bar, so a label still cannot hold one.
173
222
  */
@@ -192,4 +241,33 @@ export declare function menuItemsText(items: readonly NavigationItem[]): string;
192
241
  * half of the sentence.
193
242
  */
194
243
  export declare function menuItemLineProblem(value: string): string | undefined;
244
+ /**
245
+ * What a URL typed into a link box may be, in the words both boxes explain it
246
+ * in: the menu on the Navigation screen and the Links on a user's profile.
247
+ *
248
+ * One sentence fragment rather than two, so the rule {@link isLinkUrl} applies
249
+ * is worded the same wherever somebody is told about it (TASK-112). Somebody
250
+ * who learns one box should not be taught the wrong thing about the other.
251
+ */
252
+ export declare const LINK_URL_RULE = "a path like /about/ or an absolute http:// or https:// URL, with no spaces in it";
253
+ /**
254
+ * Whether a typed URL is one a link box accepts: a site-root path, or an
255
+ * absolute http(s) URL, and no whitespace either way.
256
+ *
257
+ * A bare `about/` would be resolved against whatever page it was printed on,
258
+ * which is never what a link box means, and a `javascript:` or `data:` URL is
259
+ * not somewhere a reader goes.
260
+ *
261
+ * The whitespace half is not decoration. `new URL` does not throw on
262
+ * `https://shll.me/@a | me`: it reads the space and the bar as path
263
+ * characters and percent-encodes them, so a check that only asked the parser
264
+ * took a label, a URL and a trailing word as one URL and stored it — which is
265
+ * how a reader of shll.me ended up at `/author/a%20%7C%20me/` (TASK-112). A
266
+ * URL somebody types has no spaces in it; a space means they typed two things.
267
+ *
268
+ * Deliberately a test rather than a normaliser: a link keeps the URL as it was
269
+ * typed, so `https://example.social/@me` is what the link says and what the
270
+ * box shows it back as.
271
+ */
272
+ export declare function isLinkUrl(url: string): boolean;
195
273
  //# sourceMappingURL=navigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/web/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,YAAI,IAAI,CAAU,CAAC;AAE/C,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,QAAsB,CAAC;AAErD,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmBhE;AAED,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;OASG;IACH,EAAE,CAAC,EAAE,IAAI,CAAC;CACX;AAED,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAE/D,6CAA6C;AAC7C,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC9C,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,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;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAWnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAOjE;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAItE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMrE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,qFAC0D,CAAC;AAErF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAW9C"}
@@ -4,15 +4,88 @@
4
4
  */
5
5
  export const DEFAULT_MENU_NAME = 'primary';
6
6
  /**
7
- * The flags one menu item may carry, as `site.json` spells them and as the
8
- * settings screen writes them at the end of a line.
7
+ * What one `rel` value may be spelled with: letters and dashes, which is what
8
+ * every HTML link type is spelled with.
9
9
  *
10
- * A flag is a word rather than a value, and the list is here rather than
11
- * spread through the parsers so that a second one — `nofollow`, say, or a flag
12
- * that opens a link in its own tab — is one entry and its handling in the
13
- * theme, not a new shape for an item.
10
+ * Deliberately not a list of the values this CMS knows about (TASK-114). The
11
+ * trailing part of a link line is whatever `rel` values the person typed —
12
+ * `me`, `nofollow`, `author`, `noopener`, one somebody's own reader looks for
13
+ * — and all of them reach the rendered attribute. A closed list would mean
14
+ * every value anybody wanted had to be added here first, and `me` was never a
15
+ * flag in the first place: it is a `rel` value that this CMS happened to be
16
+ * the only one to know.
14
17
  */
15
- export const MENU_ITEM_FLAGS = ['me'];
18
+ export const REL_VALUE_PATTERN = /^[a-z-]+$/i;
19
+ /**
20
+ * What a link line's trailing part may be, in the words both boxes explain it
21
+ * in, beside {@link LINK_URL_RULE}.
22
+ */
23
+ export const LINK_REL_RULE = 'the rel values the link carries, a word each — "| me", "| nofollow noopener"';
24
+ /**
25
+ * One bar-separated part as the `rel` values it names, or `undefined` when it
26
+ * is not a list of them.
27
+ *
28
+ * Every word has to be one: `nofollow noopener` is a list, `a=1|2`'s `2` is
29
+ * not, and that is what keeps a bar inside a URL a bar. An empty part names no
30
+ * values rather than an empty list, because `About | /about/ |` is a line with
31
+ * a trailing bar, not a line with a rel.
32
+ */
33
+ export function relValuesOf(text) {
34
+ const words = text
35
+ .trim()
36
+ .split(/\s+/)
37
+ .filter((word) => word !== '');
38
+ if (words.length === 0)
39
+ return undefined;
40
+ return words.every((word) => REL_VALUE_PATTERN.test(word)) ? words : undefined;
41
+ }
42
+ /**
43
+ * Some `rel` values as one attribute holds them: lower case, each said once,
44
+ * in the order they were first typed.
45
+ *
46
+ * A theme prints this string and nothing else, so it never joins a list itself
47
+ * and never emits two `rel` attributes on one link. Lower case is what makes
48
+ * saying a value twice — `me` typed on a profile link that already carries it
49
+ * — a no-op rather than `rel="me ME"`.
50
+ */
51
+ export function relText(values) {
52
+ const said = new Set();
53
+ for (const value of values) {
54
+ for (const word of value.trim().toLowerCase().split(/\s+/)) {
55
+ if (word !== '')
56
+ said.add(word);
57
+ }
58
+ }
59
+ return [...said].join(' ');
60
+ }
61
+ /**
62
+ * One typed link line, with the `rel` values taken off the end of it.
63
+ *
64
+ * The values come off the right, one bar-separated part at a time, and only
65
+ * while the last part is a list of rel values — so `Mastodon |
66
+ * https://example.social/@me | me | nofollow` and `... | me nofollow` are the
67
+ * same line, and `Odd | /odd/?a=1|2` keeps its bar because `2` is not one.
68
+ *
69
+ * The one place a link line is split, for the reason the URL rule is worded
70
+ * once (TASK-114): the menu box on the Navigation screen and the Links box on
71
+ * a profile take the same line, so somebody who learns one box has learned the
72
+ * other.
73
+ */
74
+ export function splitLinkRel(line) {
75
+ const values = [];
76
+ let text = line;
77
+ for (;;) {
78
+ const bar = text.lastIndexOf('|');
79
+ if (bar === -1)
80
+ break;
81
+ const rel = relValuesOf(text.slice(bar + 1));
82
+ if (rel === undefined)
83
+ break;
84
+ values.unshift(...rel);
85
+ text = text.slice(0, bar);
86
+ }
87
+ return { text: text.trim(), rel: relText(values) };
88
+ }
16
89
  /**
17
90
  * What a menu name may be spelled with.
18
91
  *
@@ -140,10 +213,15 @@ export function menusOf(value) {
140
213
  * One menu's stored value as the items it names, ignoring anything that is not
141
214
  * one.
142
215
  *
143
- * A flag is read only when it is spelled exactly `true`: `"yes"`, `1` and
144
- * `false` all leave the item unmarked, so a flag is either set or it is not
145
- * and a theme writes `{% if item.me %}` without wondering what else the file
146
- * might have put there.
216
+ * `rel` is read through {@link relText}, so a file that wrote it in capitals
217
+ * or said a value twice renders one attribute either way, and a `rel` that is
218
+ * not a string is an item with none rather than an item dropped.
219
+ *
220
+ * `me: true` is still read, as `rel: "me"`. It is how every marked item was
221
+ * spelled before the trailing part of a line was a list of rel values
222
+ * (TASK-107, TASK-114), and a site that had set the only flag there was must
223
+ * not lose it on upgrade; the Navigation screen writes `rel` the next time
224
+ * that menu is saved. Only the literal `true` counts, the way it always did.
147
225
  */
148
226
  export function navigationItemsOf(value) {
149
227
  if (!Array.isArray(value))
@@ -152,12 +230,16 @@ export function navigationItemsOf(value) {
152
230
  for (const entry of value) {
153
231
  if (typeof entry !== 'object' || entry === null)
154
232
  continue;
155
- const { label, url, me } = entry;
233
+ const { label, url, rel, me } = entry;
156
234
  if (typeof label !== 'string' || label === '')
157
235
  continue;
158
236
  if (typeof url !== 'string' || url === '')
159
237
  continue;
160
- items.push({ label, url, ...(me === true ? { me: true } : {}) });
238
+ const values = relText([
239
+ ...(me === true ? ['me'] : []),
240
+ ...(typeof rel === 'string' ? [rel] : []),
241
+ ]);
242
+ items.push({ label, url, ...(values === '' ? {} : { rel: values }) });
161
243
  }
162
244
  return items;
163
245
  }
@@ -180,42 +262,22 @@ function menuLines(value) {
180
262
  * `about/` would be resolved against whatever page it was printed on, which is
181
263
  * never what a menu means.
182
264
  *
183
- * A line may end in the flags the item carries, one per bar — `Mastodon |
184
- * https://example.social/@me | me` — and those are taken off the end first,
185
- * from the right, and only while the last part is the name of a flag this CMS
186
- * actually has ({@link MENU_ITEM_FLAGS}). That is what lets a URL still hold a
187
- * bar, a query string say: a trailing `| elsewhere` is not a flag, so it stays
188
- * part of the URL and the line is refused for not naming one, rather than
189
- * being quietly read as a flag nobody asked for.
265
+ * A line may end in the `rel` values the link carries — `Mastodon |
266
+ * https://example.social/@me | me`, `A source | https://example.com/thing |
267
+ * nofollow noopener` — which {@link splitLinkRel} takes off the end first.
190
268
  *
191
269
  * What is left splits at its first bar, so a label still cannot hold one.
192
270
  */
193
271
  export function menuItemOf(line) {
194
- const flags = new Set();
195
- let rest = line;
196
- for (;;) {
197
- const bar = rest.lastIndexOf('|');
198
- if (bar === -1)
199
- break;
200
- const flag = rest
201
- .slice(bar + 1)
202
- .trim()
203
- .toLowerCase();
204
- if (!MENU_ITEM_FLAGS.includes(flag))
205
- break;
206
- flags.add(flag);
207
- rest = rest.slice(0, bar);
208
- }
209
- const bar = rest.indexOf('|');
272
+ const { text, rel } = splitLinkRel(line);
273
+ const bar = text.indexOf('|');
210
274
  if (bar === -1)
211
275
  return undefined;
212
- const label = rest.slice(0, bar).trim();
213
- const url = rest.slice(bar + 1).trim();
214
- if (label === '' || url === '')
215
- return undefined;
216
- if (!url.startsWith('/') && !isAbsoluteHttpUrl(url))
276
+ const label = text.slice(0, bar).trim();
277
+ const url = text.slice(bar + 1).trim();
278
+ if (label === '' || !isLinkUrl(url))
217
279
  return undefined;
218
- return { label, url, ...(flags.has('me') ? { me: true } : {}) };
280
+ return { label, url, ...(rel === '' ? {} : { rel }) };
219
281
  }
220
282
  /**
221
283
  * A menu box as the ordered items it names, dropping the lines that are not
@@ -238,7 +300,7 @@ export function menuItemsFromText(value) {
238
300
  /** The items as a box shows them: one line each, in order. */
239
301
  export function menuItemsText(items) {
240
302
  return items
241
- .map((item) => `${item.label} | ${item.url}${item.me === true ? ' | me' : ''}`)
303
+ .map((item) => `${item.label} | ${item.url}${item.rel === undefined ? '' : ` | ${item.rel}`}`)
242
304
  .join('\n');
243
305
  }
244
306
  /**
@@ -252,18 +314,42 @@ export function menuItemLineProblem(value) {
252
314
  const bad = menuLines(value).find((line) => menuItemOf(line) === undefined);
253
315
  return bad === undefined
254
316
  ? undefined
255
- : `A menu item is "Label | URL", one per line, where the URL is a path ` +
256
- `like /about/ or an absolute http:// or https:// URL, and ends ` +
257
- `"| me" for a link that should carry rel="me". "${bad}" is not one.`;
317
+ : `A menu item is "Label | URL", one per line, where the URL is ` +
318
+ `${LINK_URL_RULE}, and may end in ${LINK_REL_RULE}. "${bad}" is not one.`;
258
319
  }
259
320
  /**
260
- * Whether a menu URL is an absolute http(s) one.
321
+ * What a URL typed into a link box may be, in the words both boxes explain it
322
+ * in: the menu on the Navigation screen and the Links on a user's profile.
323
+ *
324
+ * One sentence fragment rather than two, so the rule {@link isLinkUrl} applies
325
+ * is worded the same wherever somebody is told about it (TASK-112). Somebody
326
+ * who learns one box should not be taught the wrong thing about the other.
327
+ */
328
+ export const LINK_URL_RULE = 'a path like /about/ or an absolute http:// or https:// URL, with no spaces in it';
329
+ /**
330
+ * Whether a typed URL is one a link box accepts: a site-root path, or an
331
+ * absolute http(s) URL, and no whitespace either way.
332
+ *
333
+ * A bare `about/` would be resolved against whatever page it was printed on,
334
+ * which is never what a link box means, and a `javascript:` or `data:` URL is
335
+ * not somewhere a reader goes.
261
336
  *
262
- * Deliberately a test rather than a normaliser: a menu keeps the URL as it was
337
+ * The whitespace half is not decoration. `new URL` does not throw on
338
+ * `https://shll.me/@a | me`: it reads the space and the bar as path
339
+ * characters and percent-encodes them, so a check that only asked the parser
340
+ * took a label, a URL and a trailing word as one URL and stored it — which is
341
+ * how a reader of shll.me ended up at `/author/a%20%7C%20me/` (TASK-112). A
342
+ * URL somebody types has no spaces in it; a space means they typed two things.
343
+ *
344
+ * Deliberately a test rather than a normaliser: a link keeps the URL as it was
263
345
  * typed, so `https://example.social/@me` is what the link says and what the
264
346
  * box shows it back as.
265
347
  */
266
- function isAbsoluteHttpUrl(url) {
348
+ export function isLinkUrl(url) {
349
+ if (url === '' || /\s/.test(url))
350
+ return false;
351
+ if (url.startsWith('/'))
352
+ return true;
267
353
  let parsed;
268
354
  try {
269
355
  parsed = new URL(url);
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/web/navigation.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAI,CAAU,CAAC;AAK/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAE7B,IAAI,QAAQ,KAAK,EAAE;QAAE,OAAO,+DAA+D,CAAC;IAC5F,IAAI,QAAQ,CAAC,MAAM,GAAG,oBAAoB,EAAE,CAAC;QAC3C,OAAO,0BAA0B,MAAM,CAAC,oBAAoB,CAAC,qBAAqB,QAAQ,cAAc,CAAC;IAC3G,CAAC;IACD,IAAI,QAAQ,KAAK,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QACxC,OAAO,kCAAkC,QAAQ,oCAAoC,QAAQ,CAAC,WAAW,EAAE,yCAAyC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;IACjL,CAAC;IACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,OAAO,CACL,IAAI,QAAQ,iEAAiE;YAC7E,8EAA8E;YAC9E,8DAA8D,CAC/D,C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IAEjC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1B,GAAG,IAAI;QACP,OAAO,EAAE,IAAI,KAAK,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI;KACjE,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IACzC,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC"}
@@ -11,6 +11,7 @@ import type { FrontPageSlugs, SiteData } from './context.ts';
11
11
  import type { Pagination } from './pagination.ts';
12
12
  import type { TaxonomyBases, TaxonomyRedirect } from './taxonomy.ts';
13
13
  import type { ThemeSource } from './themes.ts';
14
+ import type { ReplyContext } from '../webmention/reply-context.ts';
14
15
  /** Templates the default theme ships and the public routes ask for by name. */
15
16
  export declare const TEMPLATES: {
16
17
  readonly home: 'layouts/home.njk';
@@ -190,6 +191,14 @@ export interface CreateRendererOptions {
190
191
  * every test over one template wants.
191
192
  */
192
193
  conversation?: ((document: Document) => Conversation) | undefined;
194
+ /**
195
+ * What is stored about the post a reply answers, by its URL (TASK-123).
196
+ *
197
+ * Read, never fetched: the context was fetched when the reply was saved or
198
+ * synced, so drawing a reply waits on nobody's server. A renderer built
199
+ * without it draws every reply with a bare link.
200
+ */
201
+ replyContext?: ((target: string) => ReplyContext | undefined) | undefined;
193
202
  /**
194
203
  * The comment form for a post that is taking comments, and `undefined` for
195
204
  * one that is not (TASK-50).
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/web/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAWlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,KAAK,EAAmB,cAAc,EAAoB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEhG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,+EAA+E;AAC/E,eAAO,MAAM,SAAS;aACpB,IAAI,EAAE,kBAAkB;aACxB,IAAI,EAAE,kBAAkB;aACxB,IAAI,EAAE,kBAAkB;aACxB,GAAG,EAAE,iBAAiB;aACtB,QAAQ,EAAE,sBAAsB;aAChC,MAAM,EAAE,oBAAoB;aAC5B,MAAM,EAAE,oBAAoB;aAC5B,QAAQ,EAAE,iBAAiB;CACnB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAk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AS,CAAC;IACtD;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,SAAS,QAAQ,EAAE,CAAC,GAAG,SAAS,CAAC;CACxD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,QAAQ,CAgWvE"}
@@ -1,3 +1,4 @@
1
+ import { postLabel, replyTarget } from '../content/post-type.js';
1
2
  import { siteIcons } from '../images/icons.js';
2
3
  import { archiveMonths, archiveOpen } from './archive.js';
3
4
  import { authorContext, siteAuthorContext } from './authors.js';
@@ -215,6 +216,11 @@ export function createRenderer(options) {
215
216
  // an entry (TASK-79). Each is on the context only when there is one, so a
216
217
  // theme asks `{% if previous %}` and the ends of the archive draw nothing.
217
218
  const either = options.neighbours?.(document) ?? {};
219
+ // What the post a reply answers says about itself, when it was fetched
220
+ // (TASK-123). On the context only when there is some, so a theme draws
221
+ // the bare link from `inReplyTo` and fills it in from `replyContext`.
222
+ const target = replyTarget(document);
223
+ const cited = target === undefined ? undefined : options.replyContext?.(target);
218
224
  return render(template, {
219
225
  ...context,
220
226
  // This page's own person, which is the site's author everywhere else:
@@ -239,6 +245,7 @@ export function createRenderer(options) {
239
245
  ...(form === undefined ? {} : { commentForm: form }),
240
246
  ...(contact === undefined ? {} : { contactForm: contact }),
241
247
  ...(webmention === undefined ? {} : { webmention }),
248
+ ...(cited === undefined ? {} : { replyContext: replyContextFor(cited) }),
242
249
  ...extra,
243
250
  });
244
251
  }
@@ -363,7 +370,7 @@ export function createRenderer(options) {
363
370
  function neighbourContext(key, document) {
364
371
  if (document === undefined)
365
372
  return {};
366
- return { [key]: { title: document.title, url: document.permalink } };
373
+ return { [key]: { title: postLabel(document), url: document.permalink } };
367
374
  }
368
375
  /**
369
376
  * `preferred` when a theme in the search path ships it, and `fallback`
@@ -394,4 +401,15 @@ function currentUrl(context) {
394
401
  }
395
402
  return typeof context['url'] === 'string' ? context['url'] : '/';
396
403
  }
404
+ /**
405
+ * A stored reply context as a theme reads it: the published instant as a
406
+ * `Date`, so the `date` filter prints it in the site's zone like any other.
407
+ */
408
+ function replyContextFor(context) {
409
+ const published = context.published === undefined ? undefined : new Date(context.published);
410
+ const { published: _published, ...rest } = context;
411
+ return published === undefined || Number.isNaN(published.getTime())
412
+ ? rest
413
+ : { ...rest, published };
414
+ }
397
415
  //# sourceMappingURL=render.js.map