@geekity/cms 0.19.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 (116) hide show
  1. package/README.md +3 -0
  2. package/admin/components/admin-bar.njk +4 -3
  3. package/admin/layouts/shell.njk +1 -0
  4. package/admin/pages/documents/editor.njk +34 -0
  5. package/admin/static/admin.css +87 -0
  6. package/admin/static/location.js +38 -0
  7. package/dist/admin/documents.d.ts +13 -0
  8. package/dist/admin/documents.d.ts.map +1 -1
  9. package/dist/admin/documents.js +94 -21
  10. package/dist/admin/documents.js.map +1 -1
  11. package/dist/admin/editor-layout.d.ts.map +1 -1
  12. package/dist/admin/editor-layout.js +1 -0
  13. package/dist/admin/editor-layout.js.map +1 -1
  14. package/dist/admin/headers.d.ts +1 -0
  15. package/dist/admin/headers.d.ts.map +1 -1
  16. package/dist/admin/headers.js +3 -0
  17. package/dist/admin/headers.js.map +1 -1
  18. package/dist/admin/media.d.ts.map +1 -1
  19. package/dist/admin/media.js +3 -0
  20. package/dist/admin/media.js.map +1 -1
  21. package/dist/config.d.ts +2 -0
  22. package/dist/config.d.ts.map +1 -1
  23. package/dist/config.js.map +1 -1
  24. package/dist/content/citation.d.ts +5 -0
  25. package/dist/content/citation.d.ts.map +1 -1
  26. package/dist/content/citation.js +17 -0
  27. package/dist/content/citation.js.map +1 -1
  28. package/dist/content/markdown.d.ts +9 -0
  29. package/dist/content/markdown.d.ts.map +1 -1
  30. package/dist/content/markdown.js +37 -1
  31. package/dist/content/markdown.js.map +1 -1
  32. package/dist/content/post-type.d.ts +1 -6
  33. package/dist/content/post-type.d.ts.map +1 -1
  34. package/dist/content/post-type.js +13 -14
  35. package/dist/content/post-type.js.map +1 -1
  36. package/dist/content/slug.d.ts +2 -1
  37. package/dist/content/slug.d.ts.map +1 -1
  38. package/dist/content/slug.js +3 -1
  39. package/dist/content/slug.js.map +1 -1
  40. package/dist/env.d.ts +6 -0
  41. package/dist/env.d.ts.map +1 -1
  42. package/dist/federation/article.d.ts +4 -4
  43. package/dist/federation/article.js +5 -5
  44. package/dist/federation/article.js.map +1 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/micropub/content.d.ts +15 -0
  49. package/dist/micropub/content.d.ts.map +1 -0
  50. package/dist/micropub/content.js +254 -0
  51. package/dist/micropub/content.js.map +1 -0
  52. package/dist/micropub/create.d.ts.map +1 -1
  53. package/dist/micropub/create.js +13 -8
  54. package/dist/micropub/create.js.map +1 -1
  55. package/dist/micropub/endpoint.d.ts.map +1 -1
  56. package/dist/micropub/endpoint.js +18 -4
  57. package/dist/micropub/endpoint.js.map +1 -1
  58. package/dist/web/admin-bar.js +2 -1
  59. package/dist/web/admin-bar.js.map +1 -1
  60. package/dist/web/context.d.ts +10 -3
  61. package/dist/web/context.d.ts.map +1 -1
  62. package/dist/web/context.js +12 -2
  63. package/dist/web/context.js.map +1 -1
  64. package/dist/web/feed-item.d.ts +26 -3
  65. package/dist/web/feed-item.d.ts.map +1 -1
  66. package/dist/web/feed-item.js +63 -6
  67. package/dist/web/feed-item.js.map +1 -1
  68. package/dist/web/feed-rss.js +3 -3
  69. package/dist/web/feed-rss.js.map +1 -1
  70. package/dist/web/feed-source.d.ts +7 -0
  71. package/dist/web/feed-source.d.ts.map +1 -1
  72. package/dist/web/feed-source.js.map +1 -1
  73. package/dist/web/feeds.d.ts.map +1 -1
  74. package/dist/web/feeds.js +7 -1
  75. package/dist/web/feeds.js.map +1 -1
  76. package/dist/web/negotiate.d.ts +4 -0
  77. package/dist/web/negotiate.d.ts.map +1 -1
  78. package/dist/web/negotiate.js +5 -1
  79. package/dist/web/negotiate.js.map +1 -1
  80. package/dist/web/render.d.ts.map +1 -1
  81. package/dist/web/render.js +19 -6
  82. package/dist/web/render.js.map +1 -1
  83. package/dist/web/routes.d.ts.map +1 -1
  84. package/dist/web/routes.js +1 -0
  85. package/dist/web/routes.js.map +1 -1
  86. package/dist/web/sanitize.d.ts +10 -0
  87. package/dist/web/sanitize.d.ts.map +1 -1
  88. package/dist/web/sanitize.js +180 -0
  89. package/dist/web/sanitize.js.map +1 -1
  90. package/dist/web/templates.d.ts.map +1 -1
  91. package/dist/web/templates.js +2 -0
  92. package/dist/web/templates.js.map +1 -1
  93. package/dist/webmention/cited-picture.d.ts +37 -0
  94. package/dist/webmention/cited-picture.d.ts.map +1 -0
  95. package/dist/webmention/cited-picture.js +121 -0
  96. package/dist/webmention/cited-picture.js.map +1 -0
  97. package/dist/webmention/fetch-public.d.ts +23 -7
  98. package/dist/webmention/fetch-public.d.ts.map +1 -1
  99. package/dist/webmention/fetch-public.js +6 -2
  100. package/dist/webmention/fetch-public.js.map +1 -1
  101. package/dist/webmention/reply-context.d.ts +17 -8
  102. package/dist/webmention/reply-context.d.ts.map +1 -1
  103. package/dist/webmention/reply-context.js +140 -28
  104. package/dist/webmention/reply-context.js.map +1 -1
  105. package/dist/webmention/reply-contexts.d.ts +11 -2
  106. package/dist/webmention/reply-contexts.d.ts.map +1 -1
  107. package/dist/webmention/reply-contexts.js +78 -6
  108. package/dist/webmention/reply-contexts.js.map +1 -1
  109. package/package.json +3 -2
  110. package/themes/default/README.md +56 -5
  111. package/themes/default/layouts/post.njk +2 -1
  112. package/themes/default/partials/citations.njk +14 -2
  113. package/themes/default/partials/cited-page.njk +21 -4
  114. package/themes/default/partials/reply-context.njk +7 -2
  115. package/themes/default/src/style.css +37 -0
  116. package/themes/default/static/style.css +83 -0
