@geekity/cms 0.4.0 → 0.6.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 (156) hide show
  1. package/README.md +246 -110
  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 +132 -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/edit.njk +25 -2
  8. package/admin/pages/users/list.njk +5 -2
  9. package/admin/static/admin.css +78 -3
  10. package/dist/access-log.d.ts +44 -0
  11. package/dist/access-log.d.ts.map +1 -0
  12. package/dist/access-log.js +71 -0
  13. package/dist/access-log.js.map +1 -0
  14. package/dist/admin/accounts.d.ts +10 -0
  15. package/dist/admin/accounts.d.ts.map +1 -1
  16. package/dist/admin/accounts.js +15 -3
  17. package/dist/admin/accounts.js.map +1 -1
  18. package/dist/admin/documents.d.ts +3 -13
  19. package/dist/admin/documents.d.ts.map +1 -1
  20. package/dist/admin/documents.js +2 -34
  21. package/dist/admin/documents.js.map +1 -1
  22. package/dist/admin/federation.d.ts +10 -0
  23. package/dist/admin/federation.d.ts.map +1 -1
  24. package/dist/admin/federation.js +10 -0
  25. package/dist/admin/federation.js.map +1 -1
  26. package/dist/admin/index.d.ts +3 -3
  27. package/dist/admin/index.d.ts.map +1 -1
  28. package/dist/admin/index.js +2 -2
  29. package/dist/admin/index.js.map +1 -1
  30. package/dist/admin/menu.d.ts.map +1 -1
  31. package/dist/admin/menu.js +19 -2
  32. package/dist/admin/menu.js.map +1 -1
  33. package/dist/admin/navigation.d.ts +155 -0
  34. package/dist/admin/navigation.d.ts.map +1 -0
  35. package/dist/admin/navigation.js +292 -0
  36. package/dist/admin/navigation.js.map +1 -0
  37. package/dist/admin/routes.d.ts.map +1 -1
  38. package/dist/admin/routes.js +9 -0
  39. package/dist/admin/routes.js.map +1 -1
  40. package/dist/admin/session.d.ts +17 -3
  41. package/dist/admin/session.d.ts.map +1 -1
  42. package/dist/admin/session.js +19 -5
  43. package/dist/admin/session.js.map +1 -1
  44. package/dist/admin/settings-federation.d.ts +10 -1
  45. package/dist/admin/settings-federation.d.ts.map +1 -1
  46. package/dist/admin/settings-federation.js +26 -6
  47. package/dist/admin/settings-federation.js.map +1 -1
  48. package/dist/admin/settings-page.d.ts +26 -9
  49. package/dist/admin/settings-page.d.ts.map +1 -1
  50. package/dist/admin/settings-page.js +18 -12
  51. package/dist/admin/settings-page.js.map +1 -1
  52. package/dist/admin/settings-pages.d.ts +14 -3
  53. package/dist/admin/settings-pages.d.ts.map +1 -1
  54. package/dist/admin/settings-pages.js +15 -5
  55. package/dist/admin/settings-pages.js.map +1 -1
  56. package/dist/admin/settings-reading.d.ts +5 -4
  57. package/dist/admin/settings-reading.d.ts.map +1 -1
  58. package/dist/admin/settings-reading.js +6 -5
  59. package/dist/admin/settings-reading.js.map +1 -1
  60. package/dist/admin/settings.d.ts +29 -15
  61. package/dist/admin/settings.d.ts.map +1 -1
  62. package/dist/admin/settings.js +28 -78
  63. package/dist/admin/settings.js.map +1 -1
  64. package/dist/admin/templates.d.ts +3 -1
  65. package/dist/admin/templates.d.ts.map +1 -1
  66. package/dist/admin/templates.js +3 -1
  67. package/dist/admin/templates.js.map +1 -1
  68. package/dist/admin/tools.d.ts +111 -0
  69. package/dist/admin/tools.d.ts.map +1 -0
  70. package/dist/admin/tools.js +182 -0
  71. package/dist/admin/tools.js.map +1 -0
  72. package/dist/admin/users.d.ts +24 -0
  73. package/dist/admin/users.d.ts.map +1 -1
  74. package/dist/admin/users.js +102 -30
  75. package/dist/admin/users.js.map +1 -1
  76. package/dist/cli.d.ts.map +1 -1
  77. package/dist/cli.js +6 -1
  78. package/dist/cli.js.map +1 -1
  79. package/dist/comments/form.d.ts +48 -0
  80. package/dist/comments/form.d.ts.map +1 -1
  81. package/dist/comments/form.js +15 -0
  82. package/dist/comments/form.js.map +1 -1
  83. package/dist/comments/index.d.ts +4 -3
  84. package/dist/comments/index.d.ts.map +1 -1
  85. package/dist/comments/index.js +2 -1
  86. package/dist/comments/index.js.map +1 -1
  87. package/dist/comments/routes.d.ts +3 -1
  88. package/dist/comments/routes.d.ts.map +1 -1
  89. package/dist/comments/routes.js +46 -11
  90. package/dist/comments/routes.js.map +1 -1
  91. package/dist/comments/submission.d.ts +37 -3
  92. package/dist/comments/submission.d.ts.map +1 -1
  93. package/dist/comments/submission.js +59 -20
  94. package/dist/comments/submission.js.map +1 -1
  95. package/dist/comments/viewer.d.ts +21 -0
  96. package/dist/comments/viewer.d.ts.map +1 -0
  97. package/dist/comments/viewer.js +45 -0
  98. package/dist/comments/viewer.js.map +1 -0
  99. package/dist/config.d.ts +35 -0
  100. package/dist/config.d.ts.map +1 -1
  101. package/dist/config.js +3 -0
  102. package/dist/config.js.map +1 -1
  103. package/dist/content/store.d.ts +18 -0
  104. package/dist/content/store.d.ts.map +1 -1
  105. package/dist/content/store.js +18 -0
  106. package/dist/content/store.js.map +1 -1
  107. package/dist/env.d.ts +12 -1
  108. package/dist/env.d.ts.map +1 -1
  109. package/dist/federation/mount.d.ts +4 -0
  110. package/dist/federation/mount.d.ts.map +1 -1
  111. package/dist/federation/mount.js +60 -15
  112. package/dist/federation/mount.js.map +1 -1
  113. package/dist/index.d.ts +5 -5
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +21 -4
  116. package/dist/index.js.map +1 -1
  117. package/dist/web/authors.d.ts +15 -1
  118. package/dist/web/authors.d.ts.map +1 -1
  119. package/dist/web/authors.js +9 -1
  120. package/dist/web/authors.js.map +1 -1
  121. package/dist/web/index.d.ts +4 -4
  122. package/dist/web/index.d.ts.map +1 -1
  123. package/dist/web/index.js +1 -1
  124. package/dist/web/index.js.map +1 -1
  125. package/dist/web/navigation.d.ts +235 -35
  126. package/dist/web/navigation.d.ts.map +1 -1
  127. package/dist/web/navigation.js +333 -57
  128. package/dist/web/navigation.js.map +1 -1
  129. package/dist/web/negotiate.d.ts +22 -0
  130. package/dist/web/negotiate.d.ts.map +1 -1
  131. package/dist/web/negotiate.js +25 -10
  132. package/dist/web/negotiate.js.map +1 -1
  133. package/dist/web/render.d.ts +16 -10
  134. package/dist/web/render.d.ts.map +1 -1
  135. package/dist/web/render.js +21 -14
  136. package/dist/web/render.js.map +1 -1
  137. package/dist/web/routes.d.ts.map +1 -1
  138. package/dist/web/routes.js +11 -2
  139. package/dist/web/routes.js.map +1 -1
  140. package/dist/web/themes.d.ts +21 -0
  141. package/dist/web/themes.d.ts.map +1 -1
  142. package/dist/web/themes.js +37 -0
  143. package/dist/web/themes.js.map +1 -1
  144. package/package.json +1 -1
  145. package/templates/site/content/_data/site.json +7 -0
  146. package/templates/site/content/pages/about.md +7 -0
  147. package/themes/default/README.md +215 -80
  148. package/themes/default/layouts/author.njk +3 -4
  149. package/themes/default/layouts/base.njk +38 -49
  150. package/themes/default/layouts/front-page.njk +1 -2
  151. package/themes/default/partials/bio.njk +20 -22
  152. package/themes/default/partials/comment-form.njk +31 -3
  153. package/themes/default/partials/menu.njk +34 -0
  154. package/themes/default/partials/search-form.njk +5 -0
  155. package/themes/default/static/style.css +54 -13
  156. package/themes/default/theme.json +5 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,SAAS,EACT,kBAAkB,GACnB,MA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c,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,SAAS,EACT,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,gBAAgB,CAAC;AASxB,OAAO,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EACf,cAAc,GACf,MAAM,eAAe,CAAC;AAOvB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,aAAa,GACd,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EACL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cAAc;IAC3D,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,uEAAuE;AACvE,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAqDjD,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,QAAQ,GAAE,mBAAwB,GAAG,gBAAgB,EAAE,CA4BhF"}
