@jant/core 0.3.23 → 0.3.25

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 (248) hide show
  1. package/dist/app.js +50 -26
  2. package/dist/db/schema.js +72 -47
  3. package/dist/i18n/locales/en.js +1 -1
  4. package/dist/i18n/locales/zh-Hans.js +1 -1
  5. package/dist/i18n/locales/zh-Hant.js +1 -1
  6. package/dist/index.js +5 -11
  7. package/dist/lib/constants.js +2 -4
  8. package/dist/lib/excerpt.js +76 -0
  9. package/dist/lib/feed.js +18 -7
  10. package/dist/lib/nav-reorder.js +1 -1
  11. package/dist/lib/navigation.js +30 -6
  12. package/dist/lib/pagination.js +44 -0
  13. package/dist/lib/render.js +7 -11
  14. package/dist/lib/schemas.js +80 -38
  15. package/dist/lib/theme.js +4 -4
  16. package/dist/lib/time.js +56 -1
  17. package/dist/lib/timeline.js +95 -0
  18. package/dist/lib/view.js +61 -72
  19. package/dist/routes/api/collections.js +124 -0
  20. package/dist/routes/api/nav-items.js +104 -0
  21. package/dist/routes/api/pages.js +91 -0
  22. package/dist/routes/api/posts.js +27 -33
  23. package/dist/routes/api/search.js +4 -5
  24. package/dist/routes/api/settings.js +68 -0
  25. package/dist/routes/api/upload.js +13 -13
  26. package/dist/routes/compose.js +48 -0
  27. package/dist/routes/dash/collections.js +24 -42
  28. package/dist/routes/dash/index.js +3 -3
  29. package/dist/routes/dash/media.js +2 -2
  30. package/dist/routes/dash/pages.js +440 -106
  31. package/dist/routes/dash/posts.js +27 -37
  32. package/dist/routes/dash/redirects.js +2 -2
  33. package/dist/routes/dash/settings.js +79 -5
  34. package/dist/routes/feed/rss.js +4 -6
  35. package/dist/routes/feed/sitemap.js +11 -8
  36. package/dist/routes/pages/archive.js +13 -15
  37. package/dist/routes/pages/collection.js +12 -9
  38. package/dist/routes/pages/collections.js +28 -0
  39. package/dist/routes/pages/featured.js +32 -0
  40. package/dist/routes/pages/home.js +19 -68
  41. package/dist/routes/pages/page.js +57 -29
  42. package/dist/routes/pages/post.js +7 -17
  43. package/dist/routes/pages/search.js +5 -9
  44. package/dist/services/collection.js +52 -64
  45. package/dist/services/index.js +5 -3
  46. package/dist/services/navigation.js +29 -53
  47. package/dist/services/page.js +84 -0
  48. package/dist/services/post.js +102 -69
  49. package/dist/services/search.js +24 -18
  50. package/dist/types.js +24 -40
  51. package/dist/ui/compose/ComposeDialog.js +452 -0
  52. package/dist/ui/compose/ComposePrompt.js +55 -0
  53. package/dist/{theme/components/TypeBadge.js → ui/dash/FormatBadge.js} +3 -15
  54. package/dist/{theme/components → ui/dash}/PageForm.js +15 -15
  55. package/dist/{theme/components → ui/dash}/PostForm.js +117 -137
  56. package/dist/{theme/components → ui/dash}/PostList.js +18 -13
  57. package/dist/ui/dash/StatusBadge.js +46 -0
  58. package/dist/{theme/components → ui/dash}/index.js +3 -6
  59. package/dist/ui/feed/LinkCard.js +72 -0
  60. package/dist/ui/feed/NoteCard.js +58 -0
  61. package/dist/{themes/minimal/timeline → ui/feed}/QuoteCard.js +29 -14
  62. package/dist/{themes/minimal/timeline → ui/feed}/ThreadPreview.js +20 -18
  63. package/dist/ui/feed/TimelineFeed.js +41 -0
  64. package/dist/ui/feed/TimelineItem.js +27 -0
  65. package/dist/{theme → ui}/layouts/BaseLayout.js +10 -0
  66. package/dist/{theme → ui}/layouts/DashLayout.js +0 -8
  67. package/dist/ui/layouts/SiteLayout.js +141 -0
  68. package/dist/{themes/minimal → ui}/pages/ArchivePage.js +37 -50
  69. package/dist/ui/pages/CollectionPage.js +70 -0
  70. package/dist/ui/pages/CollectionsPage.js +76 -0
  71. package/dist/ui/pages/FeaturedPage.js +24 -0
  72. package/dist/ui/pages/HomePage.js +24 -0
  73. package/dist/{themes/minimal → ui}/pages/PostPage.js +20 -12
  74. package/dist/{themes/minimal → ui}/pages/SearchPage.js +19 -18
  75. package/dist/{themes/minimal → ui}/pages/SinglePage.js +5 -4
  76. package/dist/ui/shared/MediaGallery.js +35 -0
  77. package/dist/{theme/components → ui/shared}/Pagination.js +41 -2
  78. package/dist/{theme/components → ui/shared}/ThreadView.js +3 -3
  79. package/dist/ui/shared/index.js +5 -0
  80. package/package.json +2 -9
  81. package/src/__tests__/helpers/app.ts +4 -0
  82. package/src/__tests__/helpers/db.ts +53 -73
  83. package/src/app.tsx +56 -28
  84. package/src/db/migrations/0005_v2_schema_migration.sql +268 -0
  85. package/src/db/migrations/0006_rename_slug_to_path.sql +5 -0
  86. package/src/db/migrations/meta/_journal.json +14 -0
  87. package/src/db/schema.ts +63 -46
  88. package/src/i18n/locales/en.po +443 -240
  89. package/src/i18n/locales/en.ts +1 -1
  90. package/src/i18n/locales/zh-Hans.po +443 -240
  91. package/src/i18n/locales/zh-Hans.ts +1 -1
  92. package/src/i18n/locales/zh-Hant.po +443 -240
  93. package/src/i18n/locales/zh-Hant.ts +1 -1
  94. package/src/index.ts +29 -42
  95. package/src/lib/__tests__/excerpt.test.ts +125 -0
  96. package/src/lib/__tests__/schemas.test.ts +201 -99
  97. package/src/lib/__tests__/time.test.ts +62 -0
  98. package/src/{routes/api → lib}/__tests__/timeline.test.ts +81 -75
  99. package/src/lib/__tests__/view.test.ts +204 -50
  100. package/src/lib/constants.ts +2 -4
  101. package/src/lib/excerpt.ts +87 -0
  102. package/src/lib/feed.ts +22 -7
  103. package/src/lib/nav-reorder.ts +1 -1
  104. package/src/lib/navigation.ts +45 -8
  105. package/src/lib/pagination.ts +50 -0
  106. package/src/lib/render.tsx +7 -14
  107. package/src/lib/schemas.ts +119 -51
  108. package/src/lib/theme.ts +5 -5
  109. package/src/lib/time.ts +64 -0
  110. package/src/lib/timeline.ts +141 -0
  111. package/src/lib/view.ts +80 -82
  112. package/src/preset.css +46 -0
  113. package/src/routes/__tests__/compose.test.ts +199 -0
  114. package/src/routes/api/__tests__/collections.test.ts +249 -0
  115. package/src/routes/api/__tests__/nav-items.test.ts +222 -0
  116. package/src/routes/api/__tests__/pages.test.ts +218 -0
  117. package/src/routes/api/__tests__/posts.test.ts +50 -108
  118. package/src/routes/api/__tests__/search.test.ts +2 -3
  119. package/src/routes/api/__tests__/settings.test.ts +132 -0
  120. package/src/routes/api/collections.ts +143 -0
  121. package/src/routes/api/nav-items.ts +115 -0
  122. package/src/routes/api/pages.ts +101 -0
  123. package/src/routes/api/posts.ts +28 -28
  124. package/src/routes/api/search.ts +3 -3
  125. package/src/routes/api/settings.ts +91 -0
  126. package/src/routes/api/upload.ts +16 -6
  127. package/src/routes/compose.ts +63 -0
  128. package/src/routes/dash/__tests__/pages.test.ts +225 -0
  129. package/src/routes/dash/collections.tsx +20 -42
  130. package/src/routes/dash/index.tsx +3 -3
  131. package/src/routes/dash/media.tsx +2 -2
  132. package/src/routes/dash/pages.tsx +480 -122
  133. package/src/routes/dash/posts.tsx +42 -54
  134. package/src/routes/dash/redirects.tsx +2 -2
  135. package/src/routes/dash/settings.tsx +83 -5
  136. package/src/routes/feed/rss.ts +4 -3
  137. package/src/routes/feed/sitemap.ts +15 -5
  138. package/src/routes/pages/__tests__/collections.test.ts +94 -0
  139. package/src/routes/pages/__tests__/featured.test.ts +94 -0
  140. package/src/routes/pages/archive.tsx +15 -15
  141. package/src/routes/pages/collection.tsx +16 -9
  142. package/src/routes/pages/collections.tsx +36 -0
  143. package/src/routes/pages/featured.tsx +38 -0
  144. package/src/routes/pages/home.tsx +21 -92
  145. package/src/routes/pages/page.tsx +62 -27
  146. package/src/routes/pages/post.tsx +6 -18
  147. package/src/routes/pages/search.tsx +3 -7
  148. package/src/services/__tests__/collection.test.ts +257 -158
  149. package/src/services/__tests__/media.test.ts +18 -18
  150. package/src/services/__tests__/navigation.test.ts +161 -87
  151. package/src/services/__tests__/page.test.ts +106 -0
  152. package/src/services/__tests__/post-timeline.test.ts +92 -88
  153. package/src/services/__tests__/post.test.ts +432 -197
  154. package/src/services/__tests__/search.test.ts +19 -25
  155. package/src/services/collection.ts +71 -113
  156. package/src/services/index.ts +9 -8
  157. package/src/services/navigation.ts +38 -71
  158. package/src/services/page.ts +136 -0
  159. package/src/services/post.ts +141 -101
  160. package/src/services/search.ts +38 -27
  161. package/src/styles/tokens.css +47 -0
  162. package/src/styles/ui.css +491 -0
  163. package/src/types.ts +212 -198
  164. package/src/ui/compose/ComposeDialog.tsx +395 -0
  165. package/src/ui/compose/ComposePrompt.tsx +55 -0
  166. package/src/ui/dash/FormatBadge.tsx +28 -0
  167. package/src/{theme/components → ui/dash}/PageForm.tsx +21 -21
  168. package/src/{theme/components → ui/dash}/PostForm.tsx +110 -131
  169. package/src/ui/dash/PostList.tsx +101 -0
  170. package/src/ui/dash/StatusBadge.tsx +61 -0
  171. package/src/ui/dash/index.ts +10 -0
  172. package/src/ui/feed/LinkCard.tsx +72 -0
  173. package/src/ui/feed/NoteCard.tsx +63 -0
  174. package/src/ui/feed/QuoteCard.tsx +68 -0
  175. package/src/ui/feed/ThreadPreview.tsx +48 -0
  176. package/src/ui/feed/TimelineFeed.tsx +49 -0
  177. package/src/ui/feed/TimelineItem.tsx +45 -0
  178. package/src/{theme → ui}/layouts/BaseLayout.tsx +11 -1
  179. package/src/{theme → ui}/layouts/DashLayout.tsx +0 -10
  180. package/src/ui/layouts/SiteLayout.tsx +150 -0
  181. package/src/ui/pages/ArchivePage.tsx +162 -0
  182. package/src/ui/pages/CollectionPage.tsx +70 -0
  183. package/src/ui/pages/CollectionsPage.tsx +73 -0
  184. package/src/ui/pages/FeaturedPage.tsx +31 -0
  185. package/src/ui/pages/HomePage.tsx +37 -0
  186. package/src/ui/pages/PostPage.tsx +56 -0
  187. package/src/{themes/minimal → ui}/pages/SearchPage.tsx +24 -20
  188. package/src/{themes/minimal → ui}/pages/SinglePage.tsx +5 -5
  189. package/src/ui/shared/MediaGallery.tsx +59 -0
  190. package/src/{theme/components → ui/shared}/Pagination.tsx +67 -4
  191. package/src/{theme/components → ui/shared}/ThreadView.tsx +6 -3
  192. package/src/ui/shared/__tests__/pagination.test.ts +46 -0
  193. package/src/ui/shared/index.ts +12 -0
  194. package/bin/jant.js +0 -185
  195. package/dist/lib/theme-components.js +0 -49
  196. package/dist/routes/api/timeline.js +0 -120
  197. package/dist/routes/dash/navigation.js +0 -288
  198. package/dist/theme/components/MediaGallery.js +0 -107
  199. package/dist/theme/components/VisibilityBadge.js +0 -37
  200. package/dist/theme/index.js +0 -18
  201. package/dist/theme/layouts/index.js +0 -2
  202. package/dist/themes/minimal/MinimalSiteLayout.js +0 -83
  203. package/dist/themes/minimal/index.js +0 -65
  204. package/dist/themes/minimal/pages/CollectionPage.js +0 -65
  205. package/dist/themes/minimal/pages/HomePage.js +0 -25
  206. package/dist/themes/minimal/timeline/ArticleCard.js +0 -36
  207. package/dist/themes/minimal/timeline/ImageCard.js +0 -67
  208. package/dist/themes/minimal/timeline/LinkCard.js +0 -47
  209. package/dist/themes/minimal/timeline/NoteCard.js +0 -34
  210. package/dist/themes/minimal/timeline/TimelineFeed.js +0 -48
  211. package/dist/themes/minimal/timeline/TimelineItem.js +0 -44
  212. package/src/lib/__tests__/theme-components.test.ts +0 -126
  213. package/src/lib/theme-components.ts +0 -68
  214. package/src/routes/api/timeline.tsx +0 -159
  215. package/src/routes/dash/navigation.tsx +0 -316
  216. package/src/theme/components/MediaGallery.tsx +0 -128
  217. package/src/theme/components/PostList.tsx +0 -92
  218. package/src/theme/components/TypeBadge.tsx +0 -37
  219. package/src/theme/components/VisibilityBadge.tsx +0 -45
  220. package/src/theme/components/index.ts +0 -23
  221. package/src/theme/index.ts +0 -22
  222. package/src/theme/layouts/index.ts +0 -7
  223. package/src/themes/minimal/MinimalSiteLayout.tsx +0 -100
  224. package/src/themes/minimal/index.ts +0 -83
  225. package/src/themes/minimal/pages/ArchivePage.tsx +0 -157
  226. package/src/themes/minimal/pages/CollectionPage.tsx +0 -60
  227. package/src/themes/minimal/pages/HomePage.tsx +0 -41
  228. package/src/themes/minimal/pages/PostPage.tsx +0 -43
  229. package/src/themes/minimal/timeline/ArticleCard.tsx +0 -37
  230. package/src/themes/minimal/timeline/ImageCard.tsx +0 -63
  231. package/src/themes/minimal/timeline/LinkCard.tsx +0 -48
  232. package/src/themes/minimal/timeline/NoteCard.tsx +0 -35
  233. package/src/themes/minimal/timeline/QuoteCard.tsx +0 -49
  234. package/src/themes/minimal/timeline/ThreadPreview.tsx +0 -47
  235. package/src/themes/minimal/timeline/TimelineFeed.tsx +0 -57
  236. package/src/themes/minimal/timeline/TimelineItem.tsx +0 -75
  237. /package/dist/{theme → ui}/color-themes.js +0 -0
  238. /package/dist/{theme/components → ui/dash}/ActionButtons.js +0 -0
  239. /package/dist/{theme/components → ui/dash}/CrudPageHeader.js +0 -0
  240. /package/dist/{theme/components → ui/dash}/DangerZone.js +0 -0
  241. /package/dist/{theme/components → ui/dash}/ListItemRow.js +0 -0
  242. /package/dist/{theme/components → ui/shared}/EmptyState.js +0 -0
  243. /package/src/{theme → ui}/color-themes.ts +0 -0
  244. /package/src/{theme/components → ui/dash}/ActionButtons.tsx +0 -0
  245. /package/src/{theme/components → ui/dash}/CrudPageHeader.tsx +0 -0
  246. /package/src/{theme/components → ui/dash}/DangerZone.tsx +0 -0
  247. /package/src/{theme/components → ui/dash}/ListItemRow.tsx +0 -0
  248. /package/src/{theme/components → ui/shared}/EmptyState.tsx +0 -0