@@ -3,7 +3,8 @@
3
3
  a kicker that names its kind (Article, Note, Reply) and the categories it is
4
4
  filed under.
5
5
 
6
- An article, and a reply with a title, has the only headline: the title as its
6
+ A post with a title its words do not open with (an article, a titled reply,
7
+ a titled like with no words at all) has the only headline: the title as its
7
8
  `p-name` and the author's `description` under it as the deck, a
8
9
  `p-summary`. A post with no title opens on its words, set larger. What a
9
10
  reply answers, and what a like, repost or bookmark cites, opens a post with
@@ -12,15 +12,27 @@
12
12
  `context` is what the target said about itself when the post was saved or
13
13
  synced (TASK-244), only when it said something: its `name` and `author`,
14
14
  printed through autoescaping like a reply's context. With a name, the name
15
- is the link; with only an author, "a post" is; with neither, the bare URL.
15
+ is the link; with only an author, "a post" is; for a URL that is an image,
16
+ "an image from" its host; with nothing, "a page on" its host.
17
+
18
+ `context.picture` is the target's picture, copied into the site's uploads
19
+ (TASK-252), absent when there is none or the post hid its previews. A
20
+ repost of a photo (`picture.shownInFull`) shows it in full under the line; any
21
+ other citation shows it as a thumbnail beside the line. Both link to the
22
+ target, and `picture.imgHtml` is the `img.u-photo` inside the `h-cite`.
16
23
  #}
17
24
  {% import "partials/cited-page.njk" as cited %}
18
25
  {% set citationVerbs = { "repost-of": "Reposted", "like-of": "Liked", "bookmark-of": "Bookmarked" } %}
19
26
  {% for citation in citations %}
20
27
  {% set citedPage = citation.context %}
21
- <div class="reply-context cite u-{{ citation.property }} h-cite">
28
+ {% set picture = citedPage.picture %}
29
+ <div class="reply-context cite u-{{ citation.property }} h-cite{% if picture and not picture.shownInFull %} cite-with-thumb{% endif %}">
30
+ {%- if picture and not picture.shownInFull %}{{ cited.thumb(citation.url, picture) }}{% endif %}
22
31
  <p class="cite-line small">{{ citationVerbs[citation.property] }}
23
32
  {{- cited.page(citation.url, citedPage) -}}
24
33
  </p>
34
+ {%- if picture.shownInFull %}
35
+ <a class="cite-photo" href="{{ citation.url }}">{{ picture.imgHtml | safe }}</a>
36
+ {%- endif %}
25
37
  </div>
26
38
  {% endfor %}
@@ -8,14 +8,25 @@
8
8
 
9
9
  `url` is the cited page, always its `u-url`. `context` is what the page said
10
10
  about itself, from the reply contexts file. With a name, the name is the