@@ -18,12 +18,14 @@
18
18
  import { THEMES_PATH } from './appearance.js';
19
19
  import { COMMENTS_PATH } from './comments.js';
20
20
  import { newEditorPath, PAGE_KIND, POST_KIND } from './documents.js';
21
- import { FEDERATION_PATH } from './federation.js';
21
+ import { FEDERATION_PATH, FEDERATION_SETTINGS_PATH } from './federation.js';
22
22
  import { MEDIA_PATH } from './media.js';
23
23
  import { MESSAGES_PATH } from './messages.js';
24
+ import { NAVIGATION_PATH } from './navigation.js';
24
25
  import { settingsPagePath } from './settings-page.js';
25
26
  import { ADMIN_PREFIX } from './session.js';
26
27
  import { CATEGORY_KIND, TAG_KIND } from './taxonomy.js';
28
+ import { TOOLS_PATH } from './tools.js';
27
29
  import { ADD_USER_PATH, USERS_PATH } from './users.js';
28
30
  /** A screen naming a section or a child the registry does not hold. */
29
31
  export class UnknownAdminScreenError extends Error {
@@ -52,6 +54,10 @@ export const ADMIN_SECTIONS = [
52
54
  { child: 'all', label: 'All pages', url: PAGE_KIND.basePath },
53
55
  { child: 'new', label: 'Add new', url: newEditorPath(PAGE_KIND) },
54
56
  ]),
