@geekity/cms 0.18.0 → 0.20.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 (182) hide show
  1. package/README.md +29 -25
  2. package/admin/components/admin-bar.njk +4 -3
  3. package/admin/components/public-admin-bar.njk +3 -1
  4. package/admin/layouts/shell.njk +1 -0
  5. package/admin/pages/documents/editor.njk +291 -192
  6. package/admin/static/admin.css +123 -13
  7. package/admin/static/location.js +38 -0
  8. package/dist/admin/documents.d.ts +18 -3
  9. package/dist/admin/documents.d.ts.map +1 -1
  10. package/dist/admin/documents.js +150 -21
  11. package/dist/admin/documents.js.map +1 -1
  12. package/dist/admin/editor-layout.d.ts +13 -0
  13. package/dist/admin/editor-layout.d.ts.map +1 -0
  14. package/dist/admin/editor-layout.js +62 -0
  15. package/dist/admin/editor-layout.js.map +1 -0
  16. package/dist/admin/enclosure-field.d.ts +2 -3
  17. package/dist/admin/enclosure-field.d.ts.map +1 -1
  18. package/dist/admin/enclosure-field.js +27 -7
  19. package/dist/admin/enclosure-field.js.map +1 -1
  20. package/dist/admin/headers.d.ts +1 -0
  21. package/dist/admin/headers.d.ts.map +1 -1
  22. package/dist/admin/headers.js +3 -0
  23. package/dist/admin/headers.js.map +1 -1
  24. package/dist/admin/location-field.d.ts +4 -3
  25. package/dist/admin/location-field.d.ts.map +1 -1
  26. package/dist/admin/location-field.js +10 -2
  27. package/dist/admin/location-field.js.map +1 -1
  28. package/dist/admin/media.d.ts.map +1 -1
  29. package/dist/admin/media.js +3 -0
  30. package/dist/admin/media.js.map +1 -1
  31. package/dist/admin/photo-field.d.ts +2 -3
  32. package/dist/admin/photo-field.d.ts.map +1 -1
  33. package/dist/admin/photo-field.js +4 -2
  34. package/dist/admin/photo-field.js.map +1 -1
  35. package/dist/admin/read-field.d.ts +2 -3
  36. package/dist/admin/read-field.d.ts.map +1 -1
  37. package/dist/admin/read-field.js +12 -4
  38. package/dist/admin/read-field.js.map +1 -1
  39. package/dist/config.d.ts +2 -0
  40. package/dist/config.d.ts.map +1 -1
  41. package/dist/config.js.map +1 -1
  42. package/dist/content/citation.d.ts +5 -0
  43. package/dist/content/citation.d.ts.map +1 -1
  44. package/dist/content/citation.js +17 -0
  45. package/dist/content/citation.js.map +1 -1
  46. package/dist/content/kept-properties.d.ts +5 -0
  47. package/dist/content/kept-properties.d.ts.map +1 -0
  48. package/dist/content/kept-properties.js +12 -0
  49. package/dist/content/kept-properties.js.map +1 -0
  50. package/dist/content/location.d.ts +4 -0
  51. package/dist/content/location.d.ts.map +1 -1
  52. package/dist/content/location.js +35 -3
  53. package/dist/content/location.js.map +1 -1
  54. package/dist/content/locations.d.ts +2 -5
  55. package/dist/content/locations.d.ts.map +1 -1
  56. package/dist/content/locations.js +2 -77
  57. package/dist/content/locations.js.map +1 -1
  58. package/dist/content/markdown.d.ts +9 -0
  59. package/dist/content/markdown.d.ts.map +1 -1
  60. package/dist/content/markdown.js +37 -1
  61. package/dist/content/markdown.js.map +1 -1
  62. package/dist/content/permalink-file.d.ts +7 -0
  63. package/dist/content/permalink-file.d.ts.map +1 -0
  64. package/dist/content/permalink-file.js +77 -0
  65. package/dist/content/permalink-file.js.map +1 -0
  66. package/dist/content/post-type.d.ts +1 -6
  67. package/dist/content/post-type.d.ts.map +1 -1
  68. package/dist/content/post-type.js +13 -14
  69. package/dist/content/post-type.js.map +1 -1
  70. package/dist/content/slug.d.ts +2 -1
  71. package/dist/content/slug.d.ts.map +1 -1
  72. package/dist/content/slug.js +3 -1
  73. package/dist/content/slug.js.map +1 -1
  74. package/dist/env.d.ts +6 -0
  75. package/dist/env.d.ts.map +1 -1
  76. package/dist/federation/article.d.ts +8 -7
  77. package/dist/federation/article.d.ts.map +1 -1
  78. package/dist/federation/article.js +37 -18
  79. package/dist/federation/article.js.map +1 -1
  80. package/dist/federation/citations.d.ts +7 -6
  81. package/dist/federation/citations.d.ts.map +1 -1
  82. package/dist/federation/citations.js +44 -28
  83. package/dist/federation/citations.js.map +1 -1
  84. package/dist/federation/delivery.d.ts.map +1 -1
  85. package/dist/federation/delivery.js +23 -16
  86. package/dist/federation/delivery.js.map +1 -1
  87. package/dist/index.d.ts +5 -4
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +2 -1
  90. package/dist/index.js.map +1 -1
  91. package/dist/indieauth/bearer.d.ts +10 -6
  92. package/dist/indieauth/bearer.d.ts.map +1 -1
  93. package/dist/indieauth/bearer.js +11 -9
  94. package/dist/indieauth/bearer.js.map +1 -1
  95. package/dist/indieauth/token.js +1 -1
  96. package/dist/indieauth/token.js.map +1 -1
  97. package/dist/micropub/content.d.ts +15 -0
  98. package/dist/micropub/content.d.ts.map +1 -0
  99. package/dist/micropub/content.js +254 -0
  100. package/dist/micropub/content.js.map +1 -0
  101. package/dist/micropub/create.d.ts +7 -3
  102. package/dist/micropub/create.d.ts.map +1 -1
  103. package/dist/micropub/create.js +75 -24
  104. package/dist/micropub/create.js.map +1 -1
  105. package/dist/micropub/endpoint.d.ts +4 -5
  106. package/dist/micropub/endpoint.d.ts.map +1 -1
  107. package/dist/micropub/endpoint.js +33 -12
  108. package/dist/micropub/endpoint.js.map +1 -1
  109. package/dist/micropub/media.d.ts +6 -4
  110. package/dist/micropub/media.d.ts.map +1 -1
  111. package/dist/micropub/media.js +7 -5
  112. package/dist/micropub/media.js.map +1 -1
  113. package/dist/micropub/update.d.ts +7 -1
  114. package/dist/micropub/update.d.ts.map +1 -1
  115. package/dist/micropub/update.js +32 -7
  116. package/dist/micropub/update.js.map +1 -1
  117. package/dist/web/admin-bar.d.ts.map +1 -1
  118. package/dist/web/admin-bar.js +27 -1
  119. package/dist/web/admin-bar.js.map +1 -1
  120. package/dist/web/context.d.ts +10 -3
  121. package/dist/web/context.d.ts.map +1 -1
  122. package/dist/web/context.js +12 -2
  123. package/dist/web/context.js.map +1 -1
  124. package/dist/web/documents.d.ts +21 -6
  125. package/dist/web/documents.d.ts.map +1 -1
  126. package/dist/web/documents.js +23 -12
  127. package/dist/web/documents.js.map +1 -1
  128. package/dist/web/feed-item.d.ts +26 -3
  129. package/dist/web/feed-item.d.ts.map +1 -1
  130. package/dist/web/feed-item.js +63 -6
  131. package/dist/web/feed-item.js.map +1 -1
  132. package/dist/web/feed-rss.js +3 -3
  133. package/dist/web/feed-rss.js.map +1 -1
  134. package/dist/web/feed-source.d.ts +7 -0
  135. package/dist/web/feed-source.d.ts.map +1 -1
  136. package/dist/web/feed-source.js.map +1 -1
  137. package/dist/web/feeds.d.ts.map +1 -1
  138. package/dist/web/feeds.js +7 -1
  139. package/dist/web/feeds.js.map +1 -1
  140. package/dist/web/negotiate.d.ts +4 -0
  141. package/dist/web/negotiate.d.ts.map +1 -1
  142. package/dist/web/negotiate.js +5 -1
  143. package/dist/web/negotiate.js.map +1 -1
  144. package/dist/web/render.d.ts +5 -4
  145. package/dist/web/render.d.ts.map +1 -1
  146. package/dist/web/render.js +34 -12
  147. package/dist/web/render.js.map +1 -1
  148. package/dist/web/routes.d.ts.map +1 -1
  149. package/dist/web/routes.js +16 -4
  150. package/dist/web/routes.js.map +1 -1
  151. package/dist/web/sanitize.d.ts +10 -0
  152. package/dist/web/sanitize.d.ts.map +1 -1
  153. package/dist/web/sanitize.js +180 -0
  154. package/dist/web/sanitize.js.map +1 -1
  155. package/dist/web/templates.d.ts.map +1 -1
  156. package/dist/web/templates.js +2 -0
  157. package/dist/web/templates.js.map +1 -1
  158. package/dist/webmention/cited-picture.d.ts +37 -0
  159. package/dist/webmention/cited-picture.d.ts.map +1 -0
  160. package/dist/webmention/cited-picture.js +121 -0
  161. package/dist/webmention/cited-picture.js.map +1 -0
  162. package/dist/webmention/fetch-public.d.ts +26 -8
  163. package/dist/webmention/fetch-public.d.ts.map +1 -1
  164. package/dist/webmention/fetch-public.js +22 -12
  165. package/dist/webmention/fetch-public.js.map +1 -1
  166. package/dist/webmention/reply-context.d.ts +30 -8
  167. package/dist/webmention/reply-context.d.ts.map +1 -1
  168. package/dist/webmention/reply-context.js +238 -27
  169. package/dist/webmention/reply-context.js.map +1 -1
  170. package/dist/webmention/reply-contexts.d.ts +28 -16
  171. package/dist/webmention/reply-contexts.d.ts.map +1 -1
  172. package/dist/webmention/reply-contexts.js +108 -25
  173. package/dist/webmention/reply-contexts.js.map +1 -1
  174. package/package.json +10 -9
  175. package/themes/default/README.md +83 -9
  176. package/themes/default/layouts/post.njk +7 -7
  177. package/themes/default/partials/citations.njk +25 -4
  178. package/themes/default/partials/cited-page.njk +58 -0
  179. package/themes/default/partials/post-list.njk +8 -5
  180. package/themes/default/partials/reply-context.njk +9 -11
  181. package/themes/default/src/style.css +37 -0
  182. package/themes/default/static/style.css +83 -0