11
- link; with only an author, "a post" is; with neither, the bare URL. The
12
- author follows as an `h-card`.
11
+ link; with only an author, "a post" is; a URL that is itself an image
12
+ (`context.image`, TASK-255) is "an image from" its host; anything else is "a
13
+ page on" its host, never the bare URL, which can run to hundreds of
14
+ characters. The author follows as an `h-card`.
13
15
 
14
16
  A name that already ends in " by " and the author's name, matched without
15
17
  regard to case (SoundCloud's oEmbed gives "Flickermood by Forss" by Forss),
16
18
  is not followed by the author again. Its last words become the `h-card`,
17
19
  printed as the title wrote them, and the whole name stays the `p-name`, so a
18
20
  parser reads the same name and author either way.
21
+
22
+ A page that names no author may name its site, `context.site` (its
23
+ `og:site_name`), printed after a middle dot as plain text: a site is not an
24
+ author, so it is no `h-card`.
25
+
26
+ `thumb(url, picture)` is a cited page's thumbnail (TASK-252): a link to the
27
+ page around `picture.imgHtml`, out of the tab order and hidden from assistive
28
+ technology because the title beside it is the same link. A video's carries
29
+ `cite-video`, which the stylesheet draws a play mark on.
19
30
  #}
20
31
  {% macro page(url, context) %}
21
32
  {%- set title = (context.name or "") | trim -%}
@@ -27,12 +38,18 @@
27
38
  {%- else %}
28
39
  {%- if context.name %} <a class="u-url p-name" href="{{ url }}">{{ context.name }}</a>
29
40
  {%- elif context.author %} <a class="u-url" href="{{ url }}">a post</a>
30
- {%- else %} <a class="u-url" href="{{ url }}">{{ url }}</a>
41
+ {%- elif context.image %} <a class="u-url" href="{{ url }}">an image from {{ url | host }}</a>
42
+ {%- else %} <a class="u-url" href="{{ url }}">a page on {{ url | host }}</a>
31
43
  {%- endif %}
32
- {%- if context.author %} by {{ card(context.author, context.author.name) }}{% endif %}
44
+ {%- if context.author %} by {{ card(context.author, context.author.name) }}
45
+ {%- elif context.site %} · <span class="cite-site">{{ context.site }}</span>{% endif %}
33
46
  {%- endif %}
34
47
  {%- endmacro %}
35
48
 
49
+ {% macro thumb(url, picture) -%}
50
+ <a class="cite-thumb{% if picture.video %} cite-video{% endif %}" href="{{ url }}" tabindex="-1" aria-hidden="true">{{ picture.imgHtml | safe }}</a>
51
+ {%- endmacro %}
52
+
36
53
  {% macro card(author, name) -%}
37
54
  <span class="p-author h-card">
38
55
  {%- if author.url %}<a class="u-url p-name" href="{{ author.url }}">{{ name }}</a>
@@ -12,13 +12,18 @@
12
12
  or synced: its name, a short excerpt, its author and its date, each only when
13
13
  it said so. It is somebody else's words, so every piece is printed through
14
14
  autoescaping and none of it with `safe`. With a name, the name is the link;
15
- with only an author, "a post" is; with neither, the bare URL. Its date is
15
+ with only an author, "a post" is; with neither, "a page on" its host. Its date is
16
16
  written in `lang`, the language of the entry it sits in (TASK-189), so a
17
17
  listing sets `lang` from each entry as it sets `replyContext`.
18
+
19
+ `replyContext.picture`, when the target has one and the reply shows it, is
20
+ drawn as a thumbnail beside the line, as `citations.njk` draws it (TASK-252).
18
21
  #}
19
22
  {% import "partials/cited-page.njk" as cited %}
20
23
  {% if inReplyTo %}
21
- <div class="reply-context cite u-in-reply-to h-cite">
24
+ {% set picture = replyContext.picture %}
25
+ <div class="reply-context cite u-in-reply-to h-cite{% if picture %} cite-with-thumb{% endif %}">
26
+ {%- if picture %}{{ cited.thumb(inReplyTo, picture) }}{% endif %}
22
27
  <p class="cite-line small">In reply to
23
28
  {{- cited.page(inReplyTo, replyContext) }}
24
29
  {%- if replyContext.published %}, <time class="dt-published" datetime="{{ replyContext.published | date("iso") }}">{{ replyContext.published | date("readable", none, lang) }}</time>
@@ -643,6 +643,43 @@
643
643
  @apply mt-1 text-[0.98rem] leading-snug text-muted italic;
644
644
  }
645
645
 