57
+ // After Pages, because a menu is mostly a list of them, and above Media for
58
+ // the same reason: it is content the site arranges rather than a setting.
59
+ // Not a settings page at all — the shape of the screen comes from the theme.
60
+ section('navigation', 'Navigation', [{ child: 'menus', label: 'Menus', url: NAVIGATION_PATH }]),
55
61
  section('media', 'Media', [{ child: 'library', label: 'Library', url: MEDIA_PATH }]),
56
62
  section('comments', 'Comments', [{ child: 'all', label: 'All comments', url: COMMENTS_PATH }]),
57
63
  section('messages', 'Messages', [{ child: 'all', label: 'All messages', url: MESSAGES_PATH }]),
@@ -63,18 +69,29 @@ export const ADMIN_SECTIONS = [
63
69
  { child: 'all', label: 'All users', url: USERS_PATH },
64
70
  { child: 'new', label: 'Add new', url: ADD_USER_PATH },
65
71
  ]),
72
+ // Where WordPress keeps Tools: after Users, before Settings. A setting is
73
+ // something you type and save; this is a job you run, so it is not a
74
+ // seventh settings page — the children of Settings are the settings pages,
75
+ // and nothing else belongs in that list.
76
+ section('tools', 'Tools', [{ child: 'index', label: 'Content index', url: TOOLS_PATH }]),
66
77
  // WordPress's own pages, in its own order. General is first because the
67
78
  // heading lands on the first child and General is `/admin/settings` itself.
79
+ // Federation's settings are not here: they are a child of the Federation
80
+ // section, because that is what they are about (TASK-109).
68
81
  section('settings', 'Settings', [
69
82
  { child: 'general', label: 'General', url: settingsPagePath('general') },
70
83
  { child: 'reading', label: 'Reading', url: settingsPagePath('reading') },
71
84
  { child: 'permalinks', label: 'Permalinks', url: settingsPagePath('permalinks') },
72
85
  { child: 'discussion', label: 'Discussion', url: settingsPagePath('discussion') },
73
86
  { child: 'email', label: 'Email', url: settingsPagePath('email') },
74
- { child: 'federation', label: 'Federation', url: settingsPagePath('federation') },
75
87
  ]),
88
+ // Everything about federation, in the order somebody comes to it: the
89
+ // heading lands on Followers, which is what the section is opened to look
90
+ // at, and Settings is what it is opened to change, which is the rarer
91
+ // errand.
76
92
  section('federation', 'Federation', [
77
93
  { child: 'followers', label: 'Followers', url: FEDERATION_PATH },
94
+ { child: 'settings', label: 'Settings', url: FEDERATION_SETTINGS_PATH },
78
95
  ]),
79
96
  ];