package/README.md CHANGED
@@ -1519,27 +1519,28 @@ This is every piece of personal data the CMS stores, where it is, and how long
1519
1519
  it stays. "Kept" means until somebody deletes it, unless a retention period
1520
1520
  says otherwise.
1521
1521
 
1522
- | What | Where | How long |
1523
- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
1524
- | A commenter's name, website and words | `content/_data/comments/{slug}.json`, public and in git | Kept. Erasing on request replaces the name and drops the website. |
1525
- | A commenter's email, and whether they asked to be told about replies | `data/comments/{slug}.json`, mode `0600`, keyed by comment id | `commentEmailRetentionDays`: forever unless set, 180 on a new site. |
1526
- | A salted hash of the address a comment, webmention or contact message came from (the address itself is never stored) | The comment file, or the contact message file | `addressHashRetentionDays`: forever unless set, 30 on a new site. |
1527
- | A webmention's author name, website, avatar URL and the source page's words | `content/_data/comments/{slug}.json` | Kept, as a copy of a page that is public already. |
1528
- | A contact message: the sender's name, email, subject and message | `data/contact/{id}.json`, mode `0600` | `contactMessageRetentionDays`: forever unless set, 365 on a new site. |
1529
- | The addresses that unsubscribed from reply notices | `data/comment-optouts.json`, mode `0600` | Kept, so the site goes on not writing to them. Erasing on request removes one. |
1530
- | Followers: actor id, handle, display name, avatar URL, profile URL | `content/_data/federation/{username}/followers.json`, in git | Until they unfollow. |
1531
- | Inbound likes, boosts, replies and quotes, with the actor who sent them | `content/_data/federation/inbox/{yyyy}-{mm}.jsonl`, in git | Kept. |
1532
- | What a reply shows of the post it answers: its title, words and author | `content/_data/replyContexts.json`, in git | Kept. |
1533
- | Other actors who liked, boosted, answered or quoted: handle, display name, avatar URL, profile URL | `data/geekity.db`, fetched from their actor document | A cache. Refetched weekly while the inbox log names them. |
1534
- | Remote avatars, shrunk | `data/avatars/` | Deleted by the avatar sweep once nothing shown names them. |
1535
- | Users: username, email, argon2id password hash, profile | `data/users.json`, mode `0600` | Until the user is deleted. |
1536
- | The apps a user signed in to with IndieAuth: app, scopes, hashes of its tokens, when they expire | `data/indieauth-tokens.json`, mode `0600` | Until the user is deleted, or 60 days after the app last refreshed. |
1537
- | Recent IndieAuth and Micropub requests: app, username, what it sent (no secrets, values cut short), the answer | `data/indieauth-activity.json`, mode `0600` | The last 100 requests, none older than 14 days. |
1538
- | An index of all of the above, and sessions, reset tokens and spent link tokens | `data/geekity.db` | A cache of the files. Sessions and tokens are pruned when they expire. |
1539
- | Client addresses in the rate limits | Memory | Until the window passes or the site restarts. |
1540
- | Where and when a photo or video was taken, and the camera or phone (EXIF, XMP, IPTC, a video's `©xyz`) | Removed from `content/uploads/` on upload | Never stored. Older uploads keep it until `geekity strip-metadata`; git history keeps the old bytes until rewritten. |
1541
- | Where the author wrote a post: coordinates, accuracy, and the place's name, locality, region and country | `data/locations.json`, mode `0600`, keyed by permalink | Kept until the author clears it. Published only as far as **Settings > Privacy** allows, nothing by default. |
1542
- | Client addresses in the access log | stdout, and whatever collects it | Only with `accessLogAddress` on. The collector keeps them. |
1522
+ | What | Where | How long |
1523
+ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
1524
+ | A commenter's name, website and words | `content/_data/comments/{slug}.json`, public and in git | Kept. Erasing on request replaces the name and drops the website. |
1525
+ | A commenter's email, and whether they asked to be told about replies | `data/comments/{slug}.json`, mode `0600`, keyed by comment id | `commentEmailRetentionDays`: forever unless set, 180 on a new site. |
1526
+ | A salted hash of the address a comment, webmention or contact message came from (the address itself is never stored) | The comment file, or the contact message file | `addressHashRetentionDays`: forever unless set, 30 on a new site. |
1527
+ | A webmention's author name, website, avatar URL and the source page's words | `content/_data/comments/{slug}.json` | Kept, as a copy of a page that is public already. |
1528
+ | A contact message: the sender's name, email, subject and message | `data/contact/{id}.json`, mode `0600` | `contactMessageRetentionDays`: forever unless set, 365 on a new site. |
1529
+ | The addresses that unsubscribed from reply notices | `data/comment-optouts.json`, mode `0600` | Kept, so the site goes on not writing to them. Erasing on request removes one. |
1530
+ | Followers: actor id, handle, display name, avatar URL, profile URL | `content/_data/federation/{username}/followers.json`, in git | Until they unfollow. |
1531
+ | Inbound likes, boosts, replies and quotes, with the actor who sent them | `content/_data/federation/inbox/{yyyy}-{mm}.jsonl`, in git | Kept. |
1532
+ | What a reply shows of the post it answers: its title, words and author | `content/_data/replyContexts.json`, in git | Kept. |
1533
+ | Other actors who liked, boosted, answered or quoted: handle, display name, avatar URL, profile URL | `data/geekity.db`, fetched from their actor document | A cache. Refetched weekly while the inbox log names them. |
1534
+ | Remote avatars, shrunk | `data/avatars/` | Deleted by the avatar sweep once nothing shown names them. |
1535
+ | Users: username, email, argon2id password hash, profile | `data/users.json`, mode `0600` | Until the user is deleted. |
1536
+ | The apps a user signed in to with IndieAuth: app, scopes, hashes of its tokens, when they expire | `data/indieauth-tokens.json`, mode `0600` | Until the user is deleted, or 60 days after the app last refreshed. |
1537
+ | Recent IndieAuth and Micropub requests: app, username, what it sent (no secrets, values cut short), the answer | `data/indieauth-activity.json`, mode `0600` | The last 100 requests, none older than 14 days. |
1538
+ | An index of all of the above, and sessions, reset tokens and spent link tokens | `data/geekity.db` | A cache of the files. Sessions and tokens are pruned when they expire. |
1539
+ | Client addresses in the rate limits | Memory | Until the window passes or the site restarts. |
1540
+ | Where and when a photo or video was taken, and the camera or phone (EXIF, XMP, IPTC, a video's `©xyz`) | Removed from `content/uploads/` on upload | Never stored. Older uploads keep it until `geekity strip-metadata`; git history keeps the old bytes until rewritten. |
1541
+ | Where the author wrote a post or checked in: coordinates, accuracy, and the place's name, locality, region and country | `data/locations.json`, mode `0600`, keyed by permalink | Kept until the author clears it. Published only as far as **Settings > Privacy** allows, nothing by default. |
1542
+ | Micropub properties a post was sent that the site does not understand, such as an RSVP | `data/kept-properties.json`, mode `0600`, keyed by permalink | Kept until an update deletes them. Never published. |
1543
+ | Client addresses in the access log | stdout, and whatever collects it | Only with `accessLogAddress` on. The collector keeps them. |
1543
1544
 
1544
1545
  Two services outside the site see personal data when a site turns them on.
1545
1546
  Akismet is sent a commenter's or sender's address, user agent, referrer, name,
@@ -1721,10 +1722,10 @@ visibility: unlisted
1721
1722
  Public is the key's absence, and the editor removes the key when you choose
1722
1723
  Public again. The site has no private posts. A value other than `public` or
1723
1724
  `unlisted`, such as a hand-typed `visibility: private`, hides the post the way
1724
- `draft: true` does: its URL answers 404, it is on no list, and a post the
1725
- followers already hold is withdrawn with a `Delete`. The editor shows the value
1726
- as it is stored, marks the post Hidden in the list, and keeps the value through
1727
- a save until you choose Public or Unlisted.
1725
+ `draft: true` does: its URL answers 404 to anybody not signed in, it is on no
1726
+ list, and a post the followers already hold is withdrawn with a `Delete`. The
1727
+ editor shows the value as it is stored, marks the post Hidden in the list, and
1728
+ keeps the value through a save until you choose Public or Unlisted.
1728
1729
 
1729
1730
  The rule works for pages too.
1730
1731
 
@@ -2423,6 +2424,9 @@ what is in it. Each header does something else:
2423
2424
  leaves alone what an embedded video player asks for: autoplay, fullscreen,
2424
2425
  `encrypted-media`, picture-in-picture, and the motion sensors behind a
2425
2426
  360-degree video.
2427
+ The post editor is the one response that allows more: it sends the site's
2428
+ policy with `geolocation=()` changed to `geolocation=(self)`, so its Use my
2429
+ location button can ask the browser where it is.
2426
2430
  - `Cross-Origin-Opener-Policy: same-origin` keeps a window the site opens, or a
2427
2431
  window that opens the site, from reaching into it through `window.opener`.
2428
2432
 
@@ -1,6 +1,7 @@
1
1
  {# The admin bar, in the admin and across the top of the public site alike
2
- (TASK-126, TASK-183). The site title leads to the dashboard; `barLinks` are
3
- the shortcuts beside it, which each place chooses for itself; the account
2
+ (TASK-126, TASK-183). The site title leads to `siteHref` and `barLinks` are
3
+ the shortcuts beside it, both chosen by each place for itself: the admin's
4
+ title leads to the dashboard, the public site's home (TASK-257). The account
4
5
  menu ends it.
5
6
 
6
7
  WordPress's "Howdy," menu, greeting the way this site's owner does. A
@@ -8,7 +9,7 @@
8
9
  Escape or a click elsewhere, and tells a screen reader whether it is
9
10
  expanded, all under the admin CSP's script-src 'self'. #}
10
11
  <nav class="admin-bar" aria-label="Admin bar">
11
- <a class="admin-bar-site" href="{{ adminUrl }}">{{ site.title }}</a>
12
+ <a class="admin-bar-site" href="{{ siteHref }}">{{ site.title }}</a>
12
13
  {% for link in barLinks %}
13
14
  <a href="{{ link.url }}">{{ link.label }}</a>
14
15
  {% endfor %}
@@ -38,4 +38,6 @@
38
38
  }
39
39
  });
40
40
  })();
41
- </script></template></geekity-admin-bar>
41
+ </script></template></geekity-admin-bar>{% if notice %}
42
+ <p class="geekity-unpublished-notice" style="all: initial; display: block; box-sizing: border-box; margin: 0; padding: 8px 16px; background: #fcf9e8; color: #1d2327; border-bottom: 1px solid #dba617; font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif">{{ notice }}</p>
43
+ {%- endif %}
@@ -6,6 +6,7 @@
6
6
  {# View site, because in here you are not looking at it; + New, as on the
7
7
  public site; and, on the editor of something readers can see, the way to
8
8
  go and look at it. #}
9
+ {% set siteHref = adminUrl %}
9
10
  {% set barLinks = [{ label: "View site", url: siteUrl }, { label: "+ New", url: newPostUrl }] %}
10
11
  {% if viewUrl and kind %}
11
12
  {% set barLinks = barLinks.concat([{ label: "View " + (kind.singular | capitalize), url: viewUrl }]) %}