@jant/core 0.3.24 → 0.3.26
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.
- package/dist/app.js +101 -571
- package/dist/client.js +1 -0
- package/dist/db/schema.js +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/i18n/locales/zh-Hant.js +1 -1
- package/dist/index.js +3 -9
- package/dist/lib/avatar-upload.js +134 -0
- package/dist/lib/config.js +39 -0
- package/dist/lib/constants.js +10 -9
- package/dist/lib/favicon.js +102 -0
- package/dist/lib/image.js +13 -17
- package/dist/lib/media-helpers.js +2 -2
- package/dist/lib/nav-reorder.js +1 -1
- package/dist/lib/navigation.js +48 -3
- package/dist/lib/pagination.js +44 -0
- package/dist/lib/render.js +16 -11
- package/dist/lib/schemas.js +34 -3
- package/dist/lib/theme.js +4 -4
- package/dist/lib/timeline.js +24 -48
- package/dist/lib/timezones.js +388 -0
- package/dist/lib/view.js +3 -3
- package/dist/routes/api/collections.js +124 -0
- package/dist/routes/api/nav-items.js +104 -0
- package/dist/routes/api/pages.js +91 -0
- package/dist/routes/api/posts.js +3 -3
- package/dist/routes/api/search.js +2 -2
- package/dist/routes/api/settings.js +68 -0
- package/dist/routes/api/upload.js +3 -3
- package/dist/routes/auth/reset.js +221 -0
- package/dist/routes/auth/setup.js +194 -0
- package/dist/routes/auth/signin.js +176 -0
- package/dist/routes/compose.js +48 -0
- package/dist/routes/dash/collections.js +24 -416
- package/dist/routes/dash/index.js +1 -1
- package/dist/routes/dash/media.js +13 -393
- package/dist/routes/dash/pages.js +112 -86
- package/dist/routes/dash/posts.js +3 -5
- package/dist/routes/dash/redirects.js +20 -14
- package/dist/routes/dash/settings.js +213 -518
- package/dist/routes/feed/rss.js +4 -3
- package/dist/routes/feed/sitemap.js +5 -3
- package/dist/routes/pages/archive.js +3 -6
- package/dist/routes/pages/collection.js +3 -6
- package/dist/routes/pages/collections.js +28 -0
- package/dist/routes/pages/featured.js +36 -0
- package/dist/routes/pages/home.js +33 -49
- package/dist/routes/pages/latest.js +45 -0
- package/dist/routes/pages/page.js +29 -32
- package/dist/routes/pages/post.js +3 -6
- package/dist/routes/pages/search.js +3 -6
- package/dist/services/page.js +5 -1
- package/dist/services/post.js +45 -31
- package/dist/services/search.js +1 -1
- package/dist/types/bindings.js +3 -0
- package/dist/types/config.js +147 -0
- package/dist/types/constants.js +27 -0
- package/dist/types/entities.js +3 -0
- package/dist/types/operations.js +3 -0
- package/dist/types/props.js +3 -0
- package/dist/types/views.js +5 -0
- package/dist/types.js +8 -111
- package/dist/{theme → ui}/color-themes.js +33 -33
- package/dist/ui/compose/ComposeDialog.js +467 -0
- package/dist/ui/compose/ComposePrompt.js +55 -0
- package/dist/{theme/components/TypeBadge.js → ui/dash/FormatBadge.js} +1 -2
- package/dist/{theme/components → ui/dash}/PageForm.js +21 -15
- package/dist/{theme/components → ui/dash}/PostForm.js +22 -43
- package/dist/{theme/components → ui/dash}/PostList.js +6 -6
- package/dist/{theme/components/VisibilityBadge.js → ui/dash/StatusBadge.js} +1 -2
- package/dist/ui/dash/collections/CollectionForm.js +152 -0
- package/dist/ui/dash/collections/CollectionsListContent.js +68 -0
- package/dist/ui/dash/collections/ViewCollectionContent.js +96 -0
- package/dist/{theme/components → ui/dash}/index.js +3 -6
- package/dist/ui/dash/media/MediaListContent.js +166 -0
- package/dist/ui/dash/media/ViewMediaContent.js +212 -0
- package/dist/ui/dash/pages/LinkFormContent.js +130 -0
- package/dist/ui/dash/pages/UnifiedPagesContent.js +193 -0
- package/dist/ui/dash/settings/AccountContent.js +209 -0
- package/dist/ui/dash/settings/AppearanceContent.js +259 -0
- package/dist/ui/dash/settings/GeneralContent.js +536 -0
- package/dist/ui/dash/settings/SettingsNav.js +41 -0
- package/dist/{themes/threads/timeline → ui/feed}/LinkCard.js +6 -2
- package/dist/{themes/threads/timeline → ui/feed}/NoteCard.js +11 -6
- package/dist/{themes/threads/timeline → ui/feed}/QuoteCard.js +10 -6
- package/dist/{themes/threads/timeline → ui/feed}/ThreadPreview.js +7 -9
- package/dist/ui/feed/TimelineFeed.js +41 -0
- package/dist/ui/feed/TimelineItem.js +27 -0
- package/dist/ui/font-themes.js +36 -0
- package/dist/{theme → ui}/layouts/BaseLayout.js +34 -2
- package/dist/{theme → ui}/layouts/DashLayout.js +0 -8
- package/dist/ui/layouts/SiteLayout.js +169 -0
- package/dist/{themes/threads → ui}/pages/ArchivePage.js +16 -14
- package/dist/{themes/threads → ui}/pages/CollectionPage.js +6 -1
- package/dist/ui/pages/CollectionsPage.js +76 -0
- package/dist/ui/pages/FeaturedPage.js +24 -0
- package/dist/ui/pages/HomePage.js +24 -0
- package/dist/{themes/threads → ui}/pages/PostPage.js +13 -8
- package/dist/{themes/threads → ui}/pages/SearchPage.js +9 -7
- package/dist/{themes/threads → ui}/pages/SinglePage.js +3 -2
- package/dist/{theme/components → ui/shared}/MediaGallery.js +1 -1
- package/dist/{theme/components → ui/shared}/Pagination.js +41 -2
- package/dist/{theme/components → ui/shared}/ThreadView.js +2 -2
- package/dist/ui/shared/index.js +5 -0
- package/package.json +1 -9
- package/src/__tests__/helpers/db.ts +3 -0
- package/src/app.tsx +131 -561
- package/src/client.ts +1 -0
- package/src/db/migrations/0006_rename_slug_to_path.sql +5 -0
- package/src/db/migrations/meta/_journal.json +7 -0
- package/src/db/schema.ts +1 -1
- package/src/i18n/locales/en.po +477 -261
- package/src/i18n/locales/en.ts +1 -1
- package/src/i18n/locales/zh-Hans.po +477 -261
- package/src/i18n/locales/zh-Hans.ts +1 -1
- package/src/i18n/locales/zh-Hant.po +477 -261
- package/src/i18n/locales/zh-Hant.ts +1 -1
- package/src/index.ts +7 -36
- package/src/lib/__tests__/config.test.ts +192 -0
- package/src/lib/__tests__/favicon.test.ts +151 -0
- package/src/lib/__tests__/image.test.ts +2 -6
- package/src/lib/__tests__/schemas.test.ts +60 -19
- package/src/lib/__tests__/timeline.test.ts +45 -81
- package/src/lib/__tests__/timezones.test.ts +61 -0
- package/src/lib/__tests__/view.test.ts +15 -9
- package/src/lib/avatar-upload.ts +165 -0
- package/src/lib/config.ts +47 -0
- package/src/lib/constants.ts +19 -10
- package/src/lib/favicon.ts +115 -0
- package/src/lib/image.ts +13 -21
- package/src/lib/media-helpers.ts +2 -2
- package/src/lib/nav-reorder.ts +1 -1
- package/src/lib/navigation.ts +73 -4
- package/src/lib/pagination.ts +50 -0
- package/src/lib/render.tsx +22 -15
- package/src/lib/schemas.ts +47 -6
- package/src/lib/theme.ts +5 -5
- package/src/lib/timeline.ts +28 -57
- package/src/lib/timezones.ts +325 -0
- package/src/lib/view.ts +3 -3
- package/src/preset.css +2 -1
- package/src/routes/__tests__/compose.test.ts +199 -0
- package/src/routes/api/__tests__/collections.test.ts +249 -0
- package/src/routes/api/__tests__/nav-items.test.ts +222 -0
- package/src/routes/api/__tests__/pages.test.ts +218 -0
- package/src/routes/api/__tests__/settings.test.ts +132 -0
- package/src/routes/api/collections.ts +143 -0
- package/src/routes/api/nav-items.ts +115 -0
- package/src/routes/api/pages.ts +101 -0
- package/src/routes/api/posts.ts +3 -3
- package/src/routes/api/search.ts +2 -2
- package/src/routes/api/settings.ts +91 -0
- package/src/routes/api/upload.ts +2 -3
- package/src/routes/auth/reset.tsx +239 -0
- package/src/routes/auth/setup.tsx +189 -0
- package/src/routes/auth/signin.tsx +163 -0
- package/src/routes/compose.ts +63 -0
- package/src/routes/dash/__tests__/pages.test.ts +225 -0
- package/src/routes/dash/__tests__/settings-avatar.test.ts +89 -0
- package/src/routes/dash/collections.tsx +18 -367
- package/src/routes/dash/index.tsx +1 -1
- package/src/routes/dash/media.tsx +13 -415
- package/src/routes/dash/pages.tsx +131 -98
- package/src/routes/dash/posts.tsx +3 -7
- package/src/routes/dash/redirects.tsx +22 -16
- package/src/routes/dash/settings.tsx +265 -478
- package/src/routes/feed/__tests__/rss.test.ts +141 -0
- package/src/routes/feed/rss.ts +5 -3
- package/src/routes/feed/sitemap.ts +5 -3
- package/src/routes/pages/__tests__/collections.test.ts +94 -0
- package/src/routes/pages/__tests__/featured.test.ts +94 -0
- package/src/routes/pages/archive.tsx +2 -6
- package/src/routes/pages/collection.tsx +2 -6
- package/src/routes/pages/collections.tsx +36 -0
- package/src/routes/pages/featured.tsx +44 -0
- package/src/routes/pages/home.tsx +30 -53
- package/src/routes/pages/latest.tsx +59 -0
- package/src/routes/pages/page.tsx +28 -30
- package/src/routes/pages/post.tsx +2 -5
- package/src/routes/pages/search.tsx +2 -6
- package/src/services/__tests__/page.test.ts +106 -0
- package/src/services/__tests__/post.test.ts +114 -15
- package/src/services/page.ts +13 -1
- package/src/services/post.ts +58 -40
- package/src/services/search.ts +2 -2
- package/src/styles/components.css +0 -65
- package/src/styles/tokens.css +47 -0
- package/src/styles/ui.css +475 -0
- package/src/types/bindings.ts +30 -0
- package/src/types/config.ts +183 -0
- package/src/types/constants.ts +26 -0
- package/src/types/entities.ts +109 -0
- package/src/types/operations.ts +88 -0
- package/src/types/props.ts +115 -0
- package/src/types/views.ts +172 -0
- package/src/types.ts +8 -774
- package/src/ui/__tests__/font-themes.test.ts +34 -0
- package/src/{theme → ui}/color-themes.ts +34 -34
- package/src/ui/compose/ComposeDialog.tsx +414 -0
- package/src/ui/compose/ComposePrompt.tsx +55 -0
- package/src/{theme/components/TypeBadge.tsx → ui/dash/FormatBadge.tsx} +2 -3
- package/src/{theme/components → ui/dash}/PageForm.tsx +25 -19
- package/src/{theme/components → ui/dash}/PostForm.tsx +26 -45
- package/src/{theme/components → ui/dash}/PostList.tsx +7 -7
- package/src/{theme/components/VisibilityBadge.tsx → ui/dash/StatusBadge.tsx} +2 -3
- package/src/ui/dash/collections/CollectionForm.tsx +153 -0
- package/src/ui/dash/collections/CollectionsListContent.tsx +85 -0
- package/src/ui/dash/collections/ViewCollectionContent.tsx +92 -0
- package/src/ui/dash/index.ts +10 -0
- package/src/ui/dash/media/MediaListContent.tsx +201 -0
- package/src/ui/dash/media/ViewMediaContent.tsx +208 -0
- package/src/ui/dash/pages/LinkFormContent.tsx +119 -0
- package/src/ui/dash/pages/UnifiedPagesContent.tsx +203 -0
- package/src/ui/dash/settings/AccountContent.tsx +176 -0
- package/src/ui/dash/settings/AppearanceContent.tsx +254 -0
- package/src/ui/dash/settings/GeneralContent.tsx +533 -0
- package/src/ui/dash/settings/SettingsNav.tsx +56 -0
- package/src/{themes/threads/timeline → ui/feed}/LinkCard.tsx +9 -4
- package/src/{themes/threads/timeline → ui/feed}/NoteCard.tsx +13 -8
- package/src/{themes/threads/timeline → ui/feed}/QuoteCard.tsx +13 -8
- package/src/{themes/threads/timeline → ui/feed}/ThreadPreview.tsx +7 -8
- package/src/ui/feed/TimelineFeed.tsx +49 -0
- package/src/ui/feed/TimelineItem.tsx +45 -0
- package/src/ui/font-themes.ts +54 -0
- package/src/{theme → ui}/layouts/BaseLayout.tsx +28 -1
- package/src/{theme → ui}/layouts/DashLayout.tsx +0 -10
- package/src/ui/layouts/SiteLayout.tsx +164 -0
- package/src/{themes/threads → ui}/pages/ArchivePage.tsx +22 -17
- package/src/{themes/threads → ui}/pages/CollectionPage.tsx +14 -5
- package/src/ui/pages/CollectionsPage.tsx +73 -0
- package/src/ui/pages/FeaturedPage.tsx +31 -0
- package/src/{themes/threads → ui}/pages/HomePage.tsx +11 -15
- package/src/{themes/threads → ui}/pages/PostPage.tsx +23 -14
- package/src/{themes/threads → ui}/pages/SearchPage.tsx +13 -11
- package/src/{themes/threads → ui}/pages/SinglePage.tsx +4 -4
- package/src/{theme/components → ui/shared}/MediaGallery.tsx +1 -1
- package/src/{theme/components → ui/shared}/Pagination.tsx +67 -4
- package/src/{theme/components → ui/shared}/ThreadView.tsx +2 -2
- package/src/ui/shared/__tests__/pagination.test.ts +46 -0
- package/src/ui/shared/index.ts +12 -0
- package/bin/jant.js +0 -185
- package/dist/lib/theme-components.js +0 -46
- package/dist/routes/dash/navigation.js +0 -289
- package/dist/theme/index.js +0 -18
- package/dist/theme/layouts/index.js +0 -2
- package/dist/themes/threads/ThreadsSiteLayout.js +0 -172
- package/dist/themes/threads/index.js +0 -81
- package/dist/themes/threads/pages/HomePage.js +0 -25
- package/dist/themes/threads/timeline/TimelineFeed.js +0 -58
- package/dist/themes/threads/timeline/TimelineItem.js +0 -36
- package/dist/themes/threads/timeline/TimelineLoadMore.js +0 -23
- package/dist/themes/threads/timeline/groupByDate.js +0 -22
- package/dist/themes/threads/timeline/timelineMore.js +0 -107
- package/src/lib/__tests__/theme-components.test.ts +0 -105
- package/src/lib/theme-components.ts +0 -65
- package/src/routes/dash/navigation.tsx +0 -317
- package/src/theme/components/index.ts +0 -23
- package/src/theme/index.ts +0 -22
- package/src/theme/layouts/index.ts +0 -7
- package/src/themes/threads/ThreadsSiteLayout.tsx +0 -194
- package/src/themes/threads/index.ts +0 -100
- package/src/themes/threads/style.css +0 -336
- package/src/themes/threads/timeline/TimelineFeed.tsx +0 -62
- package/src/themes/threads/timeline/TimelineItem.tsx +0 -67
- package/src/themes/threads/timeline/TimelineLoadMore.tsx +0 -35
- package/src/themes/threads/timeline/groupByDate.ts +0 -30
- package/src/themes/threads/timeline/timelineMore.tsx +0 -130
- /package/dist/{theme/components → ui/dash}/ActionButtons.js +0 -0
- /package/dist/{theme/components → ui/dash}/CrudPageHeader.js +0 -0
- /package/dist/{theme/components → ui/dash}/DangerZone.js +0 -0
- /package/dist/{theme/components → ui/dash}/ListItemRow.js +0 -0
- /package/dist/{theme/components → ui/shared}/EmptyState.js +0 -0
- /package/src/{theme/components → ui/dash}/ActionButtons.tsx +0 -0
- /package/src/{theme/components → ui/dash}/CrudPageHeader.tsx +0 -0
- /package/src/{theme/components → ui/dash}/DangerZone.tsx +0 -0
- /package/src/{theme/components → ui/dash}/ListItemRow.tsx +0 -0
- /package/src/{theme/components → ui/shared}/EmptyState.tsx +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Note Card
|
|
3
3
|
*
|
|
4
|
-
* Without title: plain text note
|
|
4
|
+
* Without title: plain text note with full date in footer.
|
|
5
5
|
* With title: article-style rendering with summary excerpt and "Read more" link.
|
|
6
6
|
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
7
|
-
import { MediaGallery } from "
|
|
7
|
+
import { MediaGallery } from "../shared/MediaGallery.js";
|
|
8
8
|
export const NoteCard = ({ post, compact })=>{
|
|
9
9
|
const isArticle = !!post.title;
|
|
10
10
|
const displayHtml = isArticle ? post.summaryHtml : post.bodyHtml;
|
|
11
11
|
return /*#__PURE__*/ _jsxs("article", {
|
|
12
|
-
class: `h-entry${compact ? "
|
|
12
|
+
class: `h-entry${compact ? " feed-compact" : ""}`,
|
|
13
|
+
"data-post": true,
|
|
14
|
+
"data-format": "note",
|
|
13
15
|
children: [
|
|
14
16
|
isArticle && /*#__PURE__*/ _jsx("h2", {
|
|
15
17
|
class: `p-name font-semibold ${compact ? "text-sm" : "text-base"} mb-1`,
|
|
@@ -21,12 +23,14 @@ export const NoteCard = ({ post, compact })=>{
|
|
|
21
23
|
}),
|
|
22
24
|
displayHtml && /*#__PURE__*/ _jsx("div", {
|
|
23
25
|
class: `e-content prose ${compact ? "prose-sm" : isArticle ? "text-muted-foreground" : ""}`,
|
|
26
|
+
"data-post-body": true,
|
|
24
27
|
dangerouslySetInnerHTML: {
|
|
25
28
|
__html: displayHtml
|
|
26
29
|
}
|
|
27
30
|
}),
|
|
28
31
|
!compact && post.media.length > 0 && /*#__PURE__*/ _jsx("div", {
|
|
29
|
-
class: "
|
|
32
|
+
class: "mt-3",
|
|
33
|
+
"data-post-media": true,
|
|
30
34
|
children: /*#__PURE__*/ _jsx(MediaGallery, {
|
|
31
35
|
attachments: post.media
|
|
32
36
|
})
|
|
@@ -38,13 +42,14 @@ export const NoteCard = ({ post, compact })=>{
|
|
|
38
42
|
}),
|
|
39
43
|
/*#__PURE__*/ _jsx("footer", {
|
|
40
44
|
class: "mt-2",
|
|
45
|
+
"data-post-meta": true,
|
|
41
46
|
children: /*#__PURE__*/ _jsx("a", {
|
|
42
47
|
href: post.permalink,
|
|
43
48
|
class: "u-url text-xs text-muted-foreground hover:underline",
|
|
44
49
|
children: /*#__PURE__*/ _jsx("time", {
|
|
45
50
|
class: "dt-published",
|
|
46
51
|
datetime: post.publishedAt,
|
|
47
|
-
children: post.
|
|
52
|
+
children: post.publishedAtFormatted
|
|
48
53
|
})
|
|
49
54
|
})
|
|
50
55
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Quote Card
|
|
3
3
|
*
|
|
4
|
-
* Left-border accent blockquote
|
|
4
|
+
* Left-border accent blockquote with full date in footer.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Fields:
|
|
7
7
|
* - quoteText: the quoted text
|
|
8
8
|
* - title: attribution (who said it)
|
|
9
9
|
* - url: source link
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
12
12
|
export const QuoteCard = ({ post, compact })=>{
|
|
13
13
|
return /*#__PURE__*/ _jsxs("article", {
|
|
14
|
-
class: `h-entry${compact ? "
|
|
14
|
+
class: `h-entry${compact ? " feed-compact" : ""}`,
|
|
15
|
+
"data-post": true,
|
|
16
|
+
"data-format": "quote",
|
|
15
17
|
children: [
|
|
16
18
|
post.quoteText && /*#__PURE__*/ _jsx("blockquote", {
|
|
17
|
-
class: "
|
|
19
|
+
class: "feed-quote",
|
|
18
20
|
children: /*#__PURE__*/ _jsx("div", {
|
|
19
21
|
class: `e-content ${compact ? "text-sm" : "text-base"} leading-relaxed`,
|
|
20
22
|
children: post.quoteText
|
|
@@ -38,19 +40,21 @@ export const QuoteCard = ({ post, compact })=>{
|
|
|
38
40
|
}),
|
|
39
41
|
!compact && post.bodyHtml && /*#__PURE__*/ _jsx("div", {
|
|
40
42
|
class: "mt-3 prose text-muted-foreground",
|
|
43
|
+
"data-post-body": true,
|
|
41
44
|
dangerouslySetInnerHTML: {
|
|
42
45
|
__html: post.bodyHtml
|
|
43
46
|
}
|
|
44
47
|
}),
|
|
45
48
|
/*#__PURE__*/ _jsx("footer", {
|
|
46
49
|
class: "mt-2",
|
|
50
|
+
"data-post-meta": true,
|
|
47
51
|
children: /*#__PURE__*/ _jsx("a", {
|
|
48
52
|
href: post.permalink,
|
|
49
53
|
class: "u-url text-xs text-muted-foreground hover:underline",
|
|
50
54
|
children: /*#__PURE__*/ _jsx("time", {
|
|
51
55
|
class: "dt-published",
|
|
52
56
|
datetime: post.publishedAt,
|
|
53
|
-
children: post.
|
|
57
|
+
children: post.publishedAtFormatted
|
|
54
58
|
})
|
|
55
59
|
})
|
|
56
60
|
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Thread Preview
|
|
3
3
|
*
|
|
4
4
|
* Root post + vertical line connector + compact replies underneath.
|
|
5
5
|
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
6
|
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
7
|
import { TimelineItem } from "./TimelineItem.js";
|
|
8
8
|
import { TimelineItemFromPost } from "./TimelineItem.js";
|
|
9
|
-
export const ThreadPreview = ({ rootPost, previewReplies, totalReplyCount
|
|
9
|
+
export const ThreadPreview = ({ rootPost, previewReplies, totalReplyCount })=>{
|
|
10
10
|
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
11
11
|
const remainingCount = totalReplyCount - previewReplies.length;
|
|
12
12
|
return /*#__PURE__*/ _jsxs("div", {
|
|
@@ -14,22 +14,20 @@ export const ThreadPreview = ({ rootPost, previewReplies, totalReplyCount, theme
|
|
|
14
14
|
/*#__PURE__*/ _jsx(TimelineItem, {
|
|
15
15
|
item: {
|
|
16
16
|
post: rootPost
|
|
17
|
-
}
|
|
18
|
-
theme: theme
|
|
17
|
+
}
|
|
19
18
|
}),
|
|
20
19
|
previewReplies.length > 0 && /*#__PURE__*/ _jsxs("div", {
|
|
21
|
-
class: "
|
|
20
|
+
class: "feed-replies",
|
|
22
21
|
children: [
|
|
23
22
|
previewReplies.map((reply)=>/*#__PURE__*/ _jsx("div", {
|
|
24
|
-
class: "
|
|
23
|
+
class: "feed-reply",
|
|
25
24
|
children: /*#__PURE__*/ _jsx(TimelineItemFromPost, {
|
|
26
25
|
post: reply,
|
|
27
|
-
compact: true
|
|
28
|
-
theme: theme
|
|
26
|
+
compact: true
|
|
29
27
|
})
|
|
30
28
|
}, reply.id)),
|
|
31
29
|
remainingCount > 0 && /*#__PURE__*/ _jsx("div", {
|
|
32
|
-
class: "
|
|
30
|
+
class: "feed-reply",
|
|
33
31
|
children: /*#__PURE__*/ _jsx("a", {
|
|
34
32
|
href: rootPost.permalink,
|
|
35
33
|
class: "text-sm text-muted-foreground hover:text-foreground hover:underline",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeline Feed
|
|
3
|
+
*
|
|
4
|
+
* Flat list of posts separated by simple dividers.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { TimelineItem } from "./TimelineItem.js";
|
|
7
|
+
import { ThreadPreview } from "./ThreadPreview.js";
|
|
8
|
+
import { PagePagination } from "../shared/Pagination.js";
|
|
9
|
+
export const TimelineFeed = ({ items, currentPage, totalPages })=>{
|
|
10
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
11
|
+
"data-feed": true,
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ _jsx("div", {
|
|
14
|
+
id: "timeline-feed",
|
|
15
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
16
|
+
id: "timeline-items",
|
|
17
|
+
class: "flex flex-col",
|
|
18
|
+
children: items.map((item, i)=>/*#__PURE__*/ _jsxs("div", {
|
|
19
|
+
children: [
|
|
20
|
+
i > 0 && /*#__PURE__*/ _jsx("hr", {
|
|
21
|
+
class: "feed-divider"
|
|
22
|
+
}),
|
|
23
|
+
item.threadPreview ? /*#__PURE__*/ _jsx(ThreadPreview, {
|
|
24
|
+
rootPost: item.post,
|
|
25
|
+
previewReplies: item.threadPreview.replies,
|
|
26
|
+
totalReplyCount: item.threadPreview.totalReplyCount
|
|
27
|
+
}) : /*#__PURE__*/ _jsx(TimelineItem, {
|
|
28
|
+
item: item
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
}, item.post.id))
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
currentPage !== undefined && totalPages !== undefined && totalPages > 1 && /*#__PURE__*/ _jsx(PagePagination, {
|
|
35
|
+
baseUrl: "/",
|
|
36
|
+
currentPage: currentPage,
|
|
37
|
+
totalPages: totalPages
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeline Item
|
|
3
|
+
*
|
|
4
|
+
* Dispatches to the correct card component based on post format.
|
|
5
|
+
*/ import { jsx as _jsx } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { NoteCard } from "./NoteCard.js";
|
|
7
|
+
import { LinkCard } from "./LinkCard.js";
|
|
8
|
+
import { QuoteCard } from "./QuoteCard.js";
|
|
9
|
+
const CARD_MAP = {
|
|
10
|
+
note: NoteCard,
|
|
11
|
+
link: LinkCard,
|
|
12
|
+
quote: QuoteCard
|
|
13
|
+
};
|
|
14
|
+
export const TimelineItem = ({ item, compact })=>{
|
|
15
|
+
const Card = CARD_MAP[item.post.format];
|
|
16
|
+
return /*#__PURE__*/ _jsx(Card, {
|
|
17
|
+
post: item.post,
|
|
18
|
+
compact: compact
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export const TimelineItemFromPost = ({ post, compact })=>{
|
|
22
|
+
const Card = CARD_MAP[post.format];
|
|
23
|
+
return /*#__PURE__*/ _jsx(Card, {
|
|
24
|
+
post: post,
|
|
25
|
+
compact: compact
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Font Themes
|
|
3
|
+
*
|
|
4
|
+
* System-font-only presets — no external font loading required.
|
|
5
|
+
*/ /**
|
|
6
|
+
* A font theme definition with display metadata.
|
|
7
|
+
*/ export const BUILTIN_FONT_THEMES = [
|
|
8
|
+
{
|
|
9
|
+
id: "default",
|
|
10
|
+
name: "System Default",
|
|
11
|
+
// 现代系统字体栈:先英文,后 Mac/iOS 中文,再 Win 中文
|
|
12
|
+
fontFamily: 'system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans CN", sans-serif',
|
|
13
|
+
description: "与你的操作系统保持一致,最稳定的阅读体验"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "serif",
|
|
17
|
+
name: "Classic Serif",
|
|
18
|
+
// Charter 是 Apple 系统自带的极品衬线体
|
|
19
|
+
fontFamily: 'Charter, "Bitstream Charter", "Sitka Text", Georgia, "Songti SC", "Source Han Serif CN", "STSong", "SimSun", serif',
|
|
20
|
+
description: "传统的衬线体,适合深度长文阅读"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "humanist",
|
|
24
|
+
name: "Humanist",
|
|
25
|
+
// Optima 具有书法韵味,Candara 是 Windows 上的优质人文体
|
|
26
|
+
fontFamily: 'Optima, Candara, "Noto Sans", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',
|
|
27
|
+
description: "温润如玉的字体风格,兼具现代感与书法美感"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "mono",
|
|
31
|
+
name: "Monospace",
|
|
32
|
+
// 优先使用 JetBrains Mono 或 SF Mono
|
|
33
|
+
fontFamily: '"JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "PingFang SC", "Microsoft YaHei", monospace',
|
|
34
|
+
description: "等宽字体,适合技术内容或代码展示"
|
|
35
|
+
}
|
|
36
|
+
];
|
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
* If Context is provided, automatically wraps children with I18nProvider.
|
|
6
6
|
*
|
|
7
7
|
* Uses vite-ssr-components for automatic dev/prod asset path resolution.
|
|
8
|
-
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
8
|
+
*/ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "hono/jsx/jsx-runtime";
|
|
9
9
|
import { Script, Link, ViteClient } from "vite-ssr-components/hono";
|
|
10
10
|
import { I18nProvider } from "../../i18n/index.js";
|
|
11
|
-
export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
11
|
+
export const BaseLayout = ({ title, description, lang, c, toast, faviconUrl, noindex, children })=>{
|
|
12
12
|
// Read lang from Hono context if available, otherwise use prop or default
|
|
13
13
|
const resolvedLang = lang ?? (c ? c.get("lang") : "en");
|
|
14
|
+
// Read faviconUrl from context when not provided as prop (fixes dashboard favicon)
|
|
15
|
+
const resolvedFaviconUrl = faviconUrl ?? (c ? c.get("faviconUrl") : undefined);
|
|
16
|
+
// Read noindex from context when not provided as prop
|
|
17
|
+
const resolvedNoindex = noindex ?? (c ? c.get("noindex") : undefined);
|
|
14
18
|
// Automatically wrap with I18nProvider if Context is provided
|
|
15
19
|
const content = c ? /*#__PURE__*/ _jsx(I18nProvider, {
|
|
16
20
|
c: c,
|
|
@@ -18,6 +22,10 @@ export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
|
18
22
|
}) : children;
|
|
19
23
|
// Read theme style from Hono context if available
|
|
20
24
|
const themeStyle = c ? c.get("themeStyle") : undefined;
|
|
25
|
+
// Read custom CSS from Hono context if available
|
|
26
|
+
const customCSS = c ? c.get("customCSS") : undefined;
|
|
27
|
+
// Check authentication status for data attribute
|
|
28
|
+
const isAuthenticated = c ? c.get("isAuthenticated") : false;
|
|
21
29
|
return /*#__PURE__*/ _jsxs("html", {
|
|
22
30
|
lang: resolvedLang,
|
|
23
31
|
children: [
|
|
@@ -37,6 +45,24 @@ export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
|
37
45
|
name: "description",
|
|
38
46
|
content: description
|
|
39
47
|
}),
|
|
48
|
+
resolvedNoindex && /*#__PURE__*/ _jsx("meta", {
|
|
49
|
+
name: "robots",
|
|
50
|
+
content: "noindex, nofollow"
|
|
51
|
+
}),
|
|
52
|
+
resolvedFaviconUrl && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
53
|
+
children: [
|
|
54
|
+
/*#__PURE__*/ _jsx("link", {
|
|
55
|
+
rel: "icon",
|
|
56
|
+
href: "/favicon.ico",
|
|
57
|
+
sizes: "16x16 32x32"
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ _jsx("link", {
|
|
60
|
+
rel: "apple-touch-icon",
|
|
61
|
+
href: "/apple-touch-icon.png",
|
|
62
|
+
sizes: "180x180"
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}),
|
|
40
66
|
/*#__PURE__*/ _jsx(ViteClient, {}),
|
|
41
67
|
/*#__PURE__*/ _jsx(Link, {
|
|
42
68
|
href: "/src/style.css",
|
|
@@ -45,6 +71,9 @@ export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
|
45
71
|
themeStyle && /*#__PURE__*/ _jsx("style", {
|
|
46
72
|
children: themeStyle
|
|
47
73
|
}),
|
|
74
|
+
customCSS && /*#__PURE__*/ _jsx("style", {
|
|
75
|
+
children: customCSS
|
|
76
|
+
}),
|
|
48
77
|
/*#__PURE__*/ _jsx(Script, {
|
|
49
78
|
src: "/src/client.ts"
|
|
50
79
|
})
|
|
@@ -52,6 +81,9 @@ export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
|
52
81
|
}),
|
|
53
82
|
/*#__PURE__*/ _jsxs("body", {
|
|
54
83
|
class: "bg-background text-foreground antialiased",
|
|
84
|
+
...isAuthenticated ? {
|
|
85
|
+
"data-authenticated": true
|
|
86
|
+
} : {},
|
|
55
87
|
children: [
|
|
56
88
|
content,
|
|
57
89
|
/*#__PURE__*/ _jsx("div", {
|
|
@@ -107,14 +107,6 @@ function DashLayoutContent({ siteName, currentPath, children }) {
|
|
|
107
107
|
message: "Redirects"
|
|
108
108
|
})
|
|
109
109
|
}),
|
|
110
|
-
/*#__PURE__*/ _jsx("a", {
|
|
111
|
-
href: "/dash/navigation",
|
|
112
|
-
class: navClass("/dash/navigation", /^\/dash\/navigation/),
|
|
113
|
-
children: $__i18n._({
|
|
114
|
-
id: "UxKoFf",
|
|
115
|
-
message: "Navigation"
|
|
116
|
-
})
|
|
117
|
-
}),
|
|
118
110
|
/*#__PURE__*/ _jsx("a", {
|
|
119
111
|
href: "/dash/settings",
|
|
120
112
|
class: navClass("/dash/settings", /^\/dash\/settings/),
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site Layout
|
|
3
|
+
*
|
|
4
|
+
* Vertical header: site name on top, custom nav links below, description under nav.
|
|
5
|
+
* Content area with browse filter tabs and compose prompt/dialog for authenticated users.
|
|
6
|
+
*/ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "hono/jsx/jsx-runtime";
|
|
7
|
+
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
8
|
+
import { ComposeDialog } from "../compose/ComposeDialog.js";
|
|
9
|
+
import { ComposePrompt } from "../compose/ComposePrompt.js";
|
|
10
|
+
function HeaderLink({ link }) {
|
|
11
|
+
return /*#__PURE__*/ _jsx("a", {
|
|
12
|
+
href: link.url,
|
|
13
|
+
class: `site-header-link ${link.isActive ? "site-header-link-active" : ""}`,
|
|
14
|
+
...link.isExternal ? {
|
|
15
|
+
target: "_blank",
|
|
16
|
+
rel: "noopener noreferrer"
|
|
17
|
+
} : {},
|
|
18
|
+
children: link.label
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export const SiteLayout = ({ siteName, siteDescription, links, currentPath, isAuthenticated, collections, homeDefaultView, siteAvatarUrl, showHeaderAvatar, siteFooterHtml, children })=>{
|
|
22
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
23
|
+
const latestHref = homeDefaultView === "featured" ? "/latest" : "/";
|
|
24
|
+
const featuredHref = homeDefaultView === "featured" ? "/" : "/featured";
|
|
25
|
+
const latestLink = {
|
|
26
|
+
href: latestHref,
|
|
27
|
+
label: $__i18n._({
|
|
28
|
+
id: "wL3cK8",
|
|
29
|
+
message: "Latest"
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
const featuredLink = {
|
|
33
|
+
href: featuredHref,
|
|
34
|
+
label: $__i18n._({
|
|
35
|
+
id: "FkMol5",
|
|
36
|
+
message: "Featured"
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
// Default view tab comes first
|
|
40
|
+
const browseLinks = homeDefaultView === "featured" ? [
|
|
41
|
+
featuredLink,
|
|
42
|
+
latestLink
|
|
43
|
+
] : [
|
|
44
|
+
latestLink,
|
|
45
|
+
featuredLink
|
|
46
|
+
];
|
|
47
|
+
const searchLabel = $__i18n._({
|
|
48
|
+
id: "A1taO8",
|
|
49
|
+
message: "Search"
|
|
50
|
+
});
|
|
51
|
+
const isHomePage = currentPath === "/" || currentPath === "/featured" || currentPath === "/latest";
|
|
52
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
53
|
+
class: "site-page",
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ _jsx("header", {
|
|
56
|
+
class: "site-header",
|
|
57
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
58
|
+
class: "site-header-inner",
|
|
59
|
+
children: [
|
|
60
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
61
|
+
class: "site-header-top site-header-top-bordered",
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ _jsxs("a", {
|
|
64
|
+
href: "/",
|
|
65
|
+
class: "site-logo",
|
|
66
|
+
children: [
|
|
67
|
+
showHeaderAvatar && siteAvatarUrl && /*#__PURE__*/ _jsx("img", {
|
|
68
|
+
src: siteAvatarUrl,
|
|
69
|
+
class: "site-logo-avatar",
|
|
70
|
+
alt: ""
|
|
71
|
+
}),
|
|
72
|
+
siteName
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
76
|
+
class: "site-header-right",
|
|
77
|
+
children: [
|
|
78
|
+
links.length > 0 && /*#__PURE__*/ _jsx("nav", {
|
|
79
|
+
class: "site-header-nav",
|
|
80
|
+
children: links.map((link)=>/*#__PURE__*/ _jsx(HeaderLink, {
|
|
81
|
+
link: link
|
|
82
|
+
}, link.id))
|
|
83
|
+
}),
|
|
84
|
+
/*#__PURE__*/ _jsx("a", {
|
|
85
|
+
href: "/search",
|
|
86
|
+
class: `site-header-search ${currentPath === "/search" ? "site-header-search-active" : ""}`,
|
|
87
|
+
"aria-label": searchLabel,
|
|
88
|
+
title: searchLabel,
|
|
89
|
+
children: /*#__PURE__*/ _jsxs("svg", {
|
|
90
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
91
|
+
width: "16",
|
|
92
|
+
height: "16",
|
|
93
|
+
viewBox: "0 0 24 24",
|
|
94
|
+
fill: "none",
|
|
95
|
+
stroke: "currentColor",
|
|
96
|
+
"stroke-width": "2",
|
|
97
|
+
"stroke-linecap": "round",
|
|
98
|
+
"stroke-linejoin": "round",
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ _jsx("circle", {
|
|
101
|
+
cx: "11",
|
|
102
|
+
cy: "11",
|
|
103
|
+
r: "8"
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ _jsx("path", {
|
|
106
|
+
d: "m21 21-4.35-4.35"
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}),
|
|
115
|
+
isHomePage && siteDescription && /*#__PURE__*/ _jsx("p", {
|
|
116
|
+
class: "site-description",
|
|
117
|
+
children: siteDescription
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/*#__PURE__*/ _jsx("main", {
|
|
123
|
+
class: "site-main",
|
|
124
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
125
|
+
class: "site-container",
|
|
126
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
127
|
+
class: "site-content",
|
|
128
|
+
children: [
|
|
129
|
+
isHomePage && /*#__PURE__*/ _jsx("nav", {
|
|
130
|
+
class: "site-browse-nav",
|
|
131
|
+
children: browseLinks.map((link, i)=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
132
|
+
children: [
|
|
133
|
+
i > 0 && /*#__PURE__*/ _jsx("span", {
|
|
134
|
+
class: "site-browse-sep",
|
|
135
|
+
children: "/"
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ _jsx("a", {
|
|
138
|
+
href: link.href,
|
|
139
|
+
class: `site-browse-link ${currentPath === link.href ? "site-browse-link-active" : ""}`,
|
|
140
|
+
children: link.label
|
|
141
|
+
}, link.href)
|
|
142
|
+
]
|
|
143
|
+
}))
|
|
144
|
+
}),
|
|
145
|
+
isHomePage && isAuthenticated && /*#__PURE__*/ _jsx(ComposePrompt, {}),
|
|
146
|
+
children
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
}),
|
|
151
|
+
siteFooterHtml && /*#__PURE__*/ _jsx("footer", {
|
|
152
|
+
class: "site-footer",
|
|
153
|
+
"data-footer": true,
|
|
154
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
155
|
+
class: "site-container",
|
|
156
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
157
|
+
class: "prose",
|
|
158
|
+
dangerouslySetInnerHTML: {
|
|
159
|
+
__html: siteFooterHtml
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
}),
|
|
164
|
+
isAuthenticated && /*#__PURE__*/ _jsx(ComposeDialog, {
|
|
165
|
+
collections: collections
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Archive Page
|
|
3
3
|
*
|
|
4
4
|
* Posts grouped by year-month with format filter and cursor pagination.
|
|
5
5
|
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
6
|
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
|
-
import { FORMATS } from "
|
|
8
|
-
import { Pagination
|
|
7
|
+
import { FORMATS } from "../../types.js";
|
|
8
|
+
import { Pagination } from "../shared/Pagination.js";
|
|
9
9
|
function getFormatLabel(format) {
|
|
10
10
|
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
11
11
|
const labels = {
|
|
@@ -40,17 +40,17 @@ function getFormatLabelPlural(format) {
|
|
|
40
40
|
message: "Quotes"
|
|
41
41
|
})
|
|
42
42
|
};
|
|
43
|
-
return labels[format] ??
|
|
43
|
+
return labels[format] ?? format + "s";
|
|
44
44
|
}
|
|
45
|
-
export const ArchivePage = ({ groups, hasMore, nextCursor, format, featured
|
|
45
|
+
export const ArchivePage = ({ groups, hasMore, nextCursor, format, featured })=>{
|
|
46
46
|
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
47
47
|
const title = format ? getFormatLabelPlural(format) : $__i18n._({
|
|
48
48
|
id: "B495Gs",
|
|
49
49
|
message: "Archive"
|
|
50
50
|
});
|
|
51
|
-
const PaginationComponent = theme?.Pagination ?? DefaultPagination;
|
|
52
51
|
return /*#__PURE__*/ _jsxs("div", {
|
|
53
52
|
class: "py-6",
|
|
53
|
+
"data-page": "archive",
|
|
54
54
|
children: [
|
|
55
55
|
/*#__PURE__*/ _jsxs("header", {
|
|
56
56
|
class: "mb-8",
|
|
@@ -64,20 +64,20 @@ export const ArchivePage = ({ groups, hasMore, nextCursor, format, featured, the
|
|
|
64
64
|
children: [
|
|
65
65
|
/*#__PURE__*/ _jsx("a", {
|
|
66
66
|
href: "/archive",
|
|
67
|
-
class:
|
|
67
|
+
class: "badge " + (!format && !featured ? "badge-primary" : "badge-outline"),
|
|
68
68
|
children: $__i18n._({
|
|
69
69
|
id: "N40H+G",
|
|
70
70
|
message: "All"
|
|
71
71
|
})
|
|
72
72
|
}),
|
|
73
73
|
FORMATS.map((formatKey)=>/*#__PURE__*/ _jsx("a", {
|
|
74
|
-
href:
|
|
75
|
-
class:
|
|
74
|
+
href: "/archive?format=" + formatKey,
|
|
75
|
+
class: "badge " + (format === formatKey ? "badge-primary" : "badge-outline"),
|
|
76
76
|
children: getFormatLabelPlural(formatKey)
|
|
77
77
|
}, formatKey)),
|
|
78
78
|
/*#__PURE__*/ _jsx("a", {
|
|
79
79
|
href: "/archive?featured=true",
|
|
80
|
-
class:
|
|
80
|
+
class: "badge " + (featured ? "badge-primary" : "badge-outline"),
|
|
81
81
|
children: $__i18n._({
|
|
82
82
|
id: "FkMol5",
|
|
83
83
|
message: "Featured"
|
|
@@ -105,6 +105,8 @@ export const ArchivePage = ({ groups, hasMore, nextCursor, format, featured, the
|
|
|
105
105
|
class: "divide-y divide-border",
|
|
106
106
|
children: group.posts.map((post)=>/*#__PURE__*/ _jsxs("article", {
|
|
107
107
|
class: "flex items-baseline gap-4 py-2.5",
|
|
108
|
+
"data-post": true,
|
|
109
|
+
"data-format": post.format,
|
|
108
110
|
children: [
|
|
109
111
|
/*#__PURE__*/ _jsx("time", {
|
|
110
112
|
class: "text-sm text-muted-foreground w-12 shrink-0",
|
|
@@ -117,7 +119,7 @@ export const ArchivePage = ({ groups, hasMore, nextCursor, format, featured, the
|
|
|
117
119
|
/*#__PURE__*/ _jsx("a", {
|
|
118
120
|
href: post.permalink,
|
|
119
121
|
class: "hover:underline",
|
|
120
|
-
children: post.title || post.excerpt?.slice(0, 80) ||
|
|
122
|
+
children: post.title || post.excerpt?.slice(0, 80) || "Post #" + post.id
|
|
121
123
|
}),
|
|
122
124
|
!format && /*#__PURE__*/ _jsx("span", {
|
|
123
125
|
class: "ml-2 badge-outline text-xs",
|
|
@@ -129,10 +131,10 @@ export const ArchivePage = ({ groups, hasMore, nextCursor, format, featured, the
|
|
|
129
131
|
}, post.id))
|
|
130
132
|
})
|
|
131
133
|
]
|
|
132
|
-
},
|
|
134
|
+
}, group.year + "-" + group.month))
|
|
133
135
|
}),
|
|
134
|
-
/*#__PURE__*/ _jsx(
|
|
135
|
-
baseUrl: format ?
|
|
136
|
+
/*#__PURE__*/ _jsx(Pagination, {
|
|
137
|
+
baseUrl: format ? "/archive?format=" + format : featured ? "/archive?featured=true" : "/archive",
|
|
136
138
|
hasMore: hasMore,
|
|
137
139
|
nextCursor: nextCursor
|
|
138
140
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Collection Page
|
|
3
3
|
*
|
|
4
4
|
* Collection header with divider-separated post list.
|
|
5
5
|
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
@@ -8,6 +8,7 @@ export const CollectionPage = ({ collection, posts })=>{
|
|
|
8
8
|
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
9
9
|
return /*#__PURE__*/ _jsxs("div", {
|
|
10
10
|
class: "py-6",
|
|
11
|
+
"data-page": "collection",
|
|
11
12
|
children: [
|
|
12
13
|
/*#__PURE__*/ _jsxs("header", {
|
|
13
14
|
class: "mb-8",
|
|
@@ -33,6 +34,8 @@ export const CollectionPage = ({ collection, posts })=>{
|
|
|
33
34
|
class: "divide-y divide-border",
|
|
34
35
|
children: posts.map((post)=>/*#__PURE__*/ _jsxs("article", {
|
|
35
36
|
class: "h-entry py-4",
|
|
37
|
+
"data-post": true,
|
|
38
|
+
"data-format": post.format,
|
|
36
39
|
children: [
|
|
37
40
|
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
38
41
|
class: "p-name text-lg font-medium mb-2",
|
|
@@ -44,12 +47,14 @@ export const CollectionPage = ({ collection, posts })=>{
|
|
|
44
47
|
}),
|
|
45
48
|
/*#__PURE__*/ _jsx("div", {
|
|
46
49
|
class: "e-content prose prose-sm",
|
|
50
|
+
"data-post-body": true,
|
|
47
51
|
dangerouslySetInnerHTML: {
|
|
48
52
|
__html: post.bodyHtml || ""
|
|
49
53
|
}
|
|
50
54
|
}),
|
|
51
55
|
/*#__PURE__*/ _jsx("footer", {
|
|
52
56
|
class: "mt-2 text-sm text-muted-foreground",
|
|
57
|
+
"data-post-meta": true,
|
|
53
58
|
children: /*#__PURE__*/ _jsx("time", {
|
|
54
59
|
class: "dt-published",
|
|
55
60
|
datetime: post.publishedAt,
|