@geekity/cms 0.4.0 → 0.5.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 (143) hide show
  1. package/README.md +234 -108
  2. package/admin/pages/documents/editor.njk +0 -13
  3. package/admin/pages/{settings/federation.njk → federation/settings.njk} +7 -5
  4. package/admin/pages/navigation/menus.njk +129 -0
  5. package/admin/pages/settings/reading.njk +2 -10
  6. package/admin/pages/tools/content-index.njk +89 -0
  7. package/admin/pages/users/list.njk +5 -2
  8. package/admin/static/admin.css +60 -0
  9. package/dist/access-log.d.ts +44 -0
  10. package/dist/access-log.d.ts.map +1 -0
  11. package/dist/access-log.js +71 -0
  12. package/dist/access-log.js.map +1 -0
  13. package/dist/admin/documents.d.ts +3 -13
  14. package/dist/admin/documents.d.ts.map +1 -1
  15. package/dist/admin/documents.js +2 -34
  16. package/dist/admin/documents.js.map +1 -1
  17. package/dist/admin/federation.d.ts +10 -0
  18. package/dist/admin/federation.d.ts.map +1 -1
  19. package/dist/admin/federation.js +10 -0
  20. package/dist/admin/federation.js.map +1 -1
  21. package/dist/admin/index.d.ts +3 -3
  22. package/dist/admin/index.d.ts.map +1 -1
  23. package/dist/admin/index.js +2 -2
  24. package/dist/admin/index.js.map +1 -1
  25. package/dist/admin/menu.d.ts.map +1 -1
  26. package/dist/admin/menu.js +19 -2
  27. package/dist/admin/menu.js.map +1 -1
  28. package/dist/admin/navigation.d.ts +155 -0
  29. package/dist/admin/navigation.d.ts.map +1 -0
  30. package/dist/admin/navigation.js +292 -0
  31. package/dist/admin/navigation.js.map +1 -0
  32. package/dist/admin/routes.d.ts.map +1 -1
  33. package/dist/admin/routes.js +9 -0
  34. package/dist/admin/routes.js.map +1 -1
  35. package/dist/admin/session.d.ts +17 -3
  36. package/dist/admin/session.d.ts.map +1 -1
  37. package/dist/admin/session.js +19 -5
  38. package/dist/admin/session.js.map +1 -1
  39. package/dist/admin/settings-federation.d.ts +10 -1
  40. package/dist/admin/settings-federation.d.ts.map +1 -1
  41. package/dist/admin/settings-federation.js +26 -6
  42. package/dist/admin/settings-federation.js.map +1 -1
  43. package/dist/admin/settings-page.d.ts +26 -9
  44. package/dist/admin/settings-page.d.ts.map +1 -1
  45. package/dist/admin/settings-page.js +18 -12
  46. package/dist/admin/settings-page.js.map +1 -1
  47. package/dist/admin/settings-pages.d.ts +14 -3
  48. package/dist/admin/settings-pages.d.ts.map +1 -1
  49. package/dist/admin/settings-pages.js +15 -5
  50. package/dist/admin/settings-pages.js.map +1 -1
  51. package/dist/admin/settings-reading.d.ts +5 -4
  52. package/dist/admin/settings-reading.d.ts.map +1 -1
  53. package/dist/admin/settings-reading.js +6 -5
  54. package/dist/admin/settings-reading.js.map +1 -1
  55. package/dist/admin/settings.d.ts +29 -15
  56. package/dist/admin/settings.d.ts.map +1 -1
  57. package/dist/admin/settings.js +28 -78
  58. package/dist/admin/settings.js.map +1 -1
  59. package/dist/admin/templates.d.ts +3 -1
  60. package/dist/admin/templates.d.ts.map +1 -1
  61. package/dist/admin/templates.js +3 -1
  62. package/dist/admin/templates.js.map +1 -1
  63. package/dist/admin/tools.d.ts +111 -0
  64. package/dist/admin/tools.d.ts.map +1 -0
  65. package/dist/admin/tools.js +182 -0
  66. package/dist/admin/tools.js.map +1 -0
  67. package/dist/cli.d.ts.map +1 -1
  68. package/dist/cli.js +6 -1
  69. package/dist/cli.js.map +1 -1
  70. package/dist/comments/form.d.ts +48 -0
  71. package/dist/comments/form.d.ts.map +1 -1
  72. package/dist/comments/form.js +15 -0
  73. package/dist/comments/form.js.map +1 -1
  74. package/dist/comments/index.d.ts +4 -3
  75. package/dist/comments/index.d.ts.map +1 -1
  76. package/dist/comments/index.js +2 -1
  77. package/dist/comments/index.js.map +1 -1
  78. package/dist/comments/routes.d.ts +3 -1
  79. package/dist/comments/routes.d.ts.map +1 -1
  80. package/dist/comments/routes.js +46 -11
  81. package/dist/comments/routes.js.map +1 -1
  82. package/dist/comments/submission.d.ts +37 -3
  83. package/dist/comments/submission.d.ts.map +1 -1
  84. package/dist/comments/submission.js +59 -20
  85. package/dist/comments/submission.js.map +1 -1
  86. package/dist/comments/viewer.d.ts +21 -0
  87. package/dist/comments/viewer.d.ts.map +1 -0
  88. package/dist/comments/viewer.js +45 -0
  89. package/dist/comments/viewer.js.map +1 -0
  90. package/dist/config.d.ts +35 -0
  91. package/dist/config.d.ts.map +1 -1
  92. package/dist/config.js +3 -0
  93. package/dist/config.js.map +1 -1
  94. package/dist/content/store.d.ts +18 -0
  95. package/dist/content/store.d.ts.map +1 -1
  96. package/dist/content/store.js +18 -0
  97. package/dist/content/store.js.map +1 -1
  98. package/dist/env.d.ts +12 -1
  99. package/dist/env.d.ts.map +1 -1
  100. package/dist/federation/mount.d.ts +4 -0
  101. package/dist/federation/mount.d.ts.map +1 -1
  102. package/dist/federation/mount.js +44 -12
  103. package/dist/federation/mount.js.map +1 -1
  104. package/dist/index.d.ts +5 -5
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +21 -4
  107. package/dist/index.js.map +1 -1
  108. package/dist/web/index.d.ts +3 -3
  109. package/dist/web/index.d.ts.map +1 -1
  110. package/dist/web/index.js +1 -1
  111. package/dist/web/index.js.map +1 -1
  112. package/dist/web/navigation.d.ts +158 -36
  113. package/dist/web/navigation.d.ts.map +1 -1
  114. package/dist/web/navigation.js +250 -60
  115. package/dist/web/navigation.js.map +1 -1
  116. package/dist/web/negotiate.d.ts +22 -0
  117. package/dist/web/negotiate.d.ts.map +1 -1
  118. package/dist/web/negotiate.js +25 -10
  119. package/dist/web/negotiate.js.map +1 -1
  120. package/dist/web/render.d.ts +16 -10
  121. package/dist/web/render.d.ts.map +1 -1
  122. package/dist/web/render.js +21 -14
  123. package/dist/web/render.js.map +1 -1
  124. package/dist/web/routes.d.ts.map +1 -1
  125. package/dist/web/routes.js +11 -2
  126. package/dist/web/routes.js.map +1 -1
  127. package/dist/web/themes.d.ts +21 -0
  128. package/dist/web/themes.d.ts.map +1 -1
  129. package/dist/web/themes.js +37 -0
  130. package/dist/web/themes.js.map +1 -1
  131. package/package.json +1 -1
  132. package/templates/site/content/_data/site.json +7 -0
  133. package/templates/site/content/pages/about.md +7 -0
  134. package/themes/default/README.md +200 -80
  135. package/themes/default/layouts/author.njk +3 -4
  136. package/themes/default/layouts/base.njk +38 -49
  137. package/themes/default/layouts/front-page.njk +1 -2
  138. package/themes/default/partials/bio.njk +15 -21
  139. package/themes/default/partials/comment-form.njk +31 -3
  140. package/themes/default/partials/menu.njk +32 -0
  141. package/themes/default/partials/search-form.njk +5 -0
  142. package/themes/default/static/style.css +31 -8
  143. package/themes/default/theme.json +5 -1
