@jant/core 0.3.21 → 0.3.23
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 +23 -4
- package/dist/index.js +11 -4
- package/dist/lib/feed.js +112 -0
- package/dist/lib/navigation.js +9 -9
- package/dist/lib/render.js +48 -0
- package/dist/lib/theme-components.js +18 -18
- package/dist/lib/view.js +228 -0
- package/dist/routes/api/timeline.js +22 -18
- package/dist/routes/feed/rss.js +34 -78
- package/dist/routes/feed/sitemap.js +11 -26
- package/dist/routes/pages/archive.js +18 -195
- package/dist/routes/pages/collection.js +16 -70
- package/dist/routes/pages/home.js +25 -47
- package/dist/routes/pages/page.js +15 -27
- package/dist/routes/pages/post.js +25 -79
- package/dist/routes/pages/search.js +20 -130
- package/dist/theme/components/MediaGallery.js +10 -10
- package/dist/theme/components/index.js +0 -2
- package/dist/theme/index.js +10 -13
- package/dist/theme/layouts/index.js +0 -1
- package/dist/themes/minimal/MinimalSiteLayout.js +83 -0
- package/dist/themes/minimal/index.js +65 -0
- package/dist/themes/minimal/pages/ArchivePage.js +156 -0
- package/dist/themes/minimal/pages/CollectionPage.js +65 -0
- package/dist/themes/minimal/pages/HomePage.js +25 -0
- package/dist/themes/minimal/pages/PostPage.js +47 -0
- package/dist/themes/minimal/pages/SearchPage.js +121 -0
- package/dist/themes/minimal/pages/SinglePage.js +22 -0
- package/dist/themes/minimal/timeline/ArticleCard.js +36 -0
- package/dist/themes/minimal/timeline/ImageCard.js +67 -0
- package/dist/themes/minimal/timeline/LinkCard.js +47 -0
- package/dist/themes/minimal/timeline/NoteCard.js +34 -0
- package/dist/{theme/components → themes/minimal}/timeline/QuoteCard.js +9 -12
- package/dist/themes/minimal/timeline/ThreadPreview.js +46 -0
- package/dist/themes/minimal/timeline/TimelineFeed.js +48 -0
- package/dist/themes/minimal/timeline/TimelineItem.js +44 -0
- package/package.json +2 -1
- package/src/app.tsx +27 -4
- package/src/i18n/locales/en.po +53 -53
- package/src/i18n/locales/zh-Hans.po +53 -53
- package/src/i18n/locales/zh-Hant.po +53 -53
- package/src/index.ts +54 -6
- package/src/lib/__tests__/theme-components.test.ts +33 -14
- package/src/lib/__tests__/view.test.ts +377 -0
- package/src/lib/feed.ts +148 -0
- package/src/lib/navigation.ts +11 -11
- package/src/lib/render.tsx +67 -0
- package/src/lib/theme-components.ts +27 -35
- package/src/lib/view.ts +318 -0
- package/src/routes/api/__tests__/timeline.test.ts +3 -3
- package/src/routes/api/timeline.tsx +34 -27
- package/src/routes/feed/rss.ts +47 -94
- package/src/routes/feed/sitemap.ts +8 -30
- package/src/routes/pages/archive.tsx +24 -209
- package/src/routes/pages/collection.tsx +19 -75
- package/src/routes/pages/home.tsx +42 -76
- package/src/routes/pages/page.tsx +17 -28
- package/src/routes/pages/post.tsx +28 -86
- package/src/routes/pages/search.tsx +29 -151
- package/src/services/search.ts +2 -8
- package/src/styles/components.css +0 -54
- package/src/theme/components/MediaGallery.tsx +12 -12
- package/src/theme/components/index.ts +0 -12
- package/src/theme/index.ts +11 -13
- package/src/theme/layouts/index.ts +1 -1
- package/src/themes/minimal/MinimalSiteLayout.tsx +100 -0
- package/src/themes/minimal/index.ts +83 -0
- package/src/themes/minimal/pages/ArchivePage.tsx +157 -0
- package/src/themes/minimal/pages/CollectionPage.tsx +60 -0
- package/src/themes/minimal/pages/HomePage.tsx +41 -0
- package/src/themes/minimal/pages/PostPage.tsx +43 -0
- package/src/themes/minimal/pages/SearchPage.tsx +122 -0
- package/src/themes/minimal/pages/SinglePage.tsx +23 -0
- package/src/themes/minimal/timeline/ArticleCard.tsx +37 -0
- package/src/themes/minimal/timeline/ImageCard.tsx +63 -0
- package/src/themes/minimal/timeline/LinkCard.tsx +48 -0
- package/src/themes/minimal/timeline/NoteCard.tsx +35 -0
- package/src/{theme/components → themes/minimal}/timeline/QuoteCard.tsx +11 -17
- package/src/themes/minimal/timeline/ThreadPreview.tsx +47 -0
- package/src/{theme/components → themes/minimal}/timeline/TimelineFeed.tsx +20 -15
- package/src/themes/minimal/timeline/TimelineItem.tsx +75 -0
- package/src/types.ts +262 -38
- package/dist/theme/components/timeline/ArticleCard.js +0 -50
- package/dist/theme/components/timeline/ImageCard.js +0 -86
- package/dist/theme/components/timeline/LinkCard.js +0 -62
- package/dist/theme/components/timeline/NoteCard.js +0 -37
- package/dist/theme/components/timeline/ThreadPreview.js +0 -52
- package/dist/theme/components/timeline/TimelineFeed.js +0 -43
- package/dist/theme/components/timeline/TimelineItem.js +0 -25
- package/dist/theme/components/timeline/index.js +0 -8
- package/dist/theme/layouts/SiteLayout.js +0 -160
- package/src/theme/components/timeline/ArticleCard.tsx +0 -57
- package/src/theme/components/timeline/ImageCard.tsx +0 -80
- package/src/theme/components/timeline/LinkCard.tsx +0 -66
- package/src/theme/components/timeline/NoteCard.tsx +0 -41
- package/src/theme/components/timeline/ThreadPreview.tsx +0 -49
- package/src/theme/components/timeline/TimelineItem.tsx +0 -39
- package/src/theme/components/timeline/index.ts +0 -8
- package/src/theme/layouts/SiteLayout.tsx +0 -184
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Archive Page
|
|
3
|
+
*
|
|
4
|
+
* Date-first list with type filter and cursor pagination.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
|
+
import { POST_TYPES } from "../../../types.js";
|
|
8
|
+
import { Pagination as DefaultPagination } from "../../../theme/components/Pagination.js";
|
|
9
|
+
function getTypeLabel(type) {
|
|
10
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
11
|
+
const labels = {
|
|
12
|
+
note: $__i18n._({
|
|
13
|
+
id: "KiJn9B",
|
|
14
|
+
message: "Note"
|
|
15
|
+
}),
|
|
16
|
+
article: $__i18n._({
|
|
17
|
+
id: "f6e0Ry",
|
|
18
|
+
message: "Article"
|
|
19
|
+
}),
|
|
20
|
+
link: $__i18n._({
|
|
21
|
+
id: "yzF66j",
|
|
22
|
+
message: "Link"
|
|
23
|
+
}),
|
|
24
|
+
quote: $__i18n._({
|
|
25
|
+
id: "ZhhOwV",
|
|
26
|
+
message: "Quote"
|
|
27
|
+
}),
|
|
28
|
+
image: $__i18n._({
|
|
29
|
+
id: "hG89Ed",
|
|
30
|
+
message: "Image"
|
|
31
|
+
}),
|
|
32
|
+
page: $__i18n._({
|
|
33
|
+
id: "6WdDG7",
|
|
34
|
+
message: "Page"
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
return labels[type] ?? type;
|
|
38
|
+
}
|
|
39
|
+
function getTypeLabelPlural(type) {
|
|
40
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
41
|
+
const labels = {
|
|
42
|
+
note: $__i18n._({
|
|
43
|
+
id: "1DBGsz",
|
|
44
|
+
message: "Notes"
|
|
45
|
+
}),
|
|
46
|
+
article: $__i18n._({
|
|
47
|
+
id: "Tt5T6+",
|
|
48
|
+
message: "Articles"
|
|
49
|
+
}),
|
|
50
|
+
link: $__i18n._({
|
|
51
|
+
id: "Rj01Fz",
|
|
52
|
+
message: "Links"
|
|
53
|
+
}),
|
|
54
|
+
quote: $__i18n._({
|
|
55
|
+
id: "eWLklq",
|
|
56
|
+
message: "Quotes"
|
|
57
|
+
}),
|
|
58
|
+
image: $__i18n._({
|
|
59
|
+
id: "an5hVd",
|
|
60
|
+
message: "Images"
|
|
61
|
+
}),
|
|
62
|
+
page: $__i18n._({
|
|
63
|
+
id: "wRR604",
|
|
64
|
+
message: "Pages"
|
|
65
|
+
})
|
|
66
|
+
};
|
|
67
|
+
return labels[type] ?? `${type}s`;
|
|
68
|
+
}
|
|
69
|
+
export const ArchivePage = ({ groups, hasMore, nextCursor, type, theme })=>{
|
|
70
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
71
|
+
const title = type ? getTypeLabelPlural(type) : $__i18n._({
|
|
72
|
+
id: "B495Gs",
|
|
73
|
+
message: "Archive"
|
|
74
|
+
});
|
|
75
|
+
const PaginationComponent = theme?.Pagination ?? DefaultPagination;
|
|
76
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
77
|
+
children: [
|
|
78
|
+
/*#__PURE__*/ _jsxs("header", {
|
|
79
|
+
class: "mb-8",
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
82
|
+
class: "text-2xl font-semibold",
|
|
83
|
+
children: title
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsxs("nav", {
|
|
86
|
+
class: "flex flex-wrap gap-2 mt-4",
|
|
87
|
+
children: [
|
|
88
|
+
/*#__PURE__*/ _jsx("a", {
|
|
89
|
+
href: "/archive",
|
|
90
|
+
class: `text-sm ${!type ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
91
|
+
children: $__i18n._({
|
|
92
|
+
id: "N40H+G",
|
|
93
|
+
message: "All"
|
|
94
|
+
})
|
|
95
|
+
}),
|
|
96
|
+
POST_TYPES.filter((t)=>t !== "page").map((typeKey)=>/*#__PURE__*/ _jsx("a", {
|
|
97
|
+
href: `/archive?type=${typeKey}`,
|
|
98
|
+
class: `text-sm ${type === typeKey ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
99
|
+
children: getTypeLabelPlural(typeKey)
|
|
100
|
+
}, typeKey))
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ _jsx("main", {
|
|
106
|
+
children: groups.length === 0 ? /*#__PURE__*/ _jsx("p", {
|
|
107
|
+
class: "text-muted-foreground",
|
|
108
|
+
children: $__i18n._({
|
|
109
|
+
id: "Hzi9AA",
|
|
110
|
+
message: "No posts found."
|
|
111
|
+
})
|
|
112
|
+
}) : groups.map((group)=>/*#__PURE__*/ _jsxs("section", {
|
|
113
|
+
class: "mb-8",
|
|
114
|
+
children: [
|
|
115
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
116
|
+
class: "text-lg font-medium mb-4 text-muted-foreground",
|
|
117
|
+
children: group.label
|
|
118
|
+
}),
|
|
119
|
+
/*#__PURE__*/ _jsx("div", {
|
|
120
|
+
class: "flex flex-col gap-3",
|
|
121
|
+
children: group.posts.map((post)=>/*#__PURE__*/ _jsxs("article", {
|
|
122
|
+
class: "flex items-baseline gap-4",
|
|
123
|
+
children: [
|
|
124
|
+
/*#__PURE__*/ _jsx("time", {
|
|
125
|
+
class: "text-sm text-muted-foreground w-12 shrink-0",
|
|
126
|
+
datetime: post.publishedAt,
|
|
127
|
+
children: new Date(post.publishedAt).getUTCDate()
|
|
128
|
+
}),
|
|
129
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
130
|
+
class: "flex-1 min-w-0",
|
|
131
|
+
children: [
|
|
132
|
+
/*#__PURE__*/ _jsx("a", {
|
|
133
|
+
href: post.permalink,
|
|
134
|
+
class: "hover:underline",
|
|
135
|
+
children: post.title || post.content?.slice(0, 80) || `Post #${post.id}`
|
|
136
|
+
}),
|
|
137
|
+
!type && /*#__PURE__*/ _jsx("span", {
|
|
138
|
+
class: "ml-2 text-xs text-muted-foreground",
|
|
139
|
+
children: getTypeLabel(post.type)
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
}, post.id))
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
}, `${group.year}-${group.month}`))
|
|
148
|
+
}),
|
|
149
|
+
/*#__PURE__*/ _jsx(PaginationComponent, {
|
|
150
|
+
baseUrl: type ? `/archive?type=${type}` : "/archive",
|
|
151
|
+
hasMore: hasMore,
|
|
152
|
+
nextCursor: nextCursor
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
});
|
|
156
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Collection Page
|
|
3
|
+
*
|
|
4
|
+
* Simple list of posts in a collection.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
|
+
export const CollectionPage = ({ collection, posts })=>{
|
|
8
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
9
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ _jsxs("header", {
|
|
12
|
+
class: "mb-8",
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
15
|
+
class: "text-2xl font-semibold",
|
|
16
|
+
children: collection.title
|
|
17
|
+
}),
|
|
18
|
+
collection.description && /*#__PURE__*/ _jsx("p", {
|
|
19
|
+
class: "text-muted-foreground mt-2",
|
|
20
|
+
children: collection.description
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ _jsx("main", {
|
|
25
|
+
class: "flex flex-col",
|
|
26
|
+
children: posts.length === 0 ? /*#__PURE__*/ _jsx("p", {
|
|
27
|
+
class: "text-muted-foreground",
|
|
28
|
+
children: $__i18n._({
|
|
29
|
+
id: "J4FNfC",
|
|
30
|
+
message: "No posts in this collection."
|
|
31
|
+
})
|
|
32
|
+
}) : posts.map((post, i)=>/*#__PURE__*/ _jsxs("article", {
|
|
33
|
+
class: "h-entry",
|
|
34
|
+
children: [
|
|
35
|
+
i > 0 && /*#__PURE__*/ _jsx("hr", {
|
|
36
|
+
class: "my-6 border-border"
|
|
37
|
+
}),
|
|
38
|
+
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
39
|
+
class: "p-name text-lg font-medium mb-2",
|
|
40
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
41
|
+
href: post.permalink,
|
|
42
|
+
class: "u-url hover:underline",
|
|
43
|
+
children: post.title
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ _jsx("div", {
|
|
47
|
+
class: "e-content prose prose-sm",
|
|
48
|
+
dangerouslySetInnerHTML: {
|
|
49
|
+
__html: post.contentHtml || ""
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ _jsx("footer", {
|
|
53
|
+
class: "mt-2 text-sm text-muted-foreground",
|
|
54
|
+
children: /*#__PURE__*/ _jsx("time", {
|
|
55
|
+
class: "dt-published",
|
|
56
|
+
datetime: post.publishedAt,
|
|
57
|
+
children: post.publishedAtFormatted
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
}, post.id))
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Home Page
|
|
3
|
+
*
|
|
4
|
+
* Renders the timeline feed with thread previews.
|
|
5
|
+
*/ import { jsx as _jsx, Fragment as _Fragment } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
|
+
import { TimelineFeed as DefaultTimelineFeed } from "../timeline/TimelineFeed.js";
|
|
8
|
+
export const HomePage = ({ items, hasMore, nextCursor, theme })=>{
|
|
9
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
10
|
+
const Feed = theme?.TimelineFeed ?? DefaultTimelineFeed;
|
|
11
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
12
|
+
children: items.length === 0 ? /*#__PURE__*/ _jsx("p", {
|
|
13
|
+
class: "text-muted-foreground",
|
|
14
|
+
children: $__i18n._({
|
|
15
|
+
id: "ODiSoW",
|
|
16
|
+
message: "No posts yet."
|
|
17
|
+
})
|
|
18
|
+
}) : /*#__PURE__*/ _jsx(Feed, {
|
|
19
|
+
items: items,
|
|
20
|
+
hasMore: hasMore,
|
|
21
|
+
nextCursor: nextCursor,
|
|
22
|
+
theme: theme
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Post Page
|
|
3
|
+
*
|
|
4
|
+
* Clean article layout for a single post.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
|
+
import { MediaGallery as DefaultMediaGallery } from "../../../theme/components/MediaGallery.js";
|
|
8
|
+
export const PostPage = ({ post, theme })=>{
|
|
9
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
10
|
+
const Gallery = theme?.MediaGallery ?? DefaultMediaGallery;
|
|
11
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
12
|
+
class: "h-entry",
|
|
13
|
+
children: [
|
|
14
|
+
post.title && /*#__PURE__*/ _jsx("h1", {
|
|
15
|
+
class: "p-name text-2xl font-semibold mb-4",
|
|
16
|
+
children: post.title
|
|
17
|
+
}),
|
|
18
|
+
/*#__PURE__*/ _jsx("div", {
|
|
19
|
+
class: "e-content prose",
|
|
20
|
+
dangerouslySetInnerHTML: {
|
|
21
|
+
__html: post.contentHtml || ""
|
|
22
|
+
}
|
|
23
|
+
}),
|
|
24
|
+
post.media.length > 0 && /*#__PURE__*/ _jsx(Gallery, {
|
|
25
|
+
attachments: post.media
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ _jsxs("footer", {
|
|
28
|
+
class: "mt-8 pt-4 border-t border-border text-sm text-muted-foreground",
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ _jsx("time", {
|
|
31
|
+
class: "dt-published",
|
|
32
|
+
datetime: post.publishedAt,
|
|
33
|
+
children: post.publishedAtFormatted
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ _jsx("a", {
|
|
36
|
+
href: post.permalink,
|
|
37
|
+
class: "u-url ml-4 hover:underline",
|
|
38
|
+
children: $__i18n._({
|
|
39
|
+
id: "D9Oea+",
|
|
40
|
+
message: "Permalink"
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Search Page
|
|
3
|
+
*
|
|
4
|
+
* Minimal search form + results with page-based pagination.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
|
+
import { PagePagination as DefaultPagePagination } from "../../../theme/components/Pagination.js";
|
|
8
|
+
export const SearchPage = ({ query, results, error, hasMore, page, theme })=>{
|
|
9
|
+
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
10
|
+
const searchTitle = $__i18n._({
|
|
11
|
+
id: "A1taO8",
|
|
12
|
+
message: "Search"
|
|
13
|
+
});
|
|
14
|
+
const PaginationComponent = theme?.PagePagination ?? DefaultPagePagination;
|
|
15
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
18
|
+
class: "text-2xl font-semibold mb-6",
|
|
19
|
+
children: searchTitle
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ _jsx("form", {
|
|
22
|
+
method: "get",
|
|
23
|
+
action: "/search",
|
|
24
|
+
class: "mb-8",
|
|
25
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
26
|
+
class: "flex gap-2",
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ _jsx("input", {
|
|
29
|
+
type: "search",
|
|
30
|
+
name: "q",
|
|
31
|
+
class: "input flex-1",
|
|
32
|
+
placeholder: $__i18n._({
|
|
33
|
+
id: "MqghUt",
|
|
34
|
+
message: "Search posts..."
|
|
35
|
+
}),
|
|
36
|
+
value: query,
|
|
37
|
+
autofocus: true
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ _jsx("button", {
|
|
40
|
+
type: "submit",
|
|
41
|
+
class: "btn",
|
|
42
|
+
children: $__i18n._({
|
|
43
|
+
id: "A1taO8",
|
|
44
|
+
message: "Search"
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
error && /*#__PURE__*/ _jsx("div", {
|
|
51
|
+
class: "alert-destructive mb-6",
|
|
52
|
+
children: /*#__PURE__*/ _jsx("h2", {
|
|
53
|
+
children: error
|
|
54
|
+
})
|
|
55
|
+
}),
|
|
56
|
+
query && !error && /*#__PURE__*/ _jsxs("div", {
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ _jsx("p", {
|
|
59
|
+
class: "text-sm text-muted-foreground mb-4",
|
|
60
|
+
children: results.length === 0 ? $__i18n._({
|
|
61
|
+
id: "MZbQHL",
|
|
62
|
+
message: "No results found."
|
|
63
|
+
}) : results.length === 1 ? $__i18n._({
|
|
64
|
+
id: "z8ajIE",
|
|
65
|
+
message: "Found 1 result"
|
|
66
|
+
}) : $__i18n._({
|
|
67
|
+
id: "zH6KqE",
|
|
68
|
+
message: "Found {count} results"
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
results.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ _jsx("div", {
|
|
74
|
+
class: "flex flex-col gap-4",
|
|
75
|
+
children: results.map((result)=>/*#__PURE__*/ _jsx("article", {
|
|
76
|
+
class: "py-3",
|
|
77
|
+
children: /*#__PURE__*/ _jsxs("a", {
|
|
78
|
+
href: result.post.permalink,
|
|
79
|
+
class: "block group",
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
82
|
+
class: "font-medium group-hover:underline",
|
|
83
|
+
children: result.post.title || result.post.content?.slice(0, 60) || `Post #${result.post.id}`
|
|
84
|
+
}),
|
|
85
|
+
result.snippet && /*#__PURE__*/ _jsx("p", {
|
|
86
|
+
class: "text-sm text-muted-foreground mt-1 line-clamp-2",
|
|
87
|
+
dangerouslySetInnerHTML: {
|
|
88
|
+
__html: result.snippet
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ _jsxs("footer", {
|
|
92
|
+
class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground",
|
|
93
|
+
children: [
|
|
94
|
+
/*#__PURE__*/ _jsx("span", {
|
|
95
|
+
children: result.post.type
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsx("span", {
|
|
98
|
+
children: "·"
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ _jsx("time", {
|
|
101
|
+
datetime: result.post.publishedAt,
|
|
102
|
+
children: result.post.publishedAtFormatted
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
}, result.post.id))
|
|
109
|
+
}),
|
|
110
|
+
/*#__PURE__*/ _jsx(PaginationComponent, {
|
|
111
|
+
baseUrl: `/search?q=${encodeURIComponent(query)}`,
|
|
112
|
+
currentPage: page,
|
|
113
|
+
hasMore: hasMore
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Single Page
|
|
3
|
+
*
|
|
4
|
+
* Simple page content layout for type="page" posts.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
export const SinglePage = ({ page })=>{
|
|
7
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
8
|
+
class: "h-entry",
|
|
9
|
+
children: [
|
|
10
|
+
page.title && /*#__PURE__*/ _jsx("h1", {
|
|
11
|
+
class: "p-name text-2xl font-semibold mb-6",
|
|
12
|
+
children: page.title
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ _jsx("div", {
|
|
15
|
+
class: "e-content prose",
|
|
16
|
+
dangerouslySetInnerHTML: {
|
|
17
|
+
__html: page.contentHtml || ""
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Article Card
|
|
3
|
+
*
|
|
4
|
+
* Title + excerpt, borderless, for type="article" posts.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
export const ArticleCard = ({ post, compact })=>{
|
|
7
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
8
|
+
class: `h-entry${compact ? " text-sm" : ""}`,
|
|
9
|
+
children: [
|
|
10
|
+
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
11
|
+
class: `p-name font-semibold ${compact ? "text-sm" : "text-lg"}`,
|
|
12
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
13
|
+
href: post.permalink,
|
|
14
|
+
class: "u-url hover:underline",
|
|
15
|
+
children: post.title
|
|
16
|
+
})
|
|
17
|
+
}),
|
|
18
|
+
!compact && post.excerpt && /*#__PURE__*/ _jsx("p", {
|
|
19
|
+
class: "e-content text-muted-foreground mt-1 line-clamp-3",
|
|
20
|
+
children: post.excerpt
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ _jsx("footer", {
|
|
23
|
+
class: "mt-2",
|
|
24
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
25
|
+
href: post.permalink,
|
|
26
|
+
class: "u-url text-xs text-muted-foreground hover:text-foreground",
|
|
27
|
+
children: /*#__PURE__*/ _jsx("time", {
|
|
28
|
+
class: "dt-published",
|
|
29
|
+
datetime: post.publishedAt,
|
|
30
|
+
children: post.publishedAtFormatted
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Image Card
|
|
3
|
+
*
|
|
4
|
+
* Inline images with no card frame for type="image" posts.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { MediaGallery } from "../../../theme/components/MediaGallery.js";
|
|
7
|
+
export const ImageCard = ({ post, compact })=>{
|
|
8
|
+
if (compact) {
|
|
9
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
10
|
+
class: "h-entry text-sm",
|
|
11
|
+
children: [
|
|
12
|
+
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
13
|
+
class: "p-name font-medium text-sm",
|
|
14
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
15
|
+
href: post.permalink,
|
|
16
|
+
class: "u-url hover:underline",
|
|
17
|
+
children: post.title
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
post.contentHtml && /*#__PURE__*/ _jsx("div", {
|
|
21
|
+
class: "e-content prose prose-sm text-muted-foreground",
|
|
22
|
+
dangerouslySetInnerHTML: {
|
|
23
|
+
__html: post.contentHtml
|
|
24
|
+
}
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ _jsx("footer", {
|
|
27
|
+
class: "mt-1",
|
|
28
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
29
|
+
href: post.permalink,
|
|
30
|
+
class: "u-url text-xs text-muted-foreground hover:text-foreground",
|
|
31
|
+
children: /*#__PURE__*/ _jsx("time", {
|
|
32
|
+
class: "dt-published",
|
|
33
|
+
datetime: post.publishedAt,
|
|
34
|
+
children: post.publishedAtFormatted
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
42
|
+
class: "h-entry",
|
|
43
|
+
children: [
|
|
44
|
+
post.contentHtml && /*#__PURE__*/ _jsx("div", {
|
|
45
|
+
class: "e-content prose prose-sm",
|
|
46
|
+
dangerouslySetInnerHTML: {
|
|
47
|
+
__html: post.contentHtml
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
post.media.length > 0 && /*#__PURE__*/ _jsx(MediaGallery, {
|
|
51
|
+
attachments: post.media
|
|
52
|
+
}),
|
|
53
|
+
/*#__PURE__*/ _jsx("footer", {
|
|
54
|
+
class: "mt-2",
|
|
55
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
56
|
+
href: post.permalink,
|
|
57
|
+
class: "u-url text-xs text-muted-foreground hover:text-foreground",
|
|
58
|
+
children: /*#__PURE__*/ _jsx("time", {
|
|
59
|
+
class: "dt-published",
|
|
60
|
+
datetime: post.publishedAt,
|
|
61
|
+
children: post.publishedAtFormatted
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Link Card
|
|
3
|
+
*
|
|
4
|
+
* Subtle external link indicator for type="link" posts.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
export const LinkCard = ({ post, compact })=>{
|
|
7
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
8
|
+
class: `h-entry${compact ? " text-sm" : ""}`,
|
|
9
|
+
children: [
|
|
10
|
+
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
11
|
+
class: `p-name font-semibold ${compact ? "text-sm" : "text-base"}`,
|
|
12
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
13
|
+
href: post.sourceUrl || post.permalink,
|
|
14
|
+
class: "u-url hover:underline",
|
|
15
|
+
target: post.sourceUrl ? "_blank" : undefined,
|
|
16
|
+
rel: post.sourceUrl ? "noopener noreferrer" : undefined,
|
|
17
|
+
children: post.title
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
post.sourceDomain && /*#__PURE__*/ _jsxs("div", {
|
|
21
|
+
class: "text-xs text-muted-foreground mt-0.5",
|
|
22
|
+
children: [
|
|
23
|
+
"↗ ",
|
|
24
|
+
post.sourceDomain
|
|
25
|
+
]
|
|
26
|
+
}),
|
|
27
|
+
!compact && post.contentHtml && /*#__PURE__*/ _jsx("div", {
|
|
28
|
+
class: "e-content prose prose-sm text-muted-foreground mt-1",
|
|
29
|
+
dangerouslySetInnerHTML: {
|
|
30
|
+
__html: post.contentHtml
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ _jsx("footer", {
|
|
34
|
+
class: "mt-2",
|
|
35
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
36
|
+
href: post.permalink,
|
|
37
|
+
class: "text-xs text-muted-foreground hover:text-foreground",
|
|
38
|
+
children: /*#__PURE__*/ _jsx("time", {
|
|
39
|
+
class: "dt-published",
|
|
40
|
+
datetime: post.publishedAt,
|
|
41
|
+
children: post.publishedAtFormatted
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Theme - Note Card
|
|
3
|
+
*
|
|
4
|
+
* Borderless, content-first card for type="note" posts.
|
|
5
|
+
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
+
import { MediaGallery } from "../../../theme/components/MediaGallery.js";
|
|
7
|
+
export const NoteCard = ({ post, compact })=>{
|
|
8
|
+
return /*#__PURE__*/ _jsxs("article", {
|
|
9
|
+
class: `h-entry${compact ? " text-sm" : ""}`,
|
|
10
|
+
children: [
|
|
11
|
+
post.contentHtml && /*#__PURE__*/ _jsx("div", {
|
|
12
|
+
class: `e-content prose ${compact ? "prose-sm" : ""}`,
|
|
13
|
+
dangerouslySetInnerHTML: {
|
|
14
|
+
__html: post.contentHtml
|
|
15
|
+
}
|
|
16
|
+
}),
|
|
17
|
+
!compact && post.media.length > 0 && /*#__PURE__*/ _jsx(MediaGallery, {
|
|
18
|
+
attachments: post.media
|
|
19
|
+
}),
|
|
20
|
+
/*#__PURE__*/ _jsx("footer", {
|
|
21
|
+
class: "mt-2",
|
|
22
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
23
|
+
href: post.permalink,
|
|
24
|
+
class: "u-url text-xs text-muted-foreground hover:text-foreground",
|
|
25
|
+
children: /*#__PURE__*/ _jsx("time", {
|
|
26
|
+
class: "dt-published",
|
|
27
|
+
datetime: post.publishedAt,
|
|
28
|
+
children: post.publishedAtFormatted
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
};
|