package/dist/app.js CHANGED
@@ -8,7 +8,6 @@ import { createAuth } from "./auth.js";
8
8
  import { i18nMiddleware } from "./i18n/index.js";
9
9
  import { useLingui as $_useLingui } from "@jant/core/i18n";
10
10
  import { SETTINGS_KEYS } from "./lib/constants.js";
11
- import { theme as minimalTheme } from "./themes/minimal/index.js";
12
11
  import { hashPassword } from "better-auth/crypto";
13
12
  // Routes - Pages
14
13
  import { homeRoutes } from "./routes/pages/home.js";
@@ -17,6 +16,8 @@ import { pageRoutes } from "./routes/pages/page.js";
17
16
  import { collectionRoutes } from "./routes/pages/collection.js";
18
17
  import { archiveRoutes } from "./routes/pages/archive.js";
19
18
  import { searchRoutes } from "./routes/pages/search.js";
19
+ import { featuredRoutes } from "./routes/pages/featured.js";
20
+ import { collectionsPageRoutes } from "./routes/pages/collections.js";
20
21
  // Routes - Dashboard
21
22
  import { dashIndexRoutes } from "./routes/dash/index.js";
22
23
  import { postsRoutes as dashPostsRoutes } from "./routes/dash/posts.js";
@@ -25,12 +26,16 @@ import { mediaRoutes as dashMediaRoutes } from "./routes/dash/media.js";
25
26
  import { settingsRoutes as dashSettingsRoutes } from "./routes/dash/settings.js";
26
27
  import { redirectsRoutes as dashRedirectsRoutes } from "./routes/dash/redirects.js";
27
28
  import { collectionsRoutes as dashCollectionsRoutes } from "./routes/dash/collections.js";
28
- import { navigationRoutes as dashNavigationRoutes } from "./routes/dash/navigation.js";
29
29
  // Routes - API
30
30
  import { postsApiRoutes } from "./routes/api/posts.js";
31
+ import { pagesApiRoutes } from "./routes/api/pages.js";
32
+ import { navItemsApiRoutes } from "./routes/api/nav-items.js";
33
+ import { collectionsApiRoutes } from "./routes/api/collections.js";
34
+ import { settingsApiRoutes } from "./routes/api/settings.js";
31
35
  import { uploadApiRoutes } from "./routes/api/upload.js";
32
36
  import { searchApiRoutes } from "./routes/api/search.js";
33
- import { timelineApiRoutes } from "./routes/api/timeline.js";
37
+ // Routes - Compose
38
+ import { composeRoutes } from "./routes/compose.js";
34
39
  // Routes - Feed
35
40
  import { rssRoutes } from "./routes/feed/rss.js";
36
41
  import { sitemapRoutes } from "./routes/feed/sitemap.js";
@@ -38,7 +43,7 @@ import { sitemapRoutes } from "./routes/feed/sitemap.js";
38
43
  import { requireAuth } from "./middleware/auth.js";
39
44
  import { requireOnboarding } from "./middleware/onboarding.js";
40
45
  // Layouts for auth pages
41
- import { BaseLayout } from "./theme/layouts/index.js";
46
+ import { BaseLayout } from "./ui/layouts/BaseLayout.js";
42
47
  import { dsRedirect, dsToast } from "./lib/sse.js";
43
48
  import { getAvailableThemes, buildThemeStyle } from "./lib/theme.js";
44
49
  import { createStorageDriver } from "./lib/storage.js";
@@ -57,27 +62,12 @@ import { createStorageDriver } from "./lib/storage.js";
57
62
  * import { createApp } from "@jant/core";
58
63
  *
59
64
  * export default createApp({
60
- * theme: { components: { PostPage: MyPostPage } },
65
+ * cssVariables: { "--card-radius": "0" },
61
66
  * });