646
+ .cite-with-thumb {
647
+ @apply grid grid-cols-[6rem_minmax(0,1fr)] items-start gap-x-3;
648
+ }
649
+
650
+ .cite-with-thumb > :not(.cite-thumb) {
651
+ @apply col-start-2;
652
+ }
653
+
654
+ .cite-thumb {
655
+ @apply relative row-span-2 block;
656
+ }
657
+
658
+ .cite-thumb img {
659
+ @apply block aspect-[4/3] h-auto w-full rounded-sm object-cover;
660
+ }
661
+
662
+ .cite-video::before {
663
+ @apply absolute inset-0 m-auto size-9 rounded-full;
664
+ content: '';
665
+ background: rgb(0 0 0 / 0.65);
666
+ }
667
+
668
+ .cite-video::after {
669
+ @apply absolute inset-0 m-auto h-4 w-3.5 translate-x-[10%];
670
+ content: '';
671
+ background: #fff;
672
+ clip-path: polygon(0 0, 100% 50%, 0 100%);
673
+ }
674
+
675
+ .cite-photo {
676
+ @apply mt-2 block;
677
+ }
678
+
679
+ .cite-photo img {
680
+ @apply block h-auto max-w-full rounded-sm;
681
+ }
682
+
646
683
  /* One post or page: `article.blog-post.h-entry`. */
647
684
  .post-header {
648
685
  @apply mb-8;
@@ -7,6 +7,9 @@
7
7
  --tw-font-weight: initial;
8
8
  --tw-tracking: initial;
9
9
  --tw-border-style: solid;
10
+ --tw-translate-x: 0;
11
+ --tw-translate-y: 0;
12
+ --tw-translate-z: 0;
10
13
  --tw-space-y-reverse: 0;
11
14
  --tw-shadow: 0 0 #0000;
12
15
  --tw-shadow-color: initial;
@@ -1156,6 +1159,68 @@
1156
1159
  font-style: italic;
1157
1160
  }
1158
1161
 
1162
+ .cite-with-thumb {
1163
+ align-items: flex-start;
1164
+ column-gap: calc(var(--spacing) * 3);
1165
+ grid-template-columns: 6rem minmax(0, 1fr);
1166
+ display: grid;
1167
+ }
1168
+
1169
+ .cite-with-thumb > :not(.cite-thumb) {
1170
+ grid-column-start: 2;
1171
+ }
1172
+
1173
+ .cite-thumb {
1174
+ grid-row: span 2 / span 2;
1175
+ display: block;
1176
+ position: relative;
1177
+ }
1178
+
1179
+ .cite-thumb img {
1180
+ aspect-ratio: 4 / 3;
1181
+ border-radius: var(--radius-sm);
1182
+ object-fit: cover;
1183
+ width: 100%;
1184
+ height: auto;
1185
+ display: block;
1186
+ }
1187
+
1188
+ .cite-video:before {
1189
+ width: calc(var(--spacing) * 9);
1190
+ height: calc(var(--spacing) * 9);
1191
+ content: "";
1192
+ background: #000000a6;
1193
+ border-radius: 3.40282e38px;
1194
+ margin: auto;
1195
+ position: absolute;
1196
+ inset: 0;
1197
+ }
1198
+
1199
+ .cite-video:after {
1200
+ height: calc(var(--spacing) * 4);
1201
+ width: calc(var(--spacing) * 3.5);
1202
+ --tw-translate-x: 10%;
1203
+ translate: var(--tw-translate-x) var(--tw-translate-y);
1204
+ content: "";
1205
+ clip-path: polygon(0 0, 100% 50%, 0 100%);
1206
+ background: #fff;
1207
+ margin: auto;
1208
+ position: absolute;
1209
+ inset: 0;
1210
+ }
1211
+
1212
+ .cite-photo {
1213
+ margin-top: calc(var(--spacing) * 2);
1214
+ display: block;
1215
+ }
1216
+
1217
+ .cite-photo img {
1218
+ border-radius: var(--radius-sm);
1219
+ max-width: 100%;
1220
+ height: auto;
1221
+ display: block;
1222
+ }
1223
+
1159
1224
  .post-header {
1160
1225
  margin-bottom: calc(var(--spacing) * 8);
1161
1226
  }
@@ -2283,6 +2348,24 @@
2283
2348
  initial-value: solid;
2284
2349
  }
2285
2350
 
2351
+ @property --tw-translate-x {
2352
+ syntax: "*";
2353
+ inherits: false;
2354
+ initial-value: 0;
2355
+ }
2356
+
2357
+ @property --tw-translate-y {
2358
+ syntax: "*";
2359
+ inherits: false;
2360
+ initial-value: 0;
2361
+ }
2362
+
2363
+ @property --tw-translate-z {
2364
+ syntax: "*";
2365
+ inherits: false;
2366
+ initial-value: 0;
2367
+ }
2368
+
2286
2369
  @property --tw-space-y-reverse {
2287
2370
  syntax: "*";
2288
2371
  inherits: false;