80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,KAAK,KAAK,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,uBAAuB,CAC/B,oBAAoB,MAAM,CAAC,IAAI,CAAC,gCAAgC,MAAM,CAAC,KAAK,CAAC,GAAG,CACjF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpC,GAAG,KAAK;QACR,IAAI,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACtC,GAAG,IAAI;YACP,OAAO,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK;SACxD,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;AACN,CAAC;AAED,yDAAyD;AACzD,SAAS,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,QAA0B;IACtE,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;IACzB,wEAAwE;IACxE,4EAA4E;IAC5E,IAAI,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,KAAK,iCAAiC,CAAC,CAAC;IACxF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC5D,CAAC;AAED,uCAAuC;AACvC,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Navigation: every menu this site holds, and what renders it.
3
+ *
4
+ * A menu is a named thing the site stores and the theme asks for (TASK-107),
5
+ * and this is where somebody manages them. It is a top-level section after
6
+ * Pages rather than a settings page, on purpose: a menu is content a site
7
+ * arranges, the way its pages are, rather than a switch that changes how the
8
+ * site behaves — and the shape of this screen comes from the active theme,
9
+ * which is not something a page of fields can be.
10
+ *
11
+ * The screen is the cross product of two lists. The theme declares the areas
12
+ * it renders, in `theme.json`, each a name and a label; the site stores menus
13
+ * by name, in `content/_data/site.json`. An area with no stored menu is an
14
+ * empty box to fill in, not a missing one. A stored menu no area names is
15
+ * kept, rendered nowhere, and listed under a heading that says so — and this
16
+ * is the only screen that can show it, because nothing on the public site ever
17
+ * will.
18
+ *
19
+ * Adding a menu asks for a name, and that is the whole of adding one: a name
20
+ * the theme declares moves the box up into place, and a name it does not is a
21
+ * block waiting for the theme that will use it, which is what somebody writing
22
+ * a menu before switching themes wants. Deleting is offered only for the
23
+ * second kind, because an area the theme declares is emptied rather than
24
+ * removed — the theme would render nothing there either way, and the box has
25
+ * to stay for the next thing typed into it.
26
+ */
27
+ import type { Hono } from 'hono';
28
+ import type { GeekityEnv } from '../env.ts';
29
+ import type { NavigationMenus } from '../web/navigation.ts';
30
+ import type { ThemeArea } from '../web/themes.ts';
31
+ import type { AdminRender } from './documents.ts';
32
+ /**
33
+ * Where the Navigation screen lives.
34
+ *
35
+ * `/admin/navigation` itself rather than `/admin/navigation/menus`, the way
36
+ * Tools is `/admin/tools`: a section's heading lands on its first child, and
37
+ * this is the only one. It is also where one menu's items are saved.
38
+ */
39
+ export declare const NAVIGATION_PATH = "/admin/navigation";
40
+ /** Where the Add a menu form posts. */
41
+ export declare const ADD_MENU_PATH = "/admin/navigation/add";
42
+ /** Where a Delete button posts. */
43
+ export declare const DELETE_MENU_PATH = "/admin/navigation/delete";
44
+ /** The navigation section the screen marks as current. */
45
+ export declare const NAVIGATION_SECTION = "navigation";
46
+ /** The child of that section it is. */
47
+ export declare const MENUS_CHILD = "menus";
48
+ /** The fields the forms on the screen submit. */
49
+ export declare const NAVIGATION_FIELDS: {
50
+ /** Which menu a save or a delete is about: its name. */
51
+ readonly menu: 'menu';
52
+ /** One menu's items, one `Label | URL` per line. */
53
+ readonly items: 'items';
54
+ /** The name the Add form asks for. */
55
+ readonly name: 'name';
56
+ };
57
+ /** One menu as the screen draws it. */
58
+ export interface MenuBox {
59
+ /** The menu's name: what `site.json` keys it by and a theme loops over. */
60
+ name: string;
61
+ /** What the box is headed: the theme's label for the area, or the name. */
62
+ label: string;
63
+ /** Its items, as the textarea shows them, one line each. */
64
+ items: string;
65
+ /** Whether the active theme declares an area of this name. */
66
+ declared: boolean;
67
+ /** Whether the site stores a menu under this name at all. */
68
+ stored: boolean;
69
+ /** How many items it holds, for the line under the heading. */
70
+ count: number;
71
+ /** What was wrong with what was just typed into it, when something was. */
72
+ problem?: string | undefined;
73
+ }
74
+ /** The two lists the screen is, and the theme they were worked out from. */
75
+ export interface NavigationScreen {
76
+ /** The active theme's areas, in the order it declares them. */
77
+ areas: MenuBox[];
78
+ /** Every stored menu no area names, by name. */
79
+ others: MenuBox[];
80
+ /** What the active theme is called, for the prose above both lists. */
81
+ themeName: string;
82
+ }
83
+ /**
84
+ * The theme whose areas this screen offers, and what it is called.
85
+ *
86
+ * The first theme on the render's own search path that declares any areas,
87
+ * which for a site on the packaged theme is the packaged theme itself. That is
88
+ * the same rule Nunjucks resolves a template by (decision-15): a site theme is
89
+ * laid over the packaged one a file at a time and need only carry what it
90
+ * changes, so a theme that declares no areas has not overridden the
91
+ * declaration — and its inherited `layouts/base.njk` really is still rendering
92
+ * `menus.primary` and `menus.footer`. A screen that showed no areas for it
93
+ * would be offering nowhere to put the menus the site is visibly rendering.
94
+ */
95
+ export declare function activeThemeAreas(options: {
96
+ themesDir: string;
97
+ chosen: string;
98
+ }): {
99
+ areas: readonly ThemeArea[];
100
+ themeName: string;
101
+ };
102
+ /** What {@link navigationScreen} needs. */
103
+ export interface NavigationScreenOptions {
104
+ /** Every menu the site stores, as `site.json` holds them. */
105
+ menus: NavigationMenus;
106
+ /** Where the site's themes are. */
107
+ themesDir: string;
108
+ /** The theme the site has chosen, empty for the packaged one. */
109
+ chosen: string;
110
+ /** What was typed into one box and refused, so the box shows it back. */
111
+ typed?: {
112
+ menu: string;
113
+ items: string;
114
+ problem: string;
115
+ } | undefined;
116
+ }
117
+ /**
118
+ * The two lists the screen draws, out of the stored menus and the theme.
119
+ *
120
+ * The areas come first and in the theme's order, because that is the order
121
+ * they appear on the site; the rest follow by name, which is the only order
122
+ * they have. A menu is in exactly one of the two lists, so nothing is drawn
123
+ * twice and nothing a site holds is left off.
124
+ */
125
+ export declare function navigationScreen(options: NavigationScreenOptions): NavigationScreen;
126
+ /** What {@link mountNavigationScreen} needs from the admin around it. */
127
+ export interface MountNavigationOptions {
128
+ /** The admin's renderer, which injects the chrome, the CSRF token and the flash. */
129
+ render: AdminRender;
130
+ }
131
+ /**
132
+ * Register Navigation: the screen, the save of one menu, the add and the
133
+ * delete.
134
+ *
135
+ * Three POSTs rather than one, for the reason a settings page's credential
136
+ * form is its own: a refused add must not lose an edit somebody had typed into
137
+ * a box further up the page, and a delete must not depend on every box on the
138
+ * screen parsing. Each writes `content/_data/site.json` through the same
139
+ * atomic update every settings save uses, applied to the file as re-read
140
+ * inside the write (decision-9), so two people editing two menus at once both
141
+ * land.
142
+ */
143
+ export declare function mountNavigationScreen(app: Hono<GeekityEnv>, options: MountNavigationOptions): void;
144
+ /**
145
+ * What is wrong with a name the Add form submitted, or `undefined` when
146
+ * nothing is.
147
+ *
148
+ * The spelling rule comes from {@link menuNameProblem}, which is where it is
149
+ * written down; the only thing this adds is that the site does not already
150
+ * hold one. Adding a name it does hold is refused rather than shrugged at,
151
+ * because the box for that menu is already on the screen and an Add that
152
+ * silently did nothing would read as one that had failed.
153
+ */
154
+ export declare function addMenuProblem(name: string, menus: NavigationMenus): string | undefined;
155
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/admin/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAW,IAAI,EAAE,M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,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAChF,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,CAeA;AAED,2CAA2C;AAC3C,MAAM,WAAW,uBAAuB;IACtC,6DAA6D;IAC7D,KAAK,EAAE,eAAe,CAAC;IACvB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CACtE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CA2BnF;AAED,yEAAyE;AACzE,MAAM,WAAW,sBAAsB;IACrC,oFAAoF;IACpF,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,EACrB,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CAsKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAOvF"}
@@ -0,0 +1,292 @@
1
+ /**
2
+ * Navigation: every menu this site holds, and what renders it.
3
+ *
4
+ * A menu is a named thing the site stores and the theme asks for (TASK-107),
5
+ * and this is where somebody manages them. It is a top-level section after
6
+ * Pages rather than a settings page, on purpose: a menu is content a site
7
+ * arranges, the way its pages are, rather than a switch that changes how the
8
+ * site behaves — and the shape of this screen comes from the active theme,
9
+ * which is not something a page of fields can be.
10
+ *
11
+ * The screen is the cross product of two lists. The theme declares the areas
12
+ * it renders, in `theme.json`, each a name and a label; the site stores menus
13
+ * by name, in `content/_data/site.json`. An area with no stored menu is an
14
+ * empty box to fill in, not a missing one. A stored menu no area names is
15
+ * kept, rendered nowhere, and listed under a heading that says so — and this
16
+ * is the only screen that can show it, because nothing on the public site ever
17
+ * will.
18
+ *
19
+ * Adding a menu asks for a name, and that is the whole of adding one: a name
20
+ * the theme declares moves the box up into place, and a name it does not is a
21
+ * block waiting for the theme that will use it, which is what somebody writing
22
+ * a menu before switching themes wants. Deleting is offered only for the
23
+ * second kind, because an area the theme declares is emptied rather than
24
+ * removed — the theme would render nothing there either way, and the box has
25
+ * to stay for the next thing typed into it.
26
+ */
27
+ import { menuItemLineProblem, menuItemsFromText, menuItemsText, menuNameProblem, } from '../web/navigation.js';
28
+ import { chooseTheme, PACKAGED_THEME_DIR, readTheme } from '../web/themes.js';
29
+ import { flash } from './flash.js';
30
+ import { ADMIN_PREFIX } from './session.js';
31
+ import { readSiteSettings, updateSiteSettings } from './settings.js';
32
+ import { ADMIN_TEMPLATES } from './templates.js';
33
+ /**
34
+ * Where the Navigation screen lives.
35
+ *
36
+ * `/admin/navigation` itself rather than `/admin/navigation/menus`, the way
37
+ * Tools is `/admin/tools`: a section's heading lands on its first child, and
38
+ * this is the only one. It is also where one menu's items are saved.
39
+ */
40
+ export const NAVIGATION_PATH = `${ADMIN_PREFIX}/navigation`;
41
+ /** Where the Add a menu form posts. */
42
+ export const ADD_MENU_PATH = `${NAVIGATION_PATH}/add`;
43
+ /** Where a Delete button posts. */
44
+ export const DELETE_MENU_PATH = `${NAVIGATION_PATH}/delete`;
45
+ /** The navigation section the screen marks as current. */
46
+ export const NAVIGATION_SECTION = 'navigation';
47
+ /** The child of that section it is. */
48
+ export const MENUS_CHILD = 'menus';
49
+ /** The fields the forms on the screen submit. */
50
+ export const NAVIGATION_FIELDS = {
51
+ /** Which menu a save or a delete is about: its name. */
52
+ menu: 'menu',
53
+ /** One menu's items, one `Label | URL` per line. */
54
+ items: 'items',
55
+ /** The name the Add form asks for. */
56
+ name: 'name',
57
+ };
58
+ /**
59
+ * The theme whose areas this screen offers, and what it is called.
60
+ *
61
+ * The first theme on the render's own search path that declares any areas,
62
+ * which for a site on the packaged theme is the packaged theme itself. That is
63
+ * the same rule Nunjucks resolves a template by (decision-15): a site theme is
64
+ * laid over the packaged one a file at a time and need only carry what it
65
+ * changes, so a theme that declares no areas has not overridden the
66
+ * declaration — and its inherited `layouts/base.njk` really is still rendering
67
+ * `menus.primary` and `menus.footer`. A screen that showed no areas for it
68
+ * would be offering nowhere to put the menus the site is visibly rendering.
69
+ */
70
+ export function activeThemeAreas(options) {
71
+ const chosen = chooseTheme({ themesDir: options.themesDir, name: options.chosen });
72
+ const packaged = readTheme(PACKAGED_THEME_DIR);
73
+ const themes = [
74
+ ...(chosen.theme === undefined ? [] : [chosen.theme]),
75
+ ...(packaged.ok ? [packaged.theme] : []),
76
+ ];
77
+ const declaring = themes.find((theme) => theme.areas.length > 0);
78
+ const first = themes[0];
79
+ return {
80
+ areas: declaring?.areas ?? [],
81
+ themeName: first?.name ?? 'The theme in use',
82
+ };
83
+ }
84
+ /**
85
+ * The two lists the screen draws, out of the stored menus and the theme.
86
+ *
87
+ * The areas come first and in the theme's order, because that is the order
88
+ * they appear on the site; the rest follow by name, which is the only order
89
+ * they have. A menu is in exactly one of the two lists, so nothing is drawn
90
+ * twice and nothing a site holds is left off.
91
+ */
92
+ export function navigationScreen(options) {
93
+ const { areas, themeName } = activeThemeAreas(options);
94
+ const declared = new Set(areas.map((area) => area.name));
95
+ const box = (name, label, declaredHere) => {
96
+ const stored = options.menus[name];
97
+ const typed = options.typed?.menu === name ? options.typed : undefined;
98
+ return {
99
+ name,
100
+ label,
101
+ items: typed === undefined ? menuItemsText(stored ?? []) : typed.items,
102
+ declared: declaredHere,
103
+ stored: stored !== undefined,
104
+ count: stored?.length ?? 0,
105
+ ...(typed === undefined ? {} : { problem: typed.problem }),
106
+ };
107
+ };
108
+ return {
109
+ themeName,
110
+ areas: areas.map((area) => box(area.name, area.label, true)),
111
+ others: Object.keys(options.menus)
112
+ .filter((name) => !declared.has(name))
113
+ .sort((left, right) => left.localeCompare(right))
114
+ .map((name) => box(name, name, false)),
115
+ };
116
+ }
117
+ /**
118
+ * Register Navigation: the screen, the save of one menu, the add and the
119
+ * delete.
120
+ *
121
+ * Three POSTs rather than one, for the reason a settings page's credential
122
+ * form is its own: a refused add must not lose an edit somebody had typed into
123
+ * a box further up the page, and a delete must not depend on every box on the
124
+ * screen parsing. Each writes `content/_data/site.json` through the same
125
+ * atomic update every settings save uses, applied to the file as re-read
126
+ * inside the write (decision-9), so two people editing two menus at once both
127
+ * land.
128
+ */
129
+ export function mountNavigationScreen(app, options) {
130
+ const { render } = options;
131
+ app.get(NAVIGATION_PATH, (c) => render(c, ADMIN_TEMPLATES.navigation, screen(c)));
132
+ // Saving one menu's items. The name comes from a hidden field rather than
133
+ // the URL because that is what the form around the box already carries, and
134
+ // a name that is not on the screen is refused rather than created: adding a
135
+ // menu is the Add form's job, and a save that quietly invented one would
136
+ // make a typo into a menu nothing renders.
137
+ app.post(NAVIGATION_PATH, async (c) => {
138
+ const body = await c.req.parseBody();
139
+ const name = field(body[NAVIGATION_FIELDS.menu]).trim();
140
+ const items = field(body[NAVIGATION_FIELDS.items]);
141
+ const settings = readSiteSettings(c.var.config.contentDir);
142
+ const shown = navigationScreen({
143
+ menus: settings.menus,
144
+ themesDir: c.var.config.themesDir,
145
+ chosen: settings.theme,
146
+ });
147
+ const box = [...shown.areas, ...shown.others].find((entry) => entry.name === name);
148
+ if (box === undefined) {
149
+ flash(c, 'error', `Nothing was saved. This site has no menu called “${name}”.`);
150
+ return c.redirect(NAVIGATION_PATH, 303);
151
+ }
152
+ // The box comes back holding exactly what was typed into it, so a line to
153
+ // fix is still there to fix and nothing else on the screen has moved.
154
+ const problem = menuItemLineProblem(items);
155
+ if (problem !== undefined) {
156
+ c.status(400);
157
+ return render(c, ADMIN_TEMPLATES.navigation, {
158
+ ...screen(c, { menu: name, items, problem }),
159
+ hasProblems: true,
160
+ });
161
+ }
162
+ const parsed = menuItemsFromText(items);
163
+ await updateSiteSettings({
164
+ contentDir: c.var.config.contentDir,
165
+ change: (current) => ({ ...current, menus: { ...current.menus, [name]: parsed } }),
166
+ });
167
+ flash(c, 'notice', `${box.label} saved: ${count(parsed.length, 'item')}.`);
168
+ return c.redirect(NAVIGATION_PATH, 303);
169
+ });
170
+ // Adding a menu is adding a name. It starts empty, and it starts stored, so
171
+ // a menu written for a theme the site has not switched to yet is a menu the
172
+ // file really holds rather than a box that forgets itself.
173
+ app.post(ADD_MENU_PATH, async (c) => {
174
+ const body = await c.req.parseBody();
175
+ const name = field(body[NAVIGATION_FIELDS.name]).trim();
176
+ const settings = readSiteSettings(c.var.config.contentDir);
177
+ const problem = addMenuProblem(name, settings.menus);
178
+ if (problem !== undefined) {
179
+ c.status(400);
180
+ return render(c, ADMIN_TEMPLATES.navigation, {
181
+ ...screen(c),
182
+ newName: name,
183
+ nameProblem: problem,
184
+ hasProblems: true,
185
+ });
186
+ }
187
+ // An empty menu under that name, and only if the file still has none: the
188
+ // re-read inside the write is the same guard the check above is, against
189
+ // the same name added twice in the moment between them.
190
+ await updateSiteSettings({
191
+ contentDir: c.var.config.contentDir,
192
+ change: (current) => ({
193
+ ...current,
194
+ menus: { ...current.menus, [name]: current.menus[name] ?? [] },
195
+ }),
196
+ });
197
+ const { areas } = activeThemeAreas({
198
+ themesDir: c.var.config.themesDir,
199
+ chosen: settings.theme,
200
+ });
201
+ const declared = areas.some((area) => area.name === name);
202
+ flash(c, 'notice', declared
203
+ ? `The “${name}” menu is ready to fill in, and this theme renders it.`
204
+ : `The “${name}” menu is ready to fill in. This theme renders nothing under that name, so it is kept and rendered nowhere until a theme asks for it.`);
205
+ return c.redirect(NAVIGATION_PATH, 303);
206
+ });
207
+ // Deleting is the only way a menu is removed, and it is offered only for a
208
+ // menu the theme renders nowhere. An area the theme declares is emptied
209
+ // instead: deleting it would take away the box that is the only place its
210
+ // links can be typed, and the theme would go on asking for the name.
211
+ app.post(DELETE_MENU_PATH, async (c) => {
212
+ const body = await c.req.parseBody();
213
+ const name = field(body[NAVIGATION_FIELDS.menu]).trim();
214
+ const settings = readSiteSettings(c.var.config.contentDir);
215
+ const shown = navigationScreen({
216
+ menus: settings.menus,
217
+ themesDir: c.var.config.themesDir,
218
+ chosen: settings.theme,
219
+ });
220
+ if (shown.areas.some((area) => area.name === name)) {
221
+ flash(c, 'error', `Nothing was deleted. This theme renders “${name}”, so it is emptied rather than removed: clear its box and save.`);
222
+ return c.redirect(NAVIGATION_PATH, 303);
223
+ }
224
+ if (!shown.others.some((other) => other.name === name)) {
225
+ flash(c, 'error', `Nothing was deleted. This site has no menu called “${name}”.`);
226
+ return c.redirect(NAVIGATION_PATH, 303);
227
+ }
228
+ await updateSiteSettings({
229
+ contentDir: c.var.config.contentDir,
230
+ change: (current) => {
231
+ const menus = { ...current.menus };
232
+ delete menus[name];
233
+ return { ...current, menus };
234
+ },
235
+ });
236
+ flash(c, 'notice', `The “${name}” menu is gone.`);
237
+ return c.redirect(NAVIGATION_PATH, 303);
238
+ });
239
+ /** Everything the template renders. */
240
+ function screen(c, typed) {
241
+ const settings = readSiteSettings(c.var.config.contentDir);
242
+ const shown = navigationScreen({
243
+ menus: settings.menus,
244
+ themesDir: c.var.config.themesDir,
245
+ chosen: settings.theme,
246
+ typed,
247
+ });
248
+ return {
249
+ section: NAVIGATION_SECTION,
250
+ child: MENUS_CHILD,
251
+ heading: 'Navigation',
252
+ navigationUrl: NAVIGATION_PATH,
253
+ addUrl: ADD_MENU_PATH,
254
+ deleteUrl: DELETE_MENU_PATH,
255
+ fields: NAVIGATION_FIELDS,
256
+ areas: shown.areas,
257
+ others: shown.others,
258
+ themeName: shown.themeName,
259
+ newName: '',
260
+ nameProblem: '',
261
+ hasProblems: false,
262
+ };
263
+ }
264
+ }
265
+ /**
266
+ * What is wrong with a name the Add form submitted, or `undefined` when
267
+ * nothing is.
268
+ *
269
+ * The spelling rule comes from {@link menuNameProblem}, which is where it is
270
+ * written down; the only thing this adds is that the site does not already
271
+ * hold one. Adding a name it does hold is refused rather than shrugged at,
272
+ * because the box for that menu is already on the screen and an Add that
273
+ * silently did nothing would read as one that had failed.
274
+ */
275
+ export function addMenuProblem(name, menus) {
276
+ const problem = menuNameProblem(name);
277
+ if (problem !== undefined)
278
+ return problem;
279
+ if (menus[name] !== undefined) {
280
+ return `This site already has a menu called “${name}”. Its box is on this page.`;
281
+ }
282
+ return undefined;
283
+ }
284
+ /** "1 item", "2 items". */
285
+ function count(howMany, singular) {
286
+ return `${String(howMany)} ${howMany === 1 ? singular : `${singular}s`}`;
287
+ }
288
+ /** One submitted field as a string. */
289
+ function field(value) {
290
+ return typeof value === 'string' ? value : '';
291
+ }
292
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/admin/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG9E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,YAAY,aAAa,CAAC;AAE5D,uCAAuC;AACvC,MAAM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AAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAChD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/admin/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAuC5C,kCAAkC;AAClC,eAAO,MAAM,UAAU,iBAA0B,CAAC;AAClD,sCAAsC;AACtC,eAAO,MAAM,UAAU,iBAA0B,CAAC;AAClD,mCAAmC;AACnC,eAAO,MAAM,WAAW,kBAA2B,CAAC;AAEpD,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,yCAAyC;AACzC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAoUtD;AAKD;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAwC/C,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/admin/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAyC5C,kCAAkC;AAClC,eAAO,MAAM,UAAU,iBAA0B,CAAC;AAClD,sCAAsC;AACtC,eAAO,MAAM,UAAU,iBAA0B,CAAC;AAClD,mCAAmC;AACnC,eAAO,MAAM,WAAW,kBAA2B,CAAC;AAEpD,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,yCAAyC;AACzC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CA6UtD;AAKD;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAwC/C,CAAC"}
@@ -10,6 +10,7 @@ import { COMMENTS_PATH, mountCommentsScreen, pendingComments } from './comments.
10
10
  import { MEDIA_UPLOAD_PATH, mountMediaScreen } from './media.js';