@@ -13,6 +13,13 @@
13
13
  every label, field and button through them — so the contact form wears the
14
14
  same class rather than repeating the rules.
15
15
 
16
+ It draws two forms. For a stranger: the name, email and website boxes, the
17
+ honeypot and the loaded-at stamp. For somebody signed in to this site's
18
+ admin — `commentForm.signedInAs` — none of those, because the site already
19
+ knows all three and a session is better evidence than a honeypot, and a
20
+ hidden CSRF token instead, because this form posts under somebody's name.
21
+ A theme that replaces this partial has to draw both.
22
+
16
23
  It works with JavaScript switched off, and there is no script on it.
17
24
  #}
18
25
  <section class="comment-respond" id="respond">
@@ -28,7 +35,6 @@
28
35
 
29
36
  <form method="post" action="{{ commentForm.action }}">
30
37
  <input type="hidden" name="{{ commentForm.fields.post }}" value="{{ commentForm.post }}" />
31
- <input type="hidden" name="{{ commentForm.fields.loaded }}" value="{{ commentForm.loaded }}" />
32
38
  {#
33
39
  What this comment answers. `commentReplyTo` is the `?reply_to=` on the
34
40
  URL, which a Reply link put there and the CMS has already checked names
@@ -45,6 +51,26 @@
45
51
  </p>
46
52
  {% endif %}
47
53
 
54
+ {% if commentForm.signedInAs %}
55
+ {#
56
+ Signed in to this site. The comment is attributed from the account, so
57
+ there is nothing to type and nothing to get wrong; the token is what
58
+ stops a page on another site posting under this name without them
59
+ knowing.
60
+ #}
61
+ <input type="hidden" name="{{ commentForm.fields.csrf }}" value="{{ commentForm.csrfToken }}" />
62
+
63
+ <p class="comment-signed-in">
64
+ Commenting as <a href="{{ commentForm.signedInAs.url }}">{{ commentForm.signedInAs.name }}</a>.
65
+ </p>
66
+ {% else %}
67
+ {#
68
+ When this form was drawn, which is what the minimum submit time is
69
+ measured against. A signed-in form carries none: a session says more
70
+ about whether this is a person than a stopwatch does.
71
+ #}
72
+ <input type="hidden" name="{{ commentForm.fields.loaded }}" value="{{ commentForm.loaded }}" />
73
+
48
74
  {#
49
75
  The honeypot. Hidden from sight and from assistive technology, out of the
50
76
  tab order, and told not to autofill: a person never sees it and never
@@ -78,6 +104,7 @@
78
104
  <span class="comment-field-error">{{ commentForm.problems.url }}</span>
79
105
  {% endif %}
80
106
  </p>
107
+ {% endif %}
81
108
 
82
109
  <p class="comment-field">
83
110
  <label for="comment-body">Comment</label>
@@ -92,8 +119,9 @@
92
119
  "Tell me about replies". Only on a site that can actually send mail —
93
120
  `notifiable` is false otherwise — because a box that promised a message
94
121
  nothing would ever send would be a lie on a form. The address is the one
95
- typed above, is never shown anywhere, and every message it sends carries
96
- a one-click unsubscribe link.
122
+ typed above — or the account's, for somebody signed in — is never shown
123
+ anywhere, and every message it sends carries a one-click unsubscribe
124
+ link.
97
125
  #}
98
126
  {% if commentForm.notifiable %}
99
127
  <p class="comment-check">
@@ -0,0 +1,32 @@
1
+ {#
2
+ One menu, drawn.
3
+
4
+ The CMS puts every menu the site stores on the context as `menus`, keyed by
5
+ the name it is stored under, each item already knowing whether it is the page
6
+ being looked at (TASK-107). This theme declares two of those names in its
7
+ `theme.json` — `primary` and `footer` — and draws each through this macro, so
8
+ the markup of a menu is written once:
9
+
10
+ {% import "partials/menu.njk" as nav %}
11
+ {{ nav.list(menus.footer, "Footer") }}
12
+
13
+ Nothing is printed for a menu with nothing in it: an area a site has not
14
+ filled in is an area with no nav element, not an empty list.
15
+
16
+ `label` is the `aria-label`, which is what tells a reader on a screen reader
17
+ which of a page's menus this one is. Two navs with no labels are two navs
18
+ called "navigation".
19
+
20
+ An item marked `me` carries `rel="me"`, which is how Mastodon and the rest of
21
+ the IndieWeb verify that the site and the profile it links belong to the same
22
+ person: the profile links back, and the pair is the proof.
23
+ #}
24
+ {% macro list(items, label) %}{% if items.length %}
25
+ <nav class="site-nav" aria-label="{{ label }}">
26
+ <ul class="hlist">
27
+ {% for item in items %}
28
+ <li><a href="{{ item.url | url }}"{% if item.me %} rel="me"{% endif %}{% if item.current %} class="is-current" aria-current="page"{% endif %}>{{ item.label }}</a></li>
29
+ {% endfor %}
30
+ </ul>
31
+ </nav>
32
+ {% endif %}{% endmacro %}
@@ -2,6 +2,11 @@
2
2
  The site's search box (TASK-22): a plain GET form, so a search is a URL a
3
3
  reader can bookmark or share and the box needs no JavaScript.
4
4
 
5
+ `layouts/search.njk` is the only thing that includes it (TASK-105): the box
6
+ was in the footer of every page as well, and search is a menu item now —
7
+ a `Search | /search/` line like any other — so the page about searching is
8
+ where the box is.
9
+
5
10
  Expects nothing. `query`, when the page has one, goes back in the box, so the
6
11
  results page shows what was searched for. The label is read out rather than
7
12
  shown, because the button beside the box already says what it is for, and it
@@ -616,6 +616,29 @@ pre code {
616
616
  text-decoration: none;
617
617
  }
618
618
 
619
+ /* The site menu, which the header carries on every page (TASK-105). At the
620
+ root the header is the site title with the tagline under it, and the menu
621
+ is a line of its own under that. */
622
+ .global-header .site-nav {
623
+ margin-top: var(--spacing-2);
624
+ font-size: var(--fontSize-0);
625
+ }
626
+
627
+ /* Everywhere else the header is the small link home, and the menu sits beside
628
+ it on the same line — the two wrap onto a second line together rather than
629
+ the menu dropping under the link on a narrow screen. */
630
+ .global-wrapper:not([data-is-root-path='true']) .global-header {
631
+ display: flex;
632
+ flex-wrap: wrap;
633
+ align-items: baseline;
634
+ column-gap: var(--spacing-5);
635
+ row-gap: var(--spacing-1);
636
+ }
637
+
638
+ .global-wrapper:not([data-is-root-path='true']) .global-header .site-nav {
639
+ margin-top: var(--spacing-0);
640
+ }
641
+
619
642
  /* An entry: a post or a page (TASK-83). The source design's own rules — the
620
643
  title tight against the words under it, a subtitle in the heading font —
621
644
  plus the small line the `e-content` ends on, which carries the permalink,
@@ -667,10 +690,9 @@ pre code {
667
690
  font-style: italic;
668
691
  }
669
692
 
670
- /* The site menu, and an author archive's `rel="me"` links: both horizontal
671
- lists under the credit, small, in the heading font like every other piece
672
- of navigation. */
673
- .bio .site-nav,
693
+ /* The links the person calls their own, under the credit: a horizontal list,
694
+ small, in the heading font. The site menu used to share this rule; it is in
695
+ the header now (TASK-105) and the bio carries nobody but the person. */
674
696
  .bio-links {
675
697
  margin-top: var(--spacing-2);
676
698
  font-size: var(--fontSize-0);
@@ -803,9 +825,9 @@ pre code {
803
825
  font-size: var(--fontSize-0);
804
826
  }
805
827
 
806
- /* The search box (TASK-22): a field and a button on one line, in the footer
807
- of every page and at the top of the search page. The field is drawn the way
808
- the comment form's are, so the site has one look for a place to type. */
828
+ /* The search box (TASK-22): a field and a button on one line, at the top of
829
+ the search page and nowhere else (TASK-105). The field is drawn the way the
830
+ comment form's are, so the site has one look for a place to type. */
809
831
 
810
832
  .search-form {
811
833
  display: flex;
@@ -1185,7 +1207,8 @@ pre code {
1185
1207
  border-inline-start-color: var(--color-error);
1186
1208
  }
1187
1209
 
1188
- .comment-replying-to {
1210
+ .comment-replying-to,
1211
+ .comment-signed-in {
1189
1212
  margin: 0 0 var(--spacing-4);
1190
1213
  font-family: var(--font-heading);
1191
1214
  font-size: var(--fontSize-0);
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "name": "Default",
3
3
  "kind": "site",
4
- "description": "The theme that ships with Geekity: plain Nunjucks and plain CSS, and the layer every other theme is laid over."
4
+ "description": "The theme that ships with Geekity: plain Nunjucks and plain CSS, and the layer every other theme is laid over.",
5
+ "areas": [
6
+ { "name": "primary", "label": "Site menu" },
7
+ { "name": "footer", "label": "Footer links" }
8
+ ]
5
9
  }