62
67
  * ```
63
68
  */ export function createApp(config = {}) {
64
- // Merge with default minimal theme
65
- const defaultTheme = minimalTheme();
66
69
  const resolvedConfig = {
67
- ...config,
68
- theme: {
69
- name: config.theme?.name ?? defaultTheme.name,
70
- components: {
71
- ...defaultTheme.components,
72
- ...config.theme?.components
73
- },
74
- cssVariables: {
75
- ...defaultTheme.cssVariables,
76
- ...config.theme?.cssVariables
77
- },
78
- colorThemes: config.theme?.colorThemes ?? defaultTheme.colorThemes,
79
- feed: config.theme?.feed
80
- }
70
+ ...config
81
71
  };
82
72
  const app = new Hono();
83
73
  // Initialize services, auth, and config middleware
@@ -105,13 +95,30 @@ import { createStorageDriver } from "./lib/storage.js";
105
95
  });
106
96
  // Onboarding gate — redirect to /setup if not yet initialized
107
97
  app.use("*", requireOnboarding());
108
- // Theme middleware - resolve active color theme and build CSS
98
+ // Theme middleware - resolve active color theme, custom CSS, and auth state
109
99
  app.use("*", async (c, next)=>{
110
- const themeId = await c.var.services.settings.get(SETTINGS_KEYS.THEME);
100
+ const [themeId, customCSS] = await Promise.all([
101
+ c.var.services.settings.get(SETTINGS_KEYS.THEME),
102
+ c.var.services.settings.get(SETTINGS_KEYS.CUSTOM_CSS)
103
+ ]);
111
104
  const themes = getAvailableThemes(resolvedConfig);
112
105
  const activeTheme = themeId ? themes.find((t)=>t.id === themeId) : undefined;
113
- const themeStyle = buildThemeStyle(activeTheme, resolvedConfig.theme?.cssVariables);
106
+ const themeStyle = buildThemeStyle(activeTheme, resolvedConfig.cssVariables);
114
107
  c.set("themeStyle", themeStyle);
108
+ c.set("customCSS", customCSS ?? "");
109
+ // Check auth state for data-authenticated attribute on <body>
110
+ let isAuthenticated = false;
111
+ if (c.var.auth) {
112
+ try {
113
+ const session = await c.var.auth.api.getSession({
114
+ headers: c.req.raw.headers
115
+ });
116
+ isAuthenticated = !!session;
117
+ } catch {
118
+ // Not authenticated
119
+ }
120
+ }
121
+ c.set("isAuthenticated", isAuthenticated);
115
122
  await next();
116
123
  });
117
124
  // i18n middleware
@@ -155,7 +162,10 @@ import { createStorageDriver } from "./lib/storage.js";
155
162
  });
156
163
  // API Routes
157
164
  app.route("/api/posts", postsApiRoutes);
158
- app.route("/api/timeline", timelineApiRoutes);
165
+ app.route("/api/pages", pagesApiRoutes);
166
+ app.route("/api/nav-items", navItemsApiRoutes);
167
+ app.route("/api/collections", collectionsApiRoutes);
168
+ app.route("/api/settings", settingsApiRoutes);
159
169
  // Setup page component
160
170
  const SetupContent = ()=>{
161
171
  const { i18n: $__i18n, _: $__ } = $_useLingui();
@@ -308,6 +318,17 @@ import { createStorageDriver } from "./lib/storage.js";
308
318
  return dsToast("Failed to create account", "error");
309
319
  }
310
320
  await c.var.services.settings.completeOnboarding();
321
+ // Seed default navigation items
322
+ await c.var.services.navItems.create({
323
+ type: "link",
324
+ label: "Featured",
325
+ url: "/featured"
326
+ });
327
+ await c.var.services.navItems.create({
328
+ type: "link",
329
+ label: "Collections",
330
+ url: "/collections"
331
+ });
311
332
  return dsRedirect("/signin?setup");
312
333
  } catch (err) {
313
334
  // eslint-disable-next-line no-console -- Error logging is intentional
@@ -693,7 +714,6 @@ import { createStorageDriver } from "./lib/storage.js";
693
714
  app.route("/dash/settings", dashSettingsRoutes);
694
715
  app.route("/dash/redirects", dashRedirectsRoutes);
695
716
  app.route("/dash/collections", dashCollectionsRoutes);
696
- app.route("/dash/navigation", dashNavigationRoutes);
697
717
  // API routes
698
718
  app.route("/api/upload", uploadApiRoutes);
699
719
  app.route("/api/search", searchApiRoutes);
@@ -721,12 +741,16 @@ import { createStorageDriver } from "./lib/storage.js";
721
741
  headers
722
742
  });
723
743
  });
744
+ // Compose route (auth enforced in route middleware)
745
+ app.route("/compose", composeRoutes);
724
746
  // Feed routes
725
747
  app.route("/feed", rssRoutes);
726
748
  app.route("/", sitemapRoutes);
727
749
  // Frontend routes
728
750
  app.route("/search", searchRoutes);
729
751
  app.route("/archive", archiveRoutes);
752
+ app.route("/featured", featuredRoutes);
753
+ app.route("/collections", collectionsPageRoutes);
730
754
  app.route("/c", collectionRoutes);
731
755
  app.route("/p", postRoutes);
732
756
  app.route("/", homeRoutes);
package/dist/db/schema.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Drizzle Schema
3
3
  *
4
- * Database schema for Jant
5
- */ import { sqliteTable, text, integer, primaryKey } from "drizzle-orm/sqlite-core";
4
+ * Database schema for Jant v2
5
+ */ import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
6
6
  // =============================================================================
7
7
  // Posts
8
8
  // =============================================================================
@@ -10,31 +10,31 @@ export const posts = sqliteTable("posts", {
10
10
  id: integer("id").primaryKey({
11
11
  autoIncrement: true
12
12
  }),
13
- type: text("type", {
13
+ format: text("format", {
14
14
  enum: [
15
15
  "note",
16
- "article",
17
16
  "link",
18
- "quote",
19
- "image",
20
- "page"
17
+ "quote"
21
18
  ]
22
19
  }).notNull(),
23
- visibility: text("visibility", {
20
+ status: text("status", {
24
21
  enum: [
25
- "featured",
26
- "quiet",
27
- "unlisted",
28
- "draft"
22
+ "draft",
23
+ "published"
29
24
  ]
30
- }).notNull().default("quiet"),
25
+ }).notNull().default("published"),
26
+ featured: integer("featured").notNull().default(0),
27
+ pinned: integer("pinned").notNull().default(0),
28
+ path: text("path").unique(),
31
29
  title: text("title"),
32
- path: text("path"),
33
- content: text("content"),
34
- contentHtml: text("content_html"),
35
- sourceUrl: text("source_url"),
36
- sourceName: text("source_name"),
37
- sourceDomain: text("source_domain"),
30
+ url: text("url"),
31
+ body: text("body"),
32
+ bodyHtml: text("body_html"),
33
+ quoteText: text("quote_text"),
34
+ rating: integer("rating"),
35
+ collectionId: integer("collection_id").references(()=>collections.id, {
36
+ onDelete: "set null"
37
+ }),
38
38
  replyToId: integer("reply_to_id"),
39
39
  threadId: integer("thread_id"),
40
40
  deletedAt: integer("deleted_at"),
@@ -43,6 +43,26 @@ export const posts = sqliteTable("posts", {
43
43
  updatedAt: integer("updated_at").notNull()
44
44
  });
45
45
  // =============================================================================
46
+ // Pages
47
+ // =============================================================================
48
+ export const pages = sqliteTable("pages", {
49
+ id: integer("id").primaryKey({
50
+ autoIncrement: true
51
+ }),
52
+ slug: text("slug").notNull().unique(),
53
+ title: text("title"),
54
+ body: text("body"),
55
+ bodyHtml: text("body_html"),
56
+ status: text("status", {
57
+ enum: [
58
+ "draft",
59
+ "published"
60
+ ]
61
+ }).notNull().default("published"),
62
+ createdAt: integer("created_at").notNull(),
63
+ updatedAt: integer("updated_at").notNull()
64
+ });
65
+ // =============================================================================
46
66
  // Media
47
67
  // =============================================================================
48
68
  export const media = sqliteTable("media", {
@@ -68,27 +88,45 @@ export const collections = sqliteTable("collections", {
68
88
  id: integer("id").primaryKey({
69
89
  autoIncrement: true
70
90
  }),
71
- path: text("path").unique(),
91
+ slug: text("slug").notNull().unique(),
72
92
  title: text("title").notNull(),
73
93
  description: text("description"),
94
+ icon: text("icon"),
95
+ sortOrder: text("sort_order", {
96
+ enum: [
97
+ "newest",
98
+ "oldest",
99
+ "rating_desc",
100
+ "rating_asc"
101
+ ]
102
+ }).notNull().default("newest"),
103
+ position: integer("position").notNull().default(0),
104
+ showDivider: integer("show_divider").notNull().default(0),
74
105
  createdAt: integer("created_at").notNull(),
75
106
  updatedAt: integer("updated_at").notNull()
76
107
  });
77
108
  // =============================================================================
78
- // Post-Collections (Many-to-Many)
79
- // =============================================================================
80
- export const postCollections = sqliteTable("post_collections", {
81
- postId: integer("post_id").notNull().references(()=>posts.id),
82
- collectionId: integer("collection_id").notNull().references(()=>collections.id),
83
- addedAt: integer("added_at").notNull()
84
- }, (table)=>[
85
- primaryKey({
86
- columns: [
87
- table.postId,
88
- table.collectionId
89
- ]
90
- })
91
- ]);
109
+ // Navigation Items
110
+ // =============================================================================
111
+ export const navItems = sqliteTable("nav_items", {
112
+ id: integer("id").primaryKey({
113
+ autoIncrement: true
114
+ }),
115
+ type: text("type", {
116
+ enum: [
117
+ "page",
118
+ "link"
119
+ ]
120
+ }).notNull().default("link"),
121
+ label: text("label").notNull(),
122
+ url: text("url").notNull(),
123
+ pageId: integer("page_id").references(()=>pages.id, {
124
+ onDelete: "cascade"
125
+ }),
126
+ position: integer("position").notNull().default(0),
127
+ createdAt: integer("created_at").notNull(),
128
+ updatedAt: integer("updated_at").notNull()
129
+ });
92
130
  // =============================================================================
93
131
  // Redirects
94
132
  // =============================================================================
@@ -104,19 +142,6 @@ export const redirects = sqliteTable("redirects", {
104
142
  createdAt: integer("created_at").notNull()
105
143
  });
106
144
  // =============================================================================
107
- // Navigation Links
108
- // =============================================================================
109
- export const navigationLinks = sqliteTable("navigation_links", {
110
- id: integer("id").primaryKey({
111
- autoIncrement: true
112
- }),
113
- label: text("label").notNull(),
114
- url: text("url").notNull(),
115
- position: integer("position").notNull().default(0),
116
- createdAt: integer("created_at").notNull(),
117
- updatedAt: integer("updated_at").notNull()
118
- });
119
- // =============================================================================
120
145
  // Settings (Key-Value)
121
146
  // =============================================================================
122
147
  export const settings = sqliteTable("settings", {
@@ -1 +1 @@
1
- /*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"No collections yet.\"],\"+bHzpy\":[\"Display text for the link\"],\"+owNNn\":[\"Posts\"],\"+zy2Nq\":[\"Type\"],\"/0D1Xp\":[\"Edit Collection\"],\"/Rj5P4\":[\"Your Name\"],\"07Epll\":[\"This will theme both your site and your dashboard. All color themes support dark mode.\"],\"0JkyS7\":[\"Create your first page\"],\"0a6MpL\":[\"New Redirect\"],\"1CU1Td\":[\"URL-safe identifier (lowercase, numbers, hyphens)\"],\"1DBGsz\":[\"Notes\"],\"1o+wgo\":[\"e.g. The Verge, John Doe\"],\"2N0qpv\":[\"Post title...\"],\"2fUwEY\":[\"Select Media\"],\"2q/Q7x\":[\"Visibility\"],\"2rJGtU\":[\"Page title...\"],\"3Yvsaz\":[\"302 (Temporary)\"],\"4/SFQS\":[\"View Site\"],\"40TVQj\":[\"Custom Path (optional)\"],\"4KzVT6\":[\"Delete Page\"],\"4b3oEV\":[\"Content\"],\"4mDPGp\":[\"The URL path for this page. Use lowercase letters, numbers, and hyphens.\"],\"6WdDG7\":[\"Page\"],\"6YtxFj\":[\"Name\"],\"7G4SBz\":[\"Page content (Markdown supported)...\"],\"7Mk+/h\":[\"Update Collection\"],\"7Q1KKN\":[\"From Path\"],\"7aECQB\":[\"Invalid or Expired Link\"],\"7nGhhM\":[\"What's on your mind?\"],\"7p5kLi\":[\"Dashboard\"],\"7vhWI8\":[\"New Password\"],\"87a/t/\":[\"Label\"],\"8ZsakT\":[\"Password\"],\"90Luob\":[[\"count\"],\" replies\"],\"A1taO8\":[\"Search\"],\"AeXO77\":[\"Account\"],\"AyHO4m\":[\"What's this collection about?\"],\"B373X+\":[\"Edit Post\"],\"B495Gs\":[\"Archive\"],\"BjF0Jv\":[\"Lowercase letters, numbers, and hyphens only\"],\"D9Oea+\":[\"Permalink\"],\"DCKkhU\":[\"Current Password\"],\"DHhJ7s\":[\"Previous\"],\"DPfwMq\":[\"Done\"],\"DoJzLz\":[\"Collections\"],\"E80cJw\":[\"Deleting this media will remove it permanently from storage.\"],\"EEYbdt\":[\"Publish\"],\"EGwzOK\":[\"Complete Setup\"],\"EkH9pt\":[\"Update\"],\"FGrimz\":[\"New Post\"],\"FkMol5\":[\"Featured\"],\"Fxf4jq\":[\"Description (optional)\"],\"GA5A5H\":[\"Delete Collection\"],\"GX2VMa\":[\"Create your admin account.\"],\"GbVAnd\":[\"This password reset link is invalid or has expired. Please generate a new one.\"],\"GorKul\":[\"Welcome to Jant\"],\"GrZ6fH\":[\"New Page\"],\"GxkJXS\":[\"Uploading...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"Quiet (normal)\"],\"Hzi9AA\":[\"No posts found.\"],\"I6gXOa\":[\"Path\"],\"I8hDlV\":[\"At least 1 image required for image posts.\"],\"IUwGEM\":[\"Save Changes\"],\"IagCbF\":[\"URL\"],\"J4FNfC\":[\"No posts in this collection.\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"Need help? Visit the <0>documentation</0>\"],\"JiP4aa\":[\"Published pages are accessible via their path. Drafts are not visible.\"],\"K9NcLu\":[\"Use this URL to embed the media in your posts.\"],\"KbS2K9\":[\"Reset Password\"],\"KiJn9B\":[\"Note\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"Slug\"],\"LkvLQe\":[\"No pages yet.\"],\"M1RvTd\":[\"Click image to view full size\"],\"M8kJqa\":[\"Drafts\"],\"M9xgHy\":[\"Redirects\"],\"MHrjPM\":[\"Title\"],\"MWBOxm\":[\"Collections (optional)\"],\"MZbQHL\":[\"No results found.\"],\"Mhf/H/\":[\"Create Redirect\"],\"MqghUt\":[\"Search posts...\"],\"N40H+G\":[\"All\"],\"O3oNi5\":[\"Email\"],\"OCNZaU\":[\"The path to redirect from\"],\"ODiSoW\":[\"No posts yet.\"],\"ONWvwQ\":[\"Upload\"],\"Pbm2/N\":[\"Create Collection\"],\"QEbNBb\":[\"Path (e.g. /archive) or full URL (e.g. https://example.com)\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"Links\"],\"RwGhWy\":[\"Thread with \",[\"count\"],\" posts\"],\"SJmfuf\":[\"Site Name\"],\"ST+lN2\":[\"No media uploaded yet.\"],\"Tt5T6+\":[\"Articles\"],\"TxE+Mj\":[\"1 reply\"],\"Tz0i8g\":[\"Settings\"],\"U5v6Gh\":[\"Edit Page\"],\"UDMjsP\":[\"Quick Actions\"],\"UGT5vp\":[\"Save Settings\"],\"UxKoFf\":[\"Navigation\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"Change Password\"],\"WDcQq9\":[\"Unlisted\"],\"Weq9zb\":[\"General\"],\"WmZ/rP\":[\"To Path\"],\"Y+7JGK\":[\"Create Page\"],\"Z3FXyt\":[\"Loading...\"],\"ZQKLI1\":[\"Danger Zone\"],\"ZhhOwV\":[\"Quote\"],\"aAIQg2\":[\"Appearance\"],\"aaGV/9\":[\"New Link\"],\"an5hVd\":[\"Images\"],\"b+/jO6\":[\"301 (Permanent)\"],\"bHYIks\":[\"Sign Out\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"Delete\"],\"dEgA5A\":[\"Cancel\"],\"e6Jr7Q\":[\"← Back to Collections\"],\"ePK91l\":[\"Edit\"],\"eWLklq\":[\"Quotes\"],\"eneWvv\":[\"Draft\"],\"er8+x7\":[\"Demo account pre-filled. Just click Sign In.\"],\"f6e0Ry\":[\"Article\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"My Collection\"],\"gDx5MG\":[\"Edit Link\"],\"hG89Ed\":[\"Image\"],\"hWOZIv\":[\"Enter your new password.\"],\"hXzOVo\":[\"Next\"],\"he3ygx\":[\"Copy\"],\"iH8pgl\":[\"Back\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jpctdh\":[\"View\"],\"k1ifdL\":[\"Processing...\"],\"kd7eBB\":[\"Create Link\"],\"mTOYla\":[\"View all posts →\"],\"n1ekoW\":[\"Sign In\"],\"oJFOZk\":[\"Source Name (optional)\"],\"oYPBa0\":[\"Update Page\"],\"p2/GCq\":[\"Confirm Password\"],\"pRhYH2\":[\"Posts in Collection (\",[\"count\"],\")\"],\"pZq3aX\":[\"Upload failed. Please try again.\"],\"qMyM2u\":[\"Source URL (optional)\"],\"qiXmlF\":[\"Add Media\"],\"r1MpXi\":[\"Quiet\"],\"rFmBG3\":[\"Color theme\"],\"rdUucN\":[\"Preview\"],\"rzNUSl\":[\"Thread with 1 post\"],\"sGajR7\":[\"Thread start\"],\"smzF8S\":[\"Show \",[\"remainingCount\"],\" more \",[\"0\"]],\"ssqvZi\":[\"Save Profile\"],\"t/YqKh\":[\"Remove\"],\"tfrt7B\":[\"No redirects configured.\"],\"tiq7kl\":[\"Page \",[\"page\"]],\"u2f7vd\":[\"Site Description\"],\"u3wRF+\":[\"Published\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"Status\"],\"vERlcd\":[\"Profile\"],\"vXIe7J\":[\"Language\"],\"vzU4k9\":[\"New Collection\"],\"wEF6Ix\":[\"The destination path or URL\"],\"wK4OTM\":[\"Title (optional)\"],\"wM5UXj\":[\"Delete Media\"],\"wRR604\":[\"Pages\"],\"wdGjkd\":[\"No navigation links configured.\"],\"wja8aL\":[\"Untitled\"],\"x+doid\":[\"Images are automatically optimized: resized to max 1920px, converted to WebP, and metadata stripped.\"],\"x0mzE0\":[\"Create your first post\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"Media\"],\"y28hnO\":[\"Post\"],\"yQ2kGp\":[\"Load more\"],\"yjkELF\":[\"Confirm New Password\"],\"yzF66j\":[\"Link\"],\"z8ajIE\":[\"Found 1 result\"],\"zH6KqE\":[\"Found \",[\"count\"],\" results\"]}");
1
+ /*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"No collections yet.\"],\"+MH6k9\":[\"Add to nav\"],\"+bHzpy\":[\"Display text for the link\"],\"+owNNn\":[\"Posts\"],\"+zy2Nq\":[\"Type\"],\"/0D1Xp\":[\"Edit Collection\"],\"/Rj5P4\":[\"Your Name\"],\"/rkqRV\":[\"All pages are in your navigation.\"],\"07Epll\":[\"This will theme both your site and your dashboard. All color themes support dark mode.\"],\"0JkyS7\":[\"Create your first page\"],\"0a6MpL\":[\"New Redirect\"],\"0yIy82\":[\"No featured posts yet.\"],\"1CU1Td\":[\"URL-safe identifier (lowercase, numbers, hyphens)\"],\"1DBGsz\":[\"Notes\"],\"1o+wgo\":[\"e.g. The Verge, John Doe\"],\"2N0qpv\":[\"Post title...\"],\"2fUwEY\":[\"Select Media\"],\"2q/Q7x\":[\"Visibility\"],\"2rJGtU\":[\"Page title...\"],\"3Yvsaz\":[\"302 (Temporary)\"],\"4/SFQS\":[\"View Site\"],\"40TVQj\":[\"Custom Path (optional)\"],\"4KzVT6\":[\"Delete Page\"],\"4b3oEV\":[\"Content\"],\"4mDPGp\":[\"The URL path for this page. Use lowercase letters, numbers, and hyphens.\"],\"6WdDG7\":[\"Page\"],\"6YtxFj\":[\"Name\"],\"7G4SBz\":[\"Page content (Markdown supported)...\"],\"7Mk+/h\":[\"Update Collection\"],\"7Q1KKN\":[\"From Path\"],\"7aECQB\":[\"Invalid or Expired Link\"],\"7nGhhM\":[\"What's on your mind?\"],\"7p5kLi\":[\"Dashboard\"],\"7vhWI8\":[\"New Password\"],\"87a/t/\":[\"Label\"],\"8ZsakT\":[\"Password\"],\"9+vGLh\":[\"Custom CSS\"],\"90Luob\":[[\"count\"],\" replies\"],\"A1taO8\":[\"Search\"],\"AeXO77\":[\"Account\"],\"AyHO4m\":[\"What's this collection about?\"],\"B373X+\":[\"Edit Post\"],\"B495Gs\":[\"Archive\"],\"BjF0Jv\":[\"Lowercase letters, numbers, and hyphens only\"],\"D9Oea+\":[\"Permalink\"],\"DCKkhU\":[\"Current Password\"],\"DHhJ7s\":[\"Previous\"],\"DPfwMq\":[\"Done\"],\"DoJzLz\":[\"Collections\"],\"E80cJw\":[\"Deleting this media will remove it permanently from storage.\"],\"EEYbdt\":[\"Publish\"],\"EGwzOK\":[\"Complete Setup\"],\"EdQY6l\":[\"None\"],\"EkH9pt\":[\"Update\"],\"FGrimz\":[\"New Post\"],\"FkMol5\":[\"Featured\"],\"Fxf4jq\":[\"Description (optional)\"],\"GA5A5H\":[\"Delete Collection\"],\"GHg6h/\":[\"post\"],\"GTPbOX\":[\"Your site navigation\"],\"GX2VMa\":[\"Create your admin account.\"],\"GbVAnd\":[\"This password reset link is invalid or has expired. Please generate a new one.\"],\"GorKul\":[\"Welcome to Jant\"],\"GrZ6fH\":[\"New Page\"],\"GxkJXS\":[\"Uploading...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"Quiet (normal)\"],\"Hzi9AA\":[\"No posts found.\"],\"I6gXOa\":[\"Path\"],\"I8hDlV\":[\"At least 1 image required for image posts.\"],\"IUwGEM\":[\"Save Changes\"],\"IagCbF\":[\"URL\"],\"J4FNfC\":[\"No posts in this collection.\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"Need help? Visit the <0>documentation</0>\"],\"JiP4aa\":[\"Published pages are accessible via their path. Drafts are not visible.\"],\"K0r7TC\":[\"What's new?\"],\"K9NcLu\":[\"Use this URL to embed the media in your posts.\"],\"KbS2K9\":[\"Reset Password\"],\"KiJn9B\":[\"Note\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"Slug\"],\"LdyooL\":[\"link\"],\"LkvLQe\":[\"No pages yet.\"],\"M1RvTd\":[\"Click image to view full size\"],\"M8kJqa\":[\"Drafts\"],\"M9xgHy\":[\"Redirects\"],\"MHrjPM\":[\"Title\"],\"MLSRl9\":[\"Quote Text\"],\"MWBOxm\":[\"Collections (optional)\"],\"MZbQHL\":[\"No results found.\"],\"Mhf/H/\":[\"Create Redirect\"],\"MnbH31\":[\"page\"],\"MqghUt\":[\"Search posts...\"],\"N40H+G\":[\"All\"],\"NU2Fqi\":[\"Save CSS\"],\"O3oNi5\":[\"Email\"],\"OCNZaU\":[\"The path to redirect from\"],\"ODiSoW\":[\"No posts yet.\"],\"ONWvwQ\":[\"Upload\"],\"Pbm2/N\":[\"Create Collection\"],\"QEbNBb\":[\"Path (e.g. /archive) or full URL (e.g. https://example.com)\"],\"QLkhbH\":[\"The text being quoted...\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"Links\"],\"RwGhWy\":[\"Thread with \",[\"count\"],\" posts\"],\"SJmfuf\":[\"Site Name\"],\"ST+lN2\":[\"No media uploaded yet.\"],\"Tt5T6+\":[\"Articles\"],\"TxE+Mj\":[\"1 reply\"],\"Tz0i8g\":[\"Settings\"],\"U5v6Gh\":[\"Edit Page\"],\"UDMjsP\":[\"Quick Actions\"],\"UGT5vp\":[\"Save Settings\"],\"UxKoFf\":[\"Navigation\"],\"V4WsyL\":[\"Add Link\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"Change Password\"],\"WDcQq9\":[\"Unlisted\"],\"Weq9zb\":[\"General\"],\"WmZ/rP\":[\"To Path\"],\"Y+7JGK\":[\"Create Page\"],\"Y75ho6\":[\"Other pages\"],\"Z3FXyt\":[\"Loading...\"],\"ZQKLI1\":[\"Danger Zone\"],\"ZhhOwV\":[\"Quote\"],\"aAIQg2\":[\"Appearance\"],\"aaGV/9\":[\"New Link\"],\"an5hVd\":[\"Images\"],\"b+/jO6\":[\"301 (Permanent)\"],\"bHYIks\":[\"Sign Out\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"Delete\"],\"dEgA5A\":[\"Cancel\"],\"e6Jr7Q\":[\"← Back to Collections\"],\"ePK91l\":[\"Edit\"],\"eWLklq\":[\"Quotes\"],\"eneWvv\":[\"Draft\"],\"er8+x7\":[\"Demo account pre-filled. Just click Sign In.\"],\"f6e0Ry\":[\"Article\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"My Collection\"],\"g3mKmM\":[\"Un-nav\"],\"gDx5MG\":[\"Edit Link\"],\"hG89Ed\":[\"Image\"],\"hWOZIv\":[\"Enter your new password.\"],\"hXzOVo\":[\"Next\"],\"he3ygx\":[\"Copy\"],\"iBc+/N\":[\"Custom URL path. Leave empty to use default /p/ID format.\"],\"iDAqU6\":[\"URL (optional)\"],\"iH8pgl\":[\"Back\"],\"iPHeYN\":[\"Posting...\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jSRrXo\":[\"Published pages are accessible via their slug. Drafts are not visible.\"],\"jpctdh\":[\"View\"],\"jt/Ow/\":[\"posts\"],\"k1ifdL\":[\"Processing...\"],\"kI1qVD\":[\"Format\"],\"kNiQp6\":[\"Pinned\"],\"kd7eBB\":[\"Create Link\"],\"mTOYla\":[\"View all posts →\"],\"mnkknn\":[\"Collection (optional)\"],\"n1ekoW\":[\"Sign In\"],\"oJFOZk\":[\"Source Name (optional)\"],\"oYPBa0\":[\"Update Page\"],\"p2/GCq\":[\"Confirm Password\"],\"pRhYH2\":[\"Posts in Collection (\",[\"count\"],\")\"],\"pZq3aX\":[\"Upload failed. Please try again.\"],\"q+hNag\":[\"Collection\"],\"qMyM2u\":[\"Source URL (optional)\"],\"qiXmlF\":[\"Add Media\"],\"quFPTj\":[\"Custom Slug (optional)\"],\"r1MpXi\":[\"Quiet\"],\"rFmBG3\":[\"Color theme\"],\"rdUucN\":[\"Preview\"],\"rzNUSl\":[\"Thread with 1 post\"],\"sGajR7\":[\"Thread start\"],\"smzF8S\":[\"Show \",[\"remainingCount\"],\" more \",[\"0\"]],\"ssqvZi\":[\"Save Profile\"],\"t/YqKh\":[\"Remove\"],\"tfrt7B\":[\"No redirects configured.\"],\"tiq7kl\":[\"Page \",[\"page\"]],\"u2f7vd\":[\"Site Description\"],\"u3wRF+\":[\"Published\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"Status\"],\"vERlcd\":[\"Profile\"],\"vXIe7J\":[\"Language\"],\"vh0C9b\":[\"No navigation links yet. Add pages to navigation or create links.\"],\"vmQmHx\":[\"Add custom CSS to override any styles. Use data attributes like [data-page], [data-post], [data-format] to target specific elements.\"],\"vzU4k9\":[\"New Collection\"],\"wEF6Ix\":[\"The destination path or URL\"],\"wK4OTM\":[\"Title (optional)\"],\"wL3cK8\":[\"Latest\"],\"wM5UXj\":[\"Delete Media\"],\"wRR604\":[\"Pages\"],\"wc+17X\":[\"/* Your custom CSS here */\"],\"wdGjkd\":[\"No navigation links configured.\"],\"wja8aL\":[\"Untitled\"],\"x+doid\":[\"Images are automatically optimized: resized to max 1920px, converted to WebP, and metadata stripped.\"],\"x0mzE0\":[\"Create your first post\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"Media\"],\"y28hnO\":[\"Post\"],\"yQ2kGp\":[\"Load more\"],\"yjkELF\":[\"Confirm New Password\"],\"yzF66j\":[\"Link\"],\"z1U/Fh\":[\"Rating\"],\"z8ajIE\":[\"Found 1 result\"],\"zH6KqE\":[\"Found \",[\"count\"],\" results\"]}");
@@ -1 +1 @@
1
- /*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+bHzpy\":[\"链接的显示文本\"],\"+owNNn\":[\"帖子\"],\"+zy2Nq\":[\"类型\"],\"/0D1Xp\":[\"编辑集合\"],\"/Rj5P4\":[\"您的姓名\"],\"07Epll\":[\"这将为您的网站和仪表板设置主题。所有颜色主题都支持暗黑模式。\"],\"0JkyS7\":[\"创建您的第一页\"],\"0a6MpL\":[\"新重定向\"],\"1CU1Td\":[\"URL安全标识符(小写字母、数字、连字符)\"],\"1DBGsz\":[\"笔记\"],\"1o+wgo\":[\"例如:The Verge,John Doe\"],\"2N0qpv\":[\"帖子标题...\"],\"2fUwEY\":[\"选择媒体\"],\"2q/Q7x\":[\"可见性\"],\"2rJGtU\":[\"页面标题...\"],\"3Yvsaz\":[\"302(临时)\"],\"4/SFQS\":[\"查看网站\"],\"40TVQj\":[\"自定义路径(可选)\"],\"4KzVT6\":[\"删除页面\"],\"4b3oEV\":[\"内容\"],\"4mDPGp\":[\"此页面的 URL 路径。使用小写字母、数字和连字符。\"],\"6WdDG7\":[\"页面\"],\"6YtxFj\":[\"姓名\"],\"7G4SBz\":[\"页面内容(支持Markdown)...\"],\"7Mk+/h\":[\"更新收藏夹\"],\"7Q1KKN\":[\"来源路径\"],\"7aECQB\":[\"无效或过期的链接\"],\"7nGhhM\":[\"你在想什么?\"],\"7p5kLi\":[\"仪表板\"],\"7vhWI8\":[\"新密码\"],\"87a/t/\":[\"标签\"],\"8ZsakT\":[\"密码\"],\"90Luob\":[[\"count\"],\" 条回复\"],\"A1taO8\":[\"搜索\"],\"AeXO77\":[\"账户\"],\"AyHO4m\":[\"这个系列是关于什么的?\"],\"B373X+\":[\"编辑帖子\"],\"B495Gs\":[\"档案馆\"],\"BjF0Jv\":[\"仅允许小写字母、数字和连字符\"],\"D9Oea+\":[\"永久链接\"],\"DCKkhU\":[\"当前密码\"],\"DHhJ7s\":[\"上一页\"],\"DPfwMq\":[\"完成\"],\"DoJzLz\":[\"收藏夹\"],\"E80cJw\":[\"删除此媒体将永久从存储中移除。\"],\"EEYbdt\":[\"发布\"],\"EGwzOK\":[\"完成设置\"],\"EkH9pt\":[\"更新\"],\"FGrimz\":[\"新帖子\"],\"FkMol5\":[\"精选\"],\"Fxf4jq\":[\"描述(可选)\"],\"GA5A5H\":[\"删除收藏夹\"],\"GX2VMa\":[\"创建您的管理员账户。\"],\"GbVAnd\":[\"此密码重置链接无效或已过期。请生成一个新的链接。\"],\"GorKul\":[\"欢迎来到Jant\"],\"GrZ6fH\":[\"新页面\"],\"GxkJXS\":[\"上传中...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"安静(正常)\"],\"Hzi9AA\":[\"未找到帖子。\"],\"I6gXOa\":[\"路径\"],\"I8hDlV\":[\"图像帖子至少需要 1 张图片。\"],\"IUwGEM\":[\"保存更改\"],\"IagCbF\":[\"网址\"],\"J4FNfC\":[\"此集合中没有帖子。\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"需要帮助吗?访问<0>文档</0>。\"],\"JiP4aa\":[\"已发布的页面可以通过其路径访问。草稿不可见。\"],\"K9NcLu\":[\"使用此 URL 将媒体嵌入到您的帖子中。\"],\"KbS2K9\":[\"重置密码\"],\"KiJn9B\":[\"注意\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"缩略名\"],\"LkvLQe\":[\"还没有页面。\"],\"M1RvTd\":[\"点击图片查看完整尺寸\"],\"M8kJqa\":[\"草稿\"],\"M9xgHy\":[\"重定向\"],\"MHrjPM\":[\"标题\"],\"MWBOxm\":[\"集合(可选)\"],\"MZbQHL\":[\"未找到结果。\"],\"Mhf/H/\":[\"创建重定向\"],\"MqghUt\":[\"搜索帖子...\"],\"N40H+G\":[\"所有\"],\"O3oNi5\":[\"电子邮件\"],\"OCNZaU\":[\"重定向的路径\"],\"ODiSoW\":[\"还没有帖子。\"],\"ONWvwQ\":[\"上传\"],\"Pbm2/N\":[\"创建集合\"],\"QEbNBb\":[\"路径(例如 /archive)或完整 URL(例如 https://example.com)\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"链接\"],\"RwGhWy\":[\"包含 \",[\"count\"],\" 条帖子的话题\"],\"SJmfuf\":[\"网站名称\"],\"ST+lN2\":[\"尚未上传任何媒体。\"],\"Tt5T6+\":[\"文章\"],\"TxE+Mj\":[\"1 条回复\"],\"Tz0i8g\":[\"设置\"],\"U5v6Gh\":[\"编辑页面\"],\"UDMjsP\":[\"快速操作\"],\"UGT5vp\":[\"保存设置\"],\"UxKoFf\":[\"导航\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"更改密码\"],\"WDcQq9\":[\"未列出\"],\"Weq9zb\":[\"常规\"],\"WmZ/rP\":[\"到路径\"],\"Y+7JGK\":[\"创建页面\"],\"Z3FXyt\":[\"加载中...\"],\"ZQKLI1\":[\"危险区域\"],\"ZhhOwV\":[\"引用\"],\"aAIQg2\":[\"外观\"],\"aaGV/9\":[\"新链接\"],\"an5hVd\":[\"图片\"],\"b+/jO6\":[\"301(永久)\"],\"bHYIks\":[\"登出\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"删除\"],\"dEgA5A\":[\"取消\"],\"e6Jr7Q\":[\"← 返回收藏夹\"],\"ePK91l\":[\"编辑\"],\"eWLklq\":[\"引用\"],\"eneWvv\":[\"草稿\"],\"er8+x7\":[\"演示账户已预填。只需点击登录。\"],\"f6e0Ry\":[\"文章\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"我的收藏\"],\"gDx5MG\":[\"编辑链接\"],\"hG89Ed\":[\"图像\"],\"hWOZIv\":[\"输入您的新密码。\"],\"hXzOVo\":[\"下一页\"],\"he3ygx\":[\"复制\"],\"iH8pgl\":[\"返回\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jpctdh\":[\"查看\"],\"k1ifdL\":[\"处理中...\"],\"kd7eBB\":[\"创建链接\"],\"mTOYla\":[\"View all posts →\"],\"n1ekoW\":[\"登录\"],\"oJFOZk\":[\"来源名称(可选)\"],\"oYPBa0\":[\"更新页面\"],\"p2/GCq\":[\"确认密码\"],\"pRhYH2\":[\"集合中的帖子 (\",[\"count\"],\")\"],\"pZq3aX\":[\"上传失败。请再试一次。\"],\"qMyM2u\":[\"源网址(可选)\"],\"qiXmlF\":[\"添加媒体\"],\"r1MpXi\":[\"安静\"],\"rFmBG3\":[\"颜色主题\"],\"rdUucN\":[\"预览\"],\"rzNUSl\":[\"包含 1 条帖子的话题\"],\"sGajR7\":[\"线程开始\"],\"smzF8S\":[\"显示 \",[\"remainingCount\"],\" 个更多 \",[\"0\"]],\"ssqvZi\":[\"保存个人资料\"],\"t/YqKh\":[\"移除\"],\"tfrt7B\":[\"未配置重定向。\"],\"tiq7kl\":[\"页面 \",[\"page\"]],\"u2f7vd\":[\"网站描述\"],\"u3wRF+\":[\"已发布\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"状态\"],\"vERlcd\":[\"个人资料\"],\"vXIe7J\":[\"语言\"],\"vzU4k9\":[\"新收藏\"],\"wEF6Ix\":[\"目标路径或 URL\"],\"wK4OTM\":[\"标题(可选)\"],\"wM5UXj\":[\"删除媒体\"],\"wRR604\":[\"页面\"],\"wdGjkd\":[\"未配置导航链接。\"],\"wja8aL\":[\"无标题\"],\"x+doid\":[\"图像会自动优化:调整大小至最大 1920px,转换为 WebP,并去除元数据。\"],\"x0mzE0\":[\"创建你的第一篇帖子\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"媒体\"],\"y28hnO\":[\"帖子\"],\"yQ2kGp\":[\"加载更多\"],\"yjkELF\":[\"确认新密码\"],\"yzF66j\":[\"链接\"],\"z8ajIE\":[\"找到 1 个结果\"],\"zH6KqE\":[\"找到 \",[\"count\"],\" 个结果\"]}");
1
+ /*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+MH6k9\":[\"Add to nav\"],\"+bHzpy\":[\"链接的显示文本\"],\"+owNNn\":[\"帖子\"],\"+zy2Nq\":[\"类型\"],\"/0D1Xp\":[\"编辑集合\"],\"/Rj5P4\":[\"您的姓名\"],\"/rkqRV\":[\"All pages are in your navigation.\"],\"07Epll\":[\"这将为您的网站和仪表板设置主题。所有颜色主题都支持暗黑模式。\"],\"0JkyS7\":[\"创建您的第一页\"],\"0a6MpL\":[\"新重定向\"],\"0yIy82\":[\"No featured posts yet.\"],\"1CU1Td\":[\"URL安全标识符(小写字母、数字、连字符)\"],\"1DBGsz\":[\"笔记\"],\"1o+wgo\":[\"例如:The Verge,John Doe\"],\"2N0qpv\":[\"帖子标题...\"],\"2fUwEY\":[\"选择媒体\"],\"2q/Q7x\":[\"可见性\"],\"2rJGtU\":[\"页面标题...\"],\"3Yvsaz\":[\"302(临时)\"],\"4/SFQS\":[\"查看网站\"],\"40TVQj\":[\"自定义路径(可选)\"],\"4KzVT6\":[\"删除页面\"],\"4b3oEV\":[\"内容\"],\"4mDPGp\":[\"此页面的 URL 路径。使用小写字母、数字和连字符。\"],\"6WdDG7\":[\"页面\"],\"6YtxFj\":[\"姓名\"],\"7G4SBz\":[\"页面内容(支持Markdown)...\"],\"7Mk+/h\":[\"更新收藏夹\"],\"7Q1KKN\":[\"来源路径\"],\"7aECQB\":[\"无效或过期的链接\"],\"7nGhhM\":[\"你在想什么?\"],\"7p5kLi\":[\"仪表板\"],\"7vhWI8\":[\"新密码\"],\"87a/t/\":[\"标签\"],\"8ZsakT\":[\"密码\"],\"9+vGLh\":[\"Custom CSS\"],\"90Luob\":[[\"count\"],\" 条回复\"],\"A1taO8\":[\"搜索\"],\"AeXO77\":[\"账户\"],\"AyHO4m\":[\"这个系列是关于什么的?\"],\"B373X+\":[\"编辑帖子\"],\"B495Gs\":[\"档案馆\"],\"BjF0Jv\":[\"仅允许小写字母、数字和连字符\"],\"D9Oea+\":[\"永久链接\"],\"DCKkhU\":[\"当前密码\"],\"DHhJ7s\":[\"上一页\"],\"DPfwMq\":[\"完成\"],\"DoJzLz\":[\"收藏夹\"],\"E80cJw\":[\"删除此媒体将永久从存储中移除。\"],\"EEYbdt\":[\"发布\"],\"EGwzOK\":[\"完成设置\"],\"EdQY6l\":[\"None\"],\"EkH9pt\":[\"更新\"],\"FGrimz\":[\"新帖子\"],\"FkMol5\":[\"精选\"],\"Fxf4jq\":[\"描述(可选)\"],\"GA5A5H\":[\"删除收藏夹\"],\"GHg6h/\":[\"post\"],\"GTPbOX\":[\"Your site navigation\"],\"GX2VMa\":[\"创建您的管理员账户。\"],\"GbVAnd\":[\"此密码重置链接无效或已过期。请生成一个新的链接。\"],\"GorKul\":[\"欢迎来到Jant\"],\"GrZ6fH\":[\"新页面\"],\"GxkJXS\":[\"上传中...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"安静(正常)\"],\"Hzi9AA\":[\"未找到帖子。\"],\"I6gXOa\":[\"路径\"],\"I8hDlV\":[\"图像帖子至少需要 1 张图片。\"],\"IUwGEM\":[\"保存更改\"],\"IagCbF\":[\"网址\"],\"J4FNfC\":[\"此集合中没有帖子。\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"需要帮助吗?访问<0>文档</0>。\"],\"JiP4aa\":[\"已发布的页面可以通过其路径访问。草稿不可见。\"],\"K0r7TC\":[\"What's new?\"],\"K9NcLu\":[\"使用此 URL 将媒体嵌入到您的帖子中。\"],\"KbS2K9\":[\"重置密码\"],\"KiJn9B\":[\"注意\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"缩略名\"],\"LdyooL\":[\"link\"],\"LkvLQe\":[\"还没有页面。\"],\"M1RvTd\":[\"点击图片查看完整尺寸\"],\"M8kJqa\":[\"草稿\"],\"M9xgHy\":[\"重定向\"],\"MHrjPM\":[\"标题\"],\"MLSRl9\":[\"Quote Text\"],\"MWBOxm\":[\"集合(可选)\"],\"MZbQHL\":[\"未找到结果。\"],\"Mhf/H/\":[\"创建重定向\"],\"MnbH31\":[\"page\"],\"MqghUt\":[\"搜索帖子...\"],\"N40H+G\":[\"所有\"],\"NU2Fqi\":[\"Save CSS\"],\"O3oNi5\":[\"电子邮件\"],\"OCNZaU\":[\"重定向的路径\"],\"ODiSoW\":[\"还没有帖子。\"],\"ONWvwQ\":[\"上传\"],\"Pbm2/N\":[\"创建集合\"],\"QEbNBb\":[\"路径(例如 /archive)或完整 URL(例如 https://example.com)\"],\"QLkhbH\":[\"The text being quoted...\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"链接\"],\"RwGhWy\":[\"包含 \",[\"count\"],\" 条帖子的话题\"],\"SJmfuf\":[\"网站名称\"],\"ST+lN2\":[\"尚未上传任何媒体。\"],\"Tt5T6+\":[\"文章\"],\"TxE+Mj\":[\"1 条回复\"],\"Tz0i8g\":[\"设置\"],\"U5v6Gh\":[\"编辑页面\"],\"UDMjsP\":[\"快速操作\"],\"UGT5vp\":[\"保存设置\"],\"UxKoFf\":[\"导航\"],\"V4WsyL\":[\"Add Link\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"更改密码\"],\"WDcQq9\":[\"未列出\"],\"Weq9zb\":[\"常规\"],\"WmZ/rP\":[\"到路径\"],\"Y+7JGK\":[\"创建页面\"],\"Y75ho6\":[\"Other pages\"],\"Z3FXyt\":[\"加载中...\"],\"ZQKLI1\":[\"危险区域\"],\"ZhhOwV\":[\"引用\"],\"aAIQg2\":[\"外观\"],\"aaGV/9\":[\"新链接\"],\"an5hVd\":[\"图片\"],\"b+/jO6\":[\"301(永久)\"],\"bHYIks\":[\"登出\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"删除\"],\"dEgA5A\":[\"取消\"],\"e6Jr7Q\":[\"← 返回收藏夹\"],\"ePK91l\":[\"编辑\"],\"eWLklq\":[\"引用\"],\"eneWvv\":[\"草稿\"],\"er8+x7\":[\"演示账户已预填。只需点击登录。\"],\"f6e0Ry\":[\"文章\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"我的收藏\"],\"g3mKmM\":[\"Un-nav\"],\"gDx5MG\":[\"编辑链接\"],\"hG89Ed\":[\"图像\"],\"hWOZIv\":[\"输入您的新密码。\"],\"hXzOVo\":[\"下一页\"],\"he3ygx\":[\"复制\"],\"iBc+/N\":[\"Custom URL path. Leave empty to use default /p/ID format.\"],\"iDAqU6\":[\"URL (optional)\"],\"iH8pgl\":[\"返回\"],\"iPHeYN\":[\"Posting...\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jSRrXo\":[\"Published pages are accessible via their slug. Drafts are not visible.\"],\"jpctdh\":[\"查看\"],\"jt/Ow/\":[\"posts\"],\"k1ifdL\":[\"处理中...\"],\"kI1qVD\":[\"Format\"],\"kNiQp6\":[\"Pinned\"],\"kd7eBB\":[\"创建链接\"],\"mTOYla\":[\"View all posts →\"],\"mnkknn\":[\"Collection (optional)\"],\"n1ekoW\":[\"登录\"],\"oJFOZk\":[\"来源名称(可选)\"],\"oYPBa0\":[\"更新页面\"],\"p2/GCq\":[\"确认密码\"],\"pRhYH2\":[\"集合中的帖子 (\",[\"count\"],\")\"],\"pZq3aX\":[\"上传失败。请再试一次。\"],\"q+hNag\":[\"Collection\"],\"qMyM2u\":[\"源网址(可选)\"],\"qiXmlF\":[\"添加媒体\"],\"quFPTj\":[\"Custom Slug (optional)\"],\"r1MpXi\":[\"安静\"],\"rFmBG3\":[\"颜色主题\"],\"rdUucN\":[\"预览\"],\"rzNUSl\":[\"包含 1 条帖子的话题\"],\"sGajR7\":[\"线程开始\"],\"smzF8S\":[\"显示 \",[\"remainingCount\"],\" 个更多 \",[\"0\"]],\"ssqvZi\":[\"保存个人资料\"],\"t/YqKh\":[\"移除\"],\"tfrt7B\":[\"未配置重定向。\"],\"tiq7kl\":[\"页面 \",[\"page\"]],\"u2f7vd\":[\"网站描述\"],\"u3wRF+\":[\"已发布\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"状态\"],\"vERlcd\":[\"个人资料\"],\"vXIe7J\":[\"语言\"],\"vh0C9b\":[\"No navigation links yet. Add pages to navigation or create links.\"],\"vmQmHx\":[\"Add custom CSS to override any styles. Use data attributes like [data-page], [data-post], [data-format] to target specific elements.\"],\"vzU4k9\":[\"新收藏\"],\"wEF6Ix\":[\"目标路径或 URL\"],\"wK4OTM\":[\"标题(可选)\"],\"wL3cK8\":[\"Latest\"],\"wM5UXj\":[\"删除媒体\"],\"wRR604\":[\"页面\"],\"wc+17X\":[\"/* Your custom CSS here */\"],\"wdGjkd\":[\"未配置导航链接。\"],\"wja8aL\":[\"无标题\"],\"x+doid\":[\"图像会自动优化:调整大小至最大 1920px,转换为 WebP,并去除元数据。\"],\"x0mzE0\":[\"创建你的第一篇帖子\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"媒体\"],\"y28hnO\":[\"帖子\"],\"yQ2kGp\":[\"加载更多\"],\"yjkELF\":[\"确认新密码\"],\"yzF66j\":[\"链接\"],\"z1U/Fh\":[\"Rating\"],\"z8ajIE\":[\"找到 1 个结果\"],\"zH6KqE\":[\"找到 \",[\"count\"],\" 个结果\"]}");
@@ -1 +1 @@
1
- /*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+bHzpy\":[\"顯示連結的文字\"],\"+owNNn\":[\"文章\"],\"+zy2Nq\":[\"類型\"],\"/0D1Xp\":[\"編輯收藏集\"],\"/Rj5P4\":[\"您的姓名\"],\"07Epll\":[\"這將為您的網站和儀表板設置主題。所有顏色主題都支持深色模式。\"],\"0JkyS7\":[\"建立您的第一個頁面\"],\"0a6MpL\":[\"新重定向\"],\"1CU1Td\":[\"網址安全識別碼(小寫、數字、連字符)\"],\"1DBGsz\":[\"筆記\"],\"1o+wgo\":[\"例如:The Verge,約翰·多伊\"],\"2N0qpv\":[\"文章標題...\"],\"2fUwEY\":[\"選擇媒體\"],\"2q/Q7x\":[\"可見性\"],\"2rJGtU\":[\"頁面標題...\"],\"3Yvsaz\":[\"302(臨時)\"],\"4/SFQS\":[\"查看網站\"],\"40TVQj\":[\"自訂路徑(選填)\"],\"4KzVT6\":[\"刪除頁面\"],\"4b3oEV\":[\"內容\"],\"4mDPGp\":[\"此頁面的 URL 路徑。使用小寫字母、數字和連字符。\"],\"6WdDG7\":[\"頁面\"],\"6YtxFj\":[\"名稱\"],\"7G4SBz\":[\"頁面內容(支持Markdown)...\"],\"7Mk+/h\":[\"更新收藏集\"],\"7Q1KKN\":[\"來源路徑\"],\"7aECQB\":[\"無效或已過期的連結\"],\"7nGhhM\":[\"你在想什麼?\"],\"7p5kLi\":[\"儀表板\"],\"7vhWI8\":[\"新密碼\"],\"87a/t/\":[\"標籤\"],\"8ZsakT\":[\"密碼\"],\"90Luob\":[[\"count\"],\" 條回覆\"],\"A1taO8\":[\"搜尋\"],\"AeXO77\":[\"帳戶\"],\"AyHO4m\":[\"這個收藏是關於什麼的?\"],\"B373X+\":[\"編輯文章\"],\"B495Gs\":[\"檔案館\"],\"BjF0Jv\":[\"僅限小寫字母、數字和連字符\"],\"D9Oea+\":[\"永久鏈接\"],\"DCKkhU\":[\"當前密碼\"],\"DHhJ7s\":[\"上一頁\"],\"DPfwMq\":[\"完成\"],\"DoJzLz\":[\"收藏夾\"],\"E80cJw\":[\"刪除此媒體將永久從存儲中移除它。\"],\"EEYbdt\":[\"發佈\"],\"EGwzOK\":[\"完成設置\"],\"EkH9pt\":[\"更新\"],\"FGrimz\":[\"新帖子\"],\"FkMol5\":[\"精選\"],\"Fxf4jq\":[\"描述(可選)\"],\"GA5A5H\":[\"刪除收藏夾\"],\"GX2VMa\":[\"建立您的管理員帳戶。\"],\"GbVAnd\":[\"此密碼重設連結無效或已過期。請生成一個新的連結。\"],\"GorKul\":[\"歡迎來到 Jant\"],\"GrZ6fH\":[\"新頁面\"],\"GxkJXS\":[\"上傳中...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"安靜(正常)\"],\"Hzi9AA\":[\"未找到任何帖子。\"],\"I6gXOa\":[\"路徑\"],\"I8hDlV\":[\"至少需要 1 張圖片才能發佈圖片帖子。\"],\"IUwGEM\":[\"保存更改\"],\"IagCbF\":[\"網址\"],\"J4FNfC\":[\"此集合中沒有帖子。\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"需要幫助嗎?請訪問<0>文檔</0>。\"],\"JiP4aa\":[\"已發佈的頁面可以通過其路徑訪問。草稿不可見。\"],\"K9NcLu\":[\"使用此 URL 將媒體嵌入到您的帖子中。\"],\"KbS2K9\":[\"重設密碼\"],\"KiJn9B\":[\"備註\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"縮略名\"],\"LkvLQe\":[\"尚未有頁面。\"],\"M1RvTd\":[\"點擊圖片以查看完整大小\"],\"M8kJqa\":[\"草稿\"],\"M9xgHy\":[\"重定向\"],\"MHrjPM\":[\"標題\"],\"MWBOxm\":[\"收藏(可選)\"],\"MZbQHL\":[\"未找到結果。\"],\"Mhf/H/\":[\"建立重定向\"],\"MqghUt\":[\"搜尋帖子...\"],\"N40H+G\":[\"所有\"],\"O3oNi5\":[\"電子郵件\"],\"OCNZaU\":[\"重定向來源的路徑\"],\"ODiSoW\":[\"尚未有帖子。\"],\"ONWvwQ\":[\"上傳\"],\"Pbm2/N\":[\"創建收藏夾\"],\"QEbNBb\":[\"路徑(例如 /archive)或完整網址(例如 https://example.com)\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"連結\"],\"RwGhWy\":[\"包含 \",[\"count\"],\" 則帖子的主題\"],\"SJmfuf\":[\"網站名稱\"],\"ST+lN2\":[\"尚未上傳任何媒體。\"],\"Tt5T6+\":[\"文章\"],\"TxE+Mj\":[\"1 條回覆\"],\"Tz0i8g\":[\"設定\"],\"U5v6Gh\":[\"編輯頁面\"],\"UDMjsP\":[\"快速操作\"],\"UGT5vp\":[\"保存設定\"],\"UxKoFf\":[\"導航\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"更改密碼\"],\"WDcQq9\":[\"不公開\"],\"Weq9zb\":[\"一般設定\"],\"WmZ/rP\":[\"到路徑\"],\"Y+7JGK\":[\"創建頁面\"],\"Z3FXyt\":[\"載入中...\"],\"ZQKLI1\":[\"危險區域\"],\"ZhhOwV\":[\"引用\"],\"aAIQg2\":[\"外觀\"],\"aaGV/9\":[\"新連結\"],\"an5hVd\":[\"圖片\"],\"b+/jO6\":[\"301(永久)\"],\"bHYIks\":[\"登出\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"刪除\"],\"dEgA5A\":[\"取消\"],\"e6Jr7Q\":[\"← 返回收藏夾\"],\"ePK91l\":[\"編輯\"],\"eWLklq\":[\"引用\"],\"eneWvv\":[\"草稿\"],\"er8+x7\":[\"示範帳戶已預填。只需點擊登入。\"],\"f6e0Ry\":[\"文章\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"我的收藏\"],\"gDx5MG\":[\"編輯連結\"],\"hG89Ed\":[\"圖片\"],\"hWOZIv\":[\"請輸入您的新密碼。\"],\"hXzOVo\":[\"下一頁\"],\"he3ygx\":[\"複製\"],\"iH8pgl\":[\"返回\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jpctdh\":[\"查看\"],\"k1ifdL\":[\"處理中...\"],\"kd7eBB\":[\"建立連結\"],\"mTOYla\":[\"View all posts →\"],\"n1ekoW\":[\"登入\"],\"oJFOZk\":[\"來源名稱(選填)\"],\"oYPBa0\":[\"更新頁面\"],\"p2/GCq\":[\"確認密碼\"],\"pRhYH2\":[\"收藏中的帖子 (\",[\"count\"],\")\"],\"pZq3aX\":[\"上傳失敗。請再試一次。\"],\"qMyM2u\":[\"來源網址(選填)\"],\"qiXmlF\":[\"添加媒體\"],\"r1MpXi\":[\"安靜\"],\"rFmBG3\":[\"顏色主題\"],\"rdUucN\":[\"預覽\"],\"rzNUSl\":[\"包含 1 則貼文的主題\"],\"sGajR7\":[\"線程開始\"],\"smzF8S\":[\"顯示 \",[\"remainingCount\"],\" 個更多 \",[\"0\"]],\"ssqvZi\":[\"保存個人資料\"],\"t/YqKh\":[\"移除\"],\"tfrt7B\":[\"未配置任何重定向。\"],\"tiq7kl\":[\"頁面 \",[\"page\"]],\"u2f7vd\":[\"網站描述\"],\"u3wRF+\":[\"已發佈\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"狀態\"],\"vERlcd\":[\"個人資料\"],\"vXIe7J\":[\"語言\"],\"vzU4k9\":[\"新收藏集\"],\"wEF6Ix\":[\"目的地路徑或 URL\"],\"wK4OTM\":[\"標題(選填)\"],\"wM5UXj\":[\"刪除媒體\"],\"wRR604\":[\"頁面\"],\"wdGjkd\":[\"未配置導航連結。\"],\"wja8aL\":[\"無標題\"],\"x+doid\":[\"圖片會自動優化:調整大小至最大 1920 像素,轉換為 WebP 格式,並去除元數據。\"],\"x0mzE0\":[\"創建你的第一篇帖子\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"媒體\"],\"y28hnO\":[\"文章\"],\"yQ2kGp\":[\"載入更多\"],\"yjkELF\":[\"確認新密碼\"],\"yzF66j\":[\"連結\"],\"z8ajIE\":[\"找到 1 個結果\"],\"zH6KqE\":[\"找到 \",[\"count\"],\" 個結果\"]}");
1
+ /*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+MH6k9\":[\"Add to nav\"],\"+bHzpy\":[\"顯示連結的文字\"],\"+owNNn\":[\"文章\"],\"+zy2Nq\":[\"類型\"],\"/0D1Xp\":[\"編輯收藏集\"],\"/Rj5P4\":[\"您的姓名\"],\"/rkqRV\":[\"All pages are in your navigation.\"],\"07Epll\":[\"這將為您的網站和儀表板設置主題。所有顏色主題都支持深色模式。\"],\"0JkyS7\":[\"建立您的第一個頁面\"],\"0a6MpL\":[\"新重定向\"],\"0yIy82\":[\"No featured posts yet.\"],\"1CU1Td\":[\"網址安全識別碼(小寫、數字、連字符)\"],\"1DBGsz\":[\"筆記\"],\"1o+wgo\":[\"例如:The Verge,約翰·多伊\"],\"2N0qpv\":[\"文章標題...\"],\"2fUwEY\":[\"選擇媒體\"],\"2q/Q7x\":[\"可見性\"],\"2rJGtU\":[\"頁面標題...\"],\"3Yvsaz\":[\"302(臨時)\"],\"4/SFQS\":[\"查看網站\"],\"40TVQj\":[\"自訂路徑(選填)\"],\"4KzVT6\":[\"刪除頁面\"],\"4b3oEV\":[\"內容\"],\"4mDPGp\":[\"此頁面的 URL 路徑。使用小寫字母、數字和連字符。\"],\"6WdDG7\":[\"頁面\"],\"6YtxFj\":[\"名稱\"],\"7G4SBz\":[\"頁面內容(支持Markdown)...\"],\"7Mk+/h\":[\"更新收藏集\"],\"7Q1KKN\":[\"來源路徑\"],\"7aECQB\":[\"無效或已過期的連結\"],\"7nGhhM\":[\"你在想什麼?\"],\"7p5kLi\":[\"儀表板\"],\"7vhWI8\":[\"新密碼\"],\"87a/t/\":[\"標籤\"],\"8ZsakT\":[\"密碼\"],\"9+vGLh\":[\"Custom CSS\"],\"90Luob\":[[\"count\"],\" 條回覆\"],\"A1taO8\":[\"搜尋\"],\"AeXO77\":[\"帳戶\"],\"AyHO4m\":[\"這個收藏是關於什麼的?\"],\"B373X+\":[\"編輯文章\"],\"B495Gs\":[\"檔案館\"],\"BjF0Jv\":[\"僅限小寫字母、數字和連字符\"],\"D9Oea+\":[\"永久鏈接\"],\"DCKkhU\":[\"當前密碼\"],\"DHhJ7s\":[\"上一頁\"],\"DPfwMq\":[\"完成\"],\"DoJzLz\":[\"收藏夾\"],\"E80cJw\":[\"刪除此媒體將永久從存儲中移除它。\"],\"EEYbdt\":[\"發佈\"],\"EGwzOK\":[\"完成設置\"],\"EdQY6l\":[\"None\"],\"EkH9pt\":[\"更新\"],\"FGrimz\":[\"新帖子\"],\"FkMol5\":[\"精選\"],\"Fxf4jq\":[\"描述(可選)\"],\"GA5A5H\":[\"刪除收藏夾\"],\"GHg6h/\":[\"post\"],\"GTPbOX\":[\"Your site navigation\"],\"GX2VMa\":[\"建立您的管理員帳戶。\"],\"GbVAnd\":[\"此密碼重設連結無效或已過期。請生成一個新的連結。\"],\"GorKul\":[\"歡迎來到 Jant\"],\"GrZ6fH\":[\"新頁面\"],\"GxkJXS\":[\"上傳中...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"安靜(正常)\"],\"Hzi9AA\":[\"未找到任何帖子。\"],\"I6gXOa\":[\"路徑\"],\"I8hDlV\":[\"至少需要 1 張圖片才能發佈圖片帖子。\"],\"IUwGEM\":[\"保存更改\"],\"IagCbF\":[\"網址\"],\"J4FNfC\":[\"此集合中沒有帖子。\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"需要幫助嗎?請訪問<0>文檔</0>。\"],\"JiP4aa\":[\"已發佈的頁面可以通過其路徑訪問。草稿不可見。\"],\"K0r7TC\":[\"What's new?\"],\"K9NcLu\":[\"使用此 URL 將媒體嵌入到您的帖子中。\"],\"KbS2K9\":[\"重設密碼\"],\"KiJn9B\":[\"備註\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"縮略名\"],\"LdyooL\":[\"link\"],\"LkvLQe\":[\"尚未有頁面。\"],\"M1RvTd\":[\"點擊圖片以查看完整大小\"],\"M8kJqa\":[\"草稿\"],\"M9xgHy\":[\"重定向\"],\"MHrjPM\":[\"標題\"],\"MLSRl9\":[\"Quote Text\"],\"MWBOxm\":[\"收藏(可選)\"],\"MZbQHL\":[\"未找到結果。\"],\"Mhf/H/\":[\"建立重定向\"],\"MnbH31\":[\"page\"],\"MqghUt\":[\"搜尋帖子...\"],\"N40H+G\":[\"所有\"],\"NU2Fqi\":[\"Save CSS\"],\"O3oNi5\":[\"電子郵件\"],\"OCNZaU\":[\"重定向來源的路徑\"],\"ODiSoW\":[\"尚未有帖子。\"],\"ONWvwQ\":[\"上傳\"],\"Pbm2/N\":[\"創建收藏夾\"],\"QEbNBb\":[\"路徑(例如 /archive)或完整網址(例如 https://example.com)\"],\"QLkhbH\":[\"The text being quoted...\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"連結\"],\"RwGhWy\":[\"包含 \",[\"count\"],\" 則帖子的主題\"],\"SJmfuf\":[\"網站名稱\"],\"ST+lN2\":[\"尚未上傳任何媒體。\"],\"Tt5T6+\":[\"文章\"],\"TxE+Mj\":[\"1 條回覆\"],\"Tz0i8g\":[\"設定\"],\"U5v6Gh\":[\"編輯頁面\"],\"UDMjsP\":[\"快速操作\"],\"UGT5vp\":[\"保存設定\"],\"UxKoFf\":[\"導航\"],\"V4WsyL\":[\"Add Link\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"更改密碼\"],\"WDcQq9\":[\"不公開\"],\"Weq9zb\":[\"一般設定\"],\"WmZ/rP\":[\"到路徑\"],\"Y+7JGK\":[\"創建頁面\"],\"Y75ho6\":[\"Other pages\"],\"Z3FXyt\":[\"載入中...\"],\"ZQKLI1\":[\"危險區域\"],\"ZhhOwV\":[\"引用\"],\"aAIQg2\":[\"外觀\"],\"aaGV/9\":[\"新連結\"],\"an5hVd\":[\"圖片\"],\"b+/jO6\":[\"301(永久)\"],\"bHYIks\":[\"登出\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"刪除\"],\"dEgA5A\":[\"取消\"],\"e6Jr7Q\":[\"← 返回收藏夾\"],\"ePK91l\":[\"編輯\"],\"eWLklq\":[\"引用\"],\"eneWvv\":[\"草稿\"],\"er8+x7\":[\"示範帳戶已預填。只需點擊登入。\"],\"f6e0Ry\":[\"文章\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"我的收藏\"],\"g3mKmM\":[\"Un-nav\"],\"gDx5MG\":[\"編輯連結\"],\"hG89Ed\":[\"圖片\"],\"hWOZIv\":[\"請輸入您的新密碼。\"],\"hXzOVo\":[\"下一頁\"],\"he3ygx\":[\"複製\"],\"iBc+/N\":[\"Custom URL path. Leave empty to use default /p/ID format.\"],\"iDAqU6\":[\"URL (optional)\"],\"iH8pgl\":[\"返回\"],\"iPHeYN\":[\"Posting...\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jSRrXo\":[\"Published pages are accessible via their slug. Drafts are not visible.\"],\"jpctdh\":[\"查看\"],\"jt/Ow/\":[\"posts\"],\"k1ifdL\":[\"處理中...\"],\"kI1qVD\":[\"Format\"],\"kNiQp6\":[\"Pinned\"],\"kd7eBB\":[\"建立連結\"],\"mTOYla\":[\"View all posts →\"],\"mnkknn\":[\"Collection (optional)\"],\"n1ekoW\":[\"登入\"],\"oJFOZk\":[\"來源名稱(選填)\"],\"oYPBa0\":[\"更新頁面\"],\"p2/GCq\":[\"確認密碼\"],\"pRhYH2\":[\"收藏中的帖子 (\",[\"count\"],\")\"],\"pZq3aX\":[\"上傳失敗。請再試一次。\"],\"q+hNag\":[\"Collection\"],\"qMyM2u\":[\"來源網址(選填)\"],\"qiXmlF\":[\"添加媒體\"],\"quFPTj\":[\"Custom Slug (optional)\"],\"r1MpXi\":[\"安靜\"],\"rFmBG3\":[\"顏色主題\"],\"rdUucN\":[\"預覽\"],\"rzNUSl\":[\"包含 1 則貼文的主題\"],\"sGajR7\":[\"線程開始\"],\"smzF8S\":[\"顯示 \",[\"remainingCount\"],\" 個更多 \",[\"0\"]],\"ssqvZi\":[\"保存個人資料\"],\"t/YqKh\":[\"移除\"],\"tfrt7B\":[\"未配置任何重定向。\"],\"tiq7kl\":[\"頁面 \",[\"page\"]],\"u2f7vd\":[\"網站描述\"],\"u3wRF+\":[\"已發佈\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"狀態\"],\"vERlcd\":[\"個人資料\"],\"vXIe7J\":[\"語言\"],\"vh0C9b\":[\"No navigation links yet. Add pages to navigation or create links.\"],\"vmQmHx\":[\"Add custom CSS to override any styles. Use data attributes like [data-page], [data-post], [data-format] to target specific elements.\"],\"vzU4k9\":[\"新收藏集\"],\"wEF6Ix\":[\"目的地路徑或 URL\"],\"wK4OTM\":[\"標題(選填)\"],\"wL3cK8\":[\"Latest\"],\"wM5UXj\":[\"刪除媒體\"],\"wRR604\":[\"頁面\"],\"wc+17X\":[\"/* Your custom CSS here */\"],\"wdGjkd\":[\"未配置導航連結。\"],\"wja8aL\":[\"無標題\"],\"x+doid\":[\"圖片會自動優化:調整大小至最大 1920 像素,轉換為 WebP 格式,並去除元數據。\"],\"x0mzE0\":[\"創建你的第一篇帖子\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"媒體\"],\"y28hnO\":[\"文章\"],\"yQ2kGp\":[\"載入更多\"],\"yjkELF\":[\"確認新密碼\"],\"yzF66j\":[\"連結\"],\"z1U/Fh\":[\"Rating\"],\"z8ajIE\":[\"找到 1 個結果\"],\"zH6KqE\":[\"找到 \",[\"count\"],\" 個結果\"]}");
package/dist/index.js CHANGED
@@ -4,19 +4,13 @@
4
4
  * @packageDocumentation
5
5
  */ // Main app factory
6
6
  export { createApp } from "./app.js";
7
- // Default theme
8
- export { theme as minimalTheme } from "./themes/minimal/index.js";
9
- export { POST_TYPES, VISIBILITY_LEVELS, MAX_MEDIA_ATTACHMENTS, POST_TYPE_MEDIA_RULES } from "./types.js";
10
- // Utilities (for theme authors)
7
+ export { FORMATS, STATUSES, SORT_ORDERS, NAV_ITEM_TYPES, MAX_MEDIA_ATTACHMENTS, MAX_PINNED_POSTS } from "./types.js";
8
+ // Utilities
11
9
  export * as time from "./lib/time.js";
12
10
  export * as sqid from "./lib/sqid.js";
13
11
  export * as url from "./lib/url.js";
14
12
  export * as markdown from "./lib/markdown.js";
15
- // View Model conversion utilities (for advanced theme use)
16
- export { createMediaContext, toPostView, toPostViews, toMediaView, toNavLinkView, toNavLinkViews, toSearchResultView, toArchiveGroups } from "./lib/view.js";
17
- // Render helper (for theme authors adding custom routes)
18
- export { renderPublicPage } from "./lib/render.js";
19
- // Navigation helper (for theme authors)
20
- export { getNavigationData } from "./lib/navigation.js";
21
- // Default feed renderers (for theme authors to extend)
13
+ // View Model conversion utilities
14
+ export { createMediaContext, toPostView, toPostViews, toMediaView, toPageView, toNavItemView, toNavItemViews, toSearchResultView, toArchiveGroups } from "./lib/view.js";
15
+ // Default feed renderers (for custom feed implementations)
22
16
  export { defaultRssRenderer, defaultAtomRenderer, defaultSitemapRenderer } from "./lib/feed.js";
@@ -4,6 +4,7 @@
4
4
  * Reserved URL paths that cannot be used for pages
5
5
  */ export const RESERVED_PATHS = [
6
6
  "featured",
7
+ "collections",
7
8
  "signin",
8
9
  "signout",
9
10
  "setup",
@@ -12,10 +13,6 @@
12
13
  "feed",
13
14
  "search",
14
15
  "archive",
15
- "notes",
16
- "articles",
17
- "links",
18
- "quotes",
19
16
  "media",
20
17
  "pages",
21
18
  "reset",
@@ -42,6 +39,7 @@
42
39
  SITE_DESCRIPTION: "SITE_DESCRIPTION",
43
40
  SITE_LANGUAGE: "SITE_LANGUAGE",
44
41
  THEME: "THEME",
42
+ CUSTOM_CSS: "CUSTOM_CSS",
45
43
  PASSWORD_RESET_TOKEN: "PASSWORD_RESET_TOKEN"
46
44
  };
47
45
  /**
@@ -0,0 +1,76 @@
1
+ /**
2
+ * HTML Excerpt Utilities
3
+ *
4
+ * Generates paragraph-aware excerpts from HTML content for article
5
+ * previews in timelines. Breaks only at paragraph boundaries.
6
+ */ /**
7
+ * Strips HTML tags from a string, returning plain text.
8
+ *
9
+ * @param html - HTML string to strip
10
+ * @returns Plain text without HTML tags
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * stripHtml("<p>Hello <strong>world</strong></p>") // "Hello world"
15
+ * ```
16
+ */ export function stripHtml(html) {
17
+ return html.replace(/<[^>]*>/g, "");
18
+ }
19
+ /**
20
+ * Extracts a paragraph-aware HTML excerpt from body HTML.
21
+ *
22
+ * Uses a greedy algorithm: accumulates paragraphs until the total
23
+ * plain-text length exceeds 500 characters, then stops. At least
24
+ * one paragraph is always included.
25
+ *
26
+ * If the content contains a `<!--more-->` marker, the content before
27
+ * the marker is used as the excerpt instead.
28
+ *
29
+ * @param bodyHtml - Full HTML body content
30
+ * @returns Excerpt HTML and whether there is more content
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * // Short content — returned as-is with hasMore = false
35
+ * getHtmlExcerpt("<p>Short post.</p>")
36
+ * // { excerpt: "<p>Short post.</p>", hasMore: false }
37
+ *
38
+ * // Long content — truncated at paragraph boundary
39
+ * getHtmlExcerpt("<p>" + "A".repeat(300) + "</p><p>" + "B".repeat(300) + "</p>")
40
+ * // { excerpt: "<p>AAA...</p>", hasMore: true }
41
+ *
42
+ * // Manual break with <!--more-->
43
+ * getHtmlExcerpt("<p>Intro</p><!--more--><p>Rest</p>")
44
+ * // { excerpt: "<p>Intro</p>", hasMore: true }
45
+ * ```
46
+ */ export function getHtmlExcerpt(bodyHtml) {
47
+ // Honor manual <!--more--> marker
48
+ if (bodyHtml.includes("<!--more-->")) {
49
+ const excerpt = bodyHtml.split("<!--more-->")[0];
50
+ return {
51
+ excerpt,
52
+ hasMore: true
53
+ };
54
+ }
55
+ const paragraphs = bodyHtml.match(/<p>[\s\S]*?<\/p>/g) || [];
56
+ // No paragraphs found — return full content
57
+ if (paragraphs.length === 0) {
58
+ return {
59
+ excerpt: bodyHtml,
60
+ hasMore: false
61
+ };
62
+ }
63
+ let excerpt = "";
64
+ let charCount = 0;
65
+ for (const p of paragraphs){
66
+ const textLen = stripHtml(p).length;
67
+ if (charCount + textLen > 500 && excerpt) break;
68
+ excerpt += p;
69
+ charCount += textLen;
70
+ }
71
+ const hasMore = excerpt.length < bodyHtml.length;
72
+ return {
73
+ excerpt,
74
+ hasMore
75
+ };
76
+ }