11
11
  import { adminMenu } from './menu.js';
12
12
  import { MESSAGES_PATH, mountMessagesScreen, unreadMessages } from './messages.js';
13
+ import { mountNavigationScreen } from './navigation.js';
13
14
  import { mountPreview } from './preview.js';
14
15
  import { FORGOT_PATH, mountRecovery, RESET_PATH } from './recovery.js';
15
16
  import { mountSettings } from './settings-pages.js';
@@ -17,6 +18,7 @@ import { ADMIN_PREFIX, clearSessionCookie, CSRF_FIELD, csrfTokenMatches, session
17
18
  import { mountTaxonomyScreens, TAXONOMY_KINDS } from './taxonomy.js';
18
19
  import { ADMIN_TEMPLATES, createAdminTemplateEnvironment } from './templates.js';
19
20
  import { clientAddress, createLoginThrottle, describeWait, loginKeys } from './throttle.js';
21
+ import { mountToolsScreen } from './tools.js';
20
22
  import { mountUploads, refuseOversizedUpload, UPLOADS_PATH } from './uploads.js';
21
23
  import { mountUsers } from './users.js';
22
24
  /** Where the login form lives. */
@@ -261,6 +263,10 @@ export function mountAdmin(app) {
261
263
  // POST in the admin.
262
264
  mountPreview(app);
263
265
  mountUploads(app);
266
+ // Every menu the site holds, and which of them the active theme renders. A
267
+ // section of its own rather than a settings page: a menu is content a site
268
+ // arranges, and the shape of the screen comes from the theme (TASK-108).
269
+ mountNavigationScreen(app, { render });
264
270
  // Everything under content/uploads: what is there, what links to it, and
265
271
  // the upload form that stores a file by the same rules the editor does.
266
272
  mountMediaScreen(app, { render });
@@ -273,6 +279,9 @@ export function mountAdmin(app) {
273
279
  // What the site is wearing: the themes on disk, and the one setting that
274
280
  // says which of them (decision-15).
275
281
  mountAppearanceScreen(app, { render });
282
+ // The jobs a site runs rather than the things it sets: reading every file
283
+ // back into the index, on a site that is serving.
284
+ mountToolsScreen(app, { render });
276
285
  // The site's own settings, which are content/_data/site.json itself: the
277
286
  // screen reads that file and writes it back (decision-9).
278
287
  mountSettings(app, { render });