@jant/core 0.3.22 → 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 +22 -3
- package/dist/index.js +3 -4
- package/dist/lib/render.js +1 -1
- package/dist/lib/view.js +1 -1
- package/dist/routes/api/timeline.js +3 -3
- package/dist/routes/pages/archive.js +1 -1
- package/dist/routes/pages/collection.js +1 -1
- package/dist/routes/pages/home.js +1 -1
- package/dist/routes/pages/page.js +1 -1
- package/dist/routes/pages/post.js +1 -1
- package/dist/routes/pages/search.js +1 -1
- package/dist/theme/components/index.js +0 -2
- package/dist/theme/index.js +10 -16
- 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/{theme → themes/minimal}/pages/ArchivePage.js +7 -8
- package/dist/{theme → themes/minimal}/pages/CollectionPage.js +7 -5
- package/dist/{theme → themes/minimal}/pages/HomePage.js +2 -3
- package/dist/{theme → themes/minimal}/pages/PostPage.js +5 -6
- package/dist/{theme → themes/minimal}/pages/SearchPage.js +11 -10
- package/dist/{theme → themes/minimal}/pages/SinglePage.js +3 -4
- package/dist/themes/minimal/timeline/ArticleCard.js +36 -0
- package/dist/themes/minimal/timeline/ImageCard.js +67 -0
- package/dist/{theme/components → themes/minimal}/timeline/LinkCard.js +14 -26
- package/dist/{theme/components → themes/minimal}/timeline/NoteCard.js +7 -7
- package/dist/{theme/components → themes/minimal}/timeline/QuoteCard.js +6 -6
- package/dist/{theme/components → themes/minimal}/timeline/ThreadPreview.js +13 -18
- package/dist/themes/minimal/timeline/TimelineFeed.js +48 -0
- package/dist/{theme/components → themes/minimal}/timeline/TimelineItem.js +1 -2
- package/package.json +1 -1
- package/src/app.tsx +26 -3
- package/src/i18n/locales/en.po +47 -47
- package/src/i18n/locales/zh-Hans.po +47 -47
- package/src/i18n/locales/zh-Hant.po +47 -47
- package/src/index.ts +4 -5
- package/src/lib/__tests__/view.test.ts +18 -16
- package/src/lib/render.tsx +1 -1
- package/src/lib/view.ts +1 -1
- package/src/routes/api/timeline.tsx +3 -3
- package/src/routes/pages/archive.tsx +1 -1
- package/src/routes/pages/collection.tsx +1 -1
- package/src/routes/pages/home.tsx +1 -1
- package/src/routes/pages/page.tsx +1 -1
- package/src/routes/pages/post.tsx +1 -1
- package/src/routes/pages/search.tsx +1 -1
- package/src/styles/components.css +0 -54
- package/src/theme/components/index.ts +0 -13
- package/src/theme/index.ts +10 -16
- package/src/theme/layouts/index.ts +0 -1
- package/src/themes/minimal/MinimalSiteLayout.tsx +100 -0
- package/src/themes/minimal/index.ts +83 -0
- package/src/{theme → themes/minimal}/pages/ArchivePage.tsx +8 -11
- package/src/{theme → themes/minimal}/pages/CollectionPage.tsx +6 -6
- package/src/{theme → themes/minimal}/pages/HomePage.tsx +3 -4
- package/src/{theme → themes/minimal}/pages/PostPage.tsx +6 -7
- package/src/{theme → themes/minimal}/pages/SearchPage.tsx +11 -17
- package/src/{theme → themes/minimal}/pages/SinglePage.tsx +4 -5
- 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/{theme/components → themes/minimal}/timeline/NoteCard.tsx +10 -9
- package/src/{theme/components → themes/minimal}/timeline/QuoteCard.tsx +9 -8
- package/src/{theme/components → themes/minimal}/timeline/ThreadPreview.tsx +14 -16
- package/src/{theme/components → themes/minimal}/timeline/TimelineFeed.tsx +14 -13
- package/src/{theme/components → themes/minimal}/timeline/TimelineItem.tsx +1 -4
- package/dist/theme/components/timeline/ArticleCard.js +0 -46
- package/dist/theme/components/timeline/ImageCard.js +0 -83
- package/dist/theme/components/timeline/TimelineFeed.js +0 -46
- package/dist/theme/components/timeline/index.js +0 -8
- package/dist/theme/layouts/SiteLayout.js +0 -131
- package/dist/theme/pages/index.js +0 -11
- package/src/theme/components/timeline/ArticleCard.tsx +0 -45
- package/src/theme/components/timeline/ImageCard.tsx +0 -70
- package/src/theme/components/timeline/LinkCard.tsx +0 -59
- package/src/theme/components/timeline/index.ts +0 -8
- package/src/theme/layouts/SiteLayout.tsx +0 -132
- package/src/theme/pages/index.ts +0 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Thread Preview
|
|
2
|
+
* Minimal Theme - Thread Preview
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Minimal thread indicator: root post + compact replies + "show more" link.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { FC } from "hono/jsx";
|
|
@@ -20,27 +20,25 @@ export const ThreadPreview: FC<ThreadPreviewProps> = ({
|
|
|
20
20
|
const remainingCount = totalReplyCount - previewReplies.length;
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<div
|
|
23
|
+
<div>
|
|
24
24
|
<TimelineItem item={{ post: rootPost }} theme={theme} />
|
|
25
25
|
{previewReplies.length > 0 && (
|
|
26
|
-
<div class="
|
|
26
|
+
<div class="ml-4 mt-2 border-l border-border pl-4 flex flex-col gap-3">
|
|
27
27
|
{previewReplies.map((reply) => (
|
|
28
|
-
<div key={reply.id}
|
|
28
|
+
<div key={reply.id}>
|
|
29
29
|
<TimelineItemFromPost post={reply} compact theme={theme} />
|
|
30
30
|
</div>
|
|
31
31
|
))}
|
|
32
32
|
{remainingCount > 0 && (
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</a>
|
|
43
|
-
</div>
|
|
33
|
+
<a
|
|
34
|
+
href={rootPost.permalink}
|
|
35
|
+
class="text-sm text-muted-foreground hover:text-foreground hover:underline"
|
|
36
|
+
>
|
|
37
|
+
{t({
|
|
38
|
+
message: `Show ${remainingCount} more ${remainingCount === 1 ? "reply" : "replies"}`,
|
|
39
|
+
comment: "@context: Link to show remaining thread replies",
|
|
40
|
+
})}
|
|
41
|
+
</a>
|
|
44
42
|
)}
|
|
45
43
|
</div>
|
|
46
44
|
)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Timeline Feed
|
|
2
|
+
* Minimal Theme - Timeline Feed
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Divider-separated stream of posts with load-more button.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { FC } from "hono/jsx";
|
|
@@ -22,26 +22,27 @@ export const TimelineFeed: FC<TimelineFeedProps> = ({
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<div>
|
|
25
|
-
<div id="timeline-feed" class="flex flex-col
|
|
26
|
-
{items.map((item) =>
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
<div id="timeline-feed" class="flex flex-col">
|
|
26
|
+
{items.map((item, i) => (
|
|
27
|
+
<div key={item.post.id}>
|
|
28
|
+
{i > 0 && <hr class="my-6 border-border" />}
|
|
29
|
+
{item.threadPreview ? (
|
|
29
30
|
<ResolvedThreadPreview
|
|
30
|
-
key={item.post.id}
|
|
31
31
|
rootPost={item.post}
|
|
32
32
|
previewReplies={item.threadPreview.replies}
|
|
33
33
|
totalReplyCount={item.threadPreview.totalReplyCount}
|
|
34
34
|
theme={theme}
|
|
35
35
|
/>
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
) : (
|
|
37
|
+
<TimelineItem item={item} theme={theme} />
|
|
38
|
+
)}
|
|
39
|
+
</div>
|
|
40
|
+
))}
|
|
40
41
|
</div>
|
|
41
42
|
{hasMore && nextCursor && (
|
|
42
|
-
<div id="load-more-container" class="mt-
|
|
43
|
+
<div id="load-more-container" class="mt-8 text-center">
|
|
43
44
|
<button
|
|
44
|
-
class="
|
|
45
|
+
class="text-sm text-muted-foreground hover:text-foreground hover:underline"
|
|
45
46
|
data-on:click={`@get('/api/timeline?cursor=${nextCursor}')`}
|
|
46
47
|
>
|
|
47
48
|
{t({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Timeline Item
|
|
2
|
+
* Minimal Theme - Timeline Item
|
|
3
3
|
*
|
|
4
4
|
* Dispatches to the correct card component based on post type.
|
|
5
|
-
* Resolves card overrides from theme components if provided.
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
7
|
import type { FC } from "hono/jsx";
|
|
@@ -40,9 +39,7 @@ const THEME_KEY_MAP: Record<PostType, keyof ThemeComponents> = {
|
|
|
40
39
|
interface TimelineItemProps {
|
|
41
40
|
item: TimelineItemView;
|
|
42
41
|
compact?: boolean;
|
|
43
|
-
/** Override card component (for direct overrides) */
|
|
44
42
|
cardOverride?: FC<TimelineCardProps>;
|
|
45
|
-
/** Theme components for cascade resolution */
|
|
46
43
|
theme?: ThemeComponents;
|
|
47
44
|
}
|
|
48
45
|
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Article Card Component
|
|
3
|
-
*
|
|
4
|
-
* Prominent title + excerpt 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 timeline-card${compact ? " timeline-card-compact" : ""}`,
|
|
9
|
-
children: [
|
|
10
|
-
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
11
|
-
class: `p-name font-semibold ${compact ? "text-sm" : "text-lg"} mb-1`,
|
|
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-sm text-muted-foreground line-clamp-3",
|
|
20
|
-
children: post.excerpt
|
|
21
|
-
}),
|
|
22
|
-
/*#__PURE__*/ _jsxs("footer", {
|
|
23
|
-
class: "mt-2 text-xs text-muted-foreground",
|
|
24
|
-
children: [
|
|
25
|
-
/*#__PURE__*/ _jsx("a", {
|
|
26
|
-
href: post.permalink,
|
|
27
|
-
class: "u-url hover:underline",
|
|
28
|
-
children: /*#__PURE__*/ _jsx("time", {
|
|
29
|
-
class: "dt-published",
|
|
30
|
-
datetime: post.publishedAt,
|
|
31
|
-
children: post.publishedAtFormatted
|
|
32
|
-
})
|
|
33
|
-
}),
|
|
34
|
-
!compact && /*#__PURE__*/ _jsx("span", {
|
|
35
|
-
class: "ml-2",
|
|
36
|
-
children: /*#__PURE__*/ _jsx("a", {
|
|
37
|
-
href: post.permalink,
|
|
38
|
-
class: "hover:underline",
|
|
39
|
-
children: "Read more →"
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
]
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
});
|
|
46
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image Card Component
|
|
3
|
-
*
|
|
4
|
-
* Image-first layout for type="image" posts.
|
|
5
|
-
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
-
import { MediaGallery } from "../MediaGallery.js";
|
|
7
|
-
export const ImageCard = ({ post, compact })=>{
|
|
8
|
-
if (compact) {
|
|
9
|
-
return /*#__PURE__*/ _jsxs("article", {
|
|
10
|
-
class: "h-entry timeline-card timeline-card-compact",
|
|
11
|
-
children: [
|
|
12
|
-
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
13
|
-
class: "p-name text-sm font-medium mb-1",
|
|
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 text-xs text-muted-foreground",
|
|
28
|
-
children: /*#__PURE__*/ _jsx("a", {
|
|
29
|
-
href: post.permalink,
|
|
30
|
-
class: "u-url hover:underline",
|
|
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 timeline-card timeline-card-image",
|
|
43
|
-
children: [
|
|
44
|
-
post.media.length > 0 && /*#__PURE__*/ _jsx("div", {
|
|
45
|
-
class: "timeline-card-image-gallery",
|
|
46
|
-
children: /*#__PURE__*/ _jsx(MediaGallery, {
|
|
47
|
-
attachments: post.media
|
|
48
|
-
})
|
|
49
|
-
}),
|
|
50
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
51
|
-
class: "p-4",
|
|
52
|
-
children: [
|
|
53
|
-
post.title && /*#__PURE__*/ _jsx("h2", {
|
|
54
|
-
class: "p-name font-medium mb-1",
|
|
55
|
-
children: /*#__PURE__*/ _jsx("a", {
|
|
56
|
-
href: post.permalink,
|
|
57
|
-
class: "u-url hover:underline",
|
|
58
|
-
children: post.title
|
|
59
|
-
})
|
|
60
|
-
}),
|
|
61
|
-
post.contentHtml && /*#__PURE__*/ _jsx("div", {
|
|
62
|
-
class: "e-content prose prose-sm",
|
|
63
|
-
dangerouslySetInnerHTML: {
|
|
64
|
-
__html: post.contentHtml
|
|
65
|
-
}
|
|
66
|
-
}),
|
|
67
|
-
/*#__PURE__*/ _jsx("footer", {
|
|
68
|
-
class: "mt-2 text-xs text-muted-foreground",
|
|
69
|
-
children: /*#__PURE__*/ _jsx("a", {
|
|
70
|
-
href: post.permalink,
|
|
71
|
-
class: "u-url hover:underline",
|
|
72
|
-
children: /*#__PURE__*/ _jsx("time", {
|
|
73
|
-
class: "dt-published",
|
|
74
|
-
datetime: post.publishedAt,
|
|
75
|
-
children: post.publishedAtFormatted
|
|
76
|
-
})
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
})
|
|
81
|
-
]
|
|
82
|
-
});
|
|
83
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeline Feed Component
|
|
3
|
-
*
|
|
4
|
-
* Main feed wrapper with load-more button.
|
|
5
|
-
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
6
|
-
import { useLingui as $_useLingui } from "@jant/core/i18n";
|
|
7
|
-
import { TimelineItem } from "./TimelineItem.js";
|
|
8
|
-
import { ThreadPreview as DefaultThreadPreview } from "./ThreadPreview.js";
|
|
9
|
-
export const TimelineFeed = ({ items, hasMore, nextCursor, theme })=>{
|
|
10
|
-
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
11
|
-
const ResolvedThreadPreview = theme?.ThreadPreview ?? DefaultThreadPreview;
|
|
12
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
13
|
-
children: [
|
|
14
|
-
/*#__PURE__*/ _jsx("div", {
|
|
15
|
-
id: "timeline-feed",
|
|
16
|
-
class: "flex flex-col gap-4",
|
|
17
|
-
children: items.map((item)=>{
|
|
18
|
-
if (item.threadPreview) {
|
|
19
|
-
return /*#__PURE__*/ _jsx(ResolvedThreadPreview, {
|
|
20
|
-
rootPost: item.post,
|
|
21
|
-
previewReplies: item.threadPreview.replies,
|
|
22
|
-
totalReplyCount: item.threadPreview.totalReplyCount,
|
|
23
|
-
theme: theme
|
|
24
|
-
}, item.post.id);
|
|
25
|
-
}
|
|
26
|
-
return /*#__PURE__*/ _jsx(TimelineItem, {
|
|
27
|
-
item: item,
|
|
28
|
-
theme: theme
|
|
29
|
-
}, item.post.id);
|
|
30
|
-
})
|
|
31
|
-
}),
|
|
32
|
-
hasMore && nextCursor && /*#__PURE__*/ _jsx("div", {
|
|
33
|
-
id: "load-more-container",
|
|
34
|
-
class: "mt-6 text-center",
|
|
35
|
-
children: /*#__PURE__*/ _jsx("button", {
|
|
36
|
-
class: "btn btn-outline",
|
|
37
|
-
"data-on:click": `@get('/api/timeline?cursor=${nextCursor}')`,
|
|
38
|
-
children: $__i18n._({
|
|
39
|
-
id: "yQ2kGp",
|
|
40
|
-
message: "Load more"
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
});
|
|
46
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { NoteCard } from "./NoteCard.js";
|
|
2
|
-
export { ArticleCard } from "./ArticleCard.js";
|
|
3
|
-
export { LinkCard } from "./LinkCard.js";
|
|
4
|
-
export { QuoteCard } from "./QuoteCard.js";
|
|
5
|
-
export { ImageCard } from "./ImageCard.js";
|
|
6
|
-
export { ThreadPreview } from "./ThreadPreview.js";
|
|
7
|
-
export { TimelineItem, TimelineItemFromPost } from "./TimelineItem.js";
|
|
8
|
-
export { TimelineFeed } from "./TimelineFeed.js";
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Site Layout
|
|
3
|
-
*
|
|
4
|
-
* Two-column layout for public pages with sidebar navigation.
|
|
5
|
-
* On mobile, uses a slide-out drawer menu.
|
|
6
|
-
*/ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "hono/jsx/jsx-runtime";
|
|
7
|
-
/**
|
|
8
|
-
* Render navigation links with dot indicator for active state.
|
|
9
|
-
*/ function NavLinks({ links }) {
|
|
10
|
-
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
11
|
-
children: links.map((link)=>/*#__PURE__*/ _jsxs("a", {
|
|
12
|
-
href: link.url,
|
|
13
|
-
class: `text-sm flex items-center gap-2 py-0.5 ${link.isActive ? "text-primary font-medium" : "text-muted-foreground hover:text-foreground"}`,
|
|
14
|
-
...link.isExternal ? {
|
|
15
|
-
target: "_blank",
|
|
16
|
-
rel: "noopener noreferrer"
|
|
17
|
-
} : {},
|
|
18
|
-
children: [
|
|
19
|
-
/*#__PURE__*/ _jsx("span", {
|
|
20
|
-
class: `size-1.5 rounded-full shrink-0 ${link.isActive ? "bg-primary" : "bg-transparent"}`
|
|
21
|
-
}),
|
|
22
|
-
link.label,
|
|
23
|
-
link.isExternal && /*#__PURE__*/ _jsx("span", {
|
|
24
|
-
class: "ml-1 text-xs opacity-50",
|
|
25
|
-
children: "↗"
|
|
26
|
-
})
|
|
27
|
-
]
|
|
28
|
-
}, link.id))
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
export const SiteLayout = ({ siteName, links, children })=>{
|
|
32
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
33
|
-
class: "container py-8 md:flex md:gap-12",
|
|
34
|
-
"data-signals": JSON.stringify({
|
|
35
|
-
_drawerOpen: false
|
|
36
|
-
}),
|
|
37
|
-
children: [
|
|
38
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
39
|
-
class: "flex items-center justify-between mb-6 md:hidden",
|
|
40
|
-
children: [
|
|
41
|
-
/*#__PURE__*/ _jsx("a", {
|
|
42
|
-
href: "/",
|
|
43
|
-
class: "text-xl font-semibold",
|
|
44
|
-
children: siteName
|
|
45
|
-
}),
|
|
46
|
-
/*#__PURE__*/ _jsx("button", {
|
|
47
|
-
"data-on:click": "$_drawerOpen = true",
|
|
48
|
-
class: "p-2 -mr-2 text-muted-foreground hover:text-foreground",
|
|
49
|
-
"aria-label": "Open menu",
|
|
50
|
-
children: /*#__PURE__*/ _jsx("svg", {
|
|
51
|
-
class: "size-5",
|
|
52
|
-
fill: "none",
|
|
53
|
-
viewBox: "0 0 24 24",
|
|
54
|
-
"stroke-width": "1.5",
|
|
55
|
-
stroke: "currentColor",
|
|
56
|
-
children: /*#__PURE__*/ _jsx("path", {
|
|
57
|
-
"stroke-linecap": "round",
|
|
58
|
-
"stroke-linejoin": "round",
|
|
59
|
-
d: "M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ _jsx("div", {
|
|
66
|
-
class: "fixed inset-0 bg-black/50 z-40 opacity-0 pointer-events-none transition-opacity duration-300 ease-in-out md:hidden",
|
|
67
|
-
"data-class": "{'opacity-100 pointer-events-auto': $_drawerOpen, 'opacity-0 pointer-events-none': !$_drawerOpen}",
|
|
68
|
-
"data-on:click": "$_drawerOpen = false"
|
|
69
|
-
}),
|
|
70
|
-
/*#__PURE__*/ _jsxs("aside", {
|
|
71
|
-
class: "fixed inset-y-0 left-0 w-64 bg-background z-50 p-6 overflow-y-auto shadow-lg -translate-x-full transition-transform duration-300 ease-in-out md:hidden",
|
|
72
|
-
"data-class": "{'translate-x-0': $_drawerOpen, '-translate-x-full': !$_drawerOpen}",
|
|
73
|
-
children: [
|
|
74
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
75
|
-
class: "flex items-center justify-between mb-8",
|
|
76
|
-
children: [
|
|
77
|
-
/*#__PURE__*/ _jsx("a", {
|
|
78
|
-
href: "/",
|
|
79
|
-
class: "text-xl font-semibold",
|
|
80
|
-
children: siteName
|
|
81
|
-
}),
|
|
82
|
-
/*#__PURE__*/ _jsx("button", {
|
|
83
|
-
"data-on:click": "$_drawerOpen = false",
|
|
84
|
-
class: "p-2 -mr-2 text-muted-foreground hover:text-foreground",
|
|
85
|
-
"aria-label": "Close menu",
|
|
86
|
-
children: /*#__PURE__*/ _jsx("svg", {
|
|
87
|
-
class: "size-5",
|
|
88
|
-
fill: "none",
|
|
89
|
-
viewBox: "0 0 24 24",
|
|
90
|
-
"stroke-width": "1.5",
|
|
91
|
-
stroke: "currentColor",
|
|
92
|
-
children: /*#__PURE__*/ _jsx("path", {
|
|
93
|
-
"stroke-linecap": "round",
|
|
94
|
-
"stroke-linejoin": "round",
|
|
95
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
96
|
-
})
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
]
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ _jsx("nav", {
|
|
102
|
-
class: "flex flex-col gap-0.5",
|
|
103
|
-
children: /*#__PURE__*/ _jsx(NavLinks, {
|
|
104
|
-
links: links
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
}),
|
|
109
|
-
/*#__PURE__*/ _jsxs("aside", {
|
|
110
|
-
class: "hidden md:block md:w-48 md:shrink-0 md:sticky md:top-8 md:self-start",
|
|
111
|
-
children: [
|
|
112
|
-
/*#__PURE__*/ _jsx("a", {
|
|
113
|
-
href: "/",
|
|
114
|
-
class: "text-xl font-semibold block mb-20",
|
|
115
|
-
children: siteName
|
|
116
|
-
}),
|
|
117
|
-
/*#__PURE__*/ _jsx("nav", {
|
|
118
|
-
class: "flex flex-col gap-0.5",
|
|
119
|
-
children: /*#__PURE__*/ _jsx(NavLinks, {
|
|
120
|
-
links: links
|
|
121
|
-
})
|
|
122
|
-
})
|
|
123
|
-
]
|
|
124
|
-
}),
|
|
125
|
-
/*#__PURE__*/ _jsx("main", {
|
|
126
|
-
class: "flex-1 min-w-0",
|
|
127
|
-
children: children
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
});
|
|
131
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default Page Components
|
|
3
|
-
*
|
|
4
|
-
* These are the built-in page components that render each public page.
|
|
5
|
-
* Theme authors can import these to wrap/extend them.
|
|
6
|
-
*/ export { HomePage } from "./HomePage.js";
|
|
7
|
-
export { PostPage } from "./PostPage.js";
|
|
8
|
-
export { SinglePage } from "./SinglePage.js";
|
|
9
|
-
export { ArchivePage } from "./ArchivePage.js";
|
|
10
|
-
export { SearchPage } from "./SearchPage.js";
|
|
11
|
-
export { CollectionPage } from "./CollectionPage.js";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Article Card Component
|
|
3
|
-
*
|
|
4
|
-
* Prominent title + excerpt for type="article" posts.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { FC } from "hono/jsx";
|
|
8
|
-
import type { TimelineCardProps } from "../../../types.js";
|
|
9
|
-
|
|
10
|
-
export const ArticleCard: FC<TimelineCardProps> = ({ post, compact }) => {
|
|
11
|
-
return (
|
|
12
|
-
<article
|
|
13
|
-
class={`h-entry timeline-card${compact ? " timeline-card-compact" : ""}`}
|
|
14
|
-
>
|
|
15
|
-
{post.title && (
|
|
16
|
-
<h2
|
|
17
|
-
class={`p-name font-semibold ${compact ? "text-sm" : "text-lg"} mb-1`}
|
|
18
|
-
>
|
|
19
|
-
<a href={post.permalink} class="u-url hover:underline">
|
|
20
|
-
{post.title}
|
|
21
|
-
</a>
|
|
22
|
-
</h2>
|
|
23
|
-
)}
|
|
24
|
-
{!compact && post.excerpt && (
|
|
25
|
-
<p class="e-content text-sm text-muted-foreground line-clamp-3">
|
|
26
|
-
{post.excerpt}
|
|
27
|
-
</p>
|
|
28
|
-
)}
|
|
29
|
-
<footer class="mt-2 text-xs text-muted-foreground">
|
|
30
|
-
<a href={post.permalink} class="u-url hover:underline">
|
|
31
|
-
<time class="dt-published" datetime={post.publishedAt}>
|
|
32
|
-
{post.publishedAtFormatted}
|
|
33
|
-
</time>
|
|
34
|
-
</a>
|
|
35
|
-
{!compact && (
|
|
36
|
-
<span class="ml-2">
|
|
37
|
-
<a href={post.permalink} class="hover:underline">
|
|
38
|
-
Read more →
|
|
39
|
-
</a>
|
|
40
|
-
</span>
|
|
41
|
-
)}
|
|
42
|
-
</footer>
|
|
43
|
-
</article>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image Card Component
|
|
3
|
-
*
|
|
4
|
-
* Image-first layout for type="image" posts.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { FC } from "hono/jsx";
|
|
8
|
-
import type { TimelineCardProps } from "../../../types.js";
|
|
9
|
-
import { MediaGallery } from "../MediaGallery.js";
|
|
10
|
-
|
|
11
|
-
export const ImageCard: FC<TimelineCardProps> = ({ post, compact }) => {
|
|
12
|
-
if (compact) {
|
|
13
|
-
return (
|
|
14
|
-
<article class="h-entry timeline-card timeline-card-compact">
|
|
15
|
-
{post.title && (
|
|
16
|
-
<h2 class="p-name text-sm font-medium mb-1">
|
|
17
|
-
<a href={post.permalink} class="u-url hover:underline">
|
|
18
|
-
{post.title}
|
|
19
|
-
</a>
|
|
20
|
-
</h2>
|
|
21
|
-
)}
|
|
22
|
-
{post.contentHtml && (
|
|
23
|
-
<div
|
|
24
|
-
class="e-content prose prose-sm text-muted-foreground"
|
|
25
|
-
dangerouslySetInnerHTML={{ __html: post.contentHtml }}
|
|
26
|
-
/>
|
|
27
|
-
)}
|
|
28
|
-
<footer class="mt-1 text-xs text-muted-foreground">
|
|
29
|
-
<a href={post.permalink} class="u-url hover:underline">
|
|
30
|
-
<time class="dt-published" datetime={post.publishedAt}>
|
|
31
|
-
{post.publishedAtFormatted}
|
|
32
|
-
</time>
|
|
33
|
-
</a>
|
|
34
|
-
</footer>
|
|
35
|
-
</article>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<article class="h-entry timeline-card timeline-card-image">
|
|
41
|
-
{post.media.length > 0 && (
|
|
42
|
-
<div class="timeline-card-image-gallery">
|
|
43
|
-
<MediaGallery attachments={post.media} />
|
|
44
|
-
</div>
|
|
45
|
-
)}
|
|
46
|
-
<div class="p-4">
|
|
47
|
-
{post.title && (
|
|
48
|
-
<h2 class="p-name font-medium mb-1">
|
|
49
|
-
<a href={post.permalink} class="u-url hover:underline">
|
|
50
|
-
{post.title}
|
|
51
|
-
</a>
|
|
52
|
-
</h2>
|
|
53
|
-
)}
|
|
54
|
-
{post.contentHtml && (
|
|
55
|
-
<div
|
|
56
|
-
class="e-content prose prose-sm"
|
|
57
|
-
dangerouslySetInnerHTML={{ __html: post.contentHtml }}
|
|
58
|
-
/>
|
|
59
|
-
)}
|
|
60
|
-
<footer class="mt-2 text-xs text-muted-foreground">
|
|
61
|
-
<a href={post.permalink} class="u-url hover:underline">
|
|
62
|
-
<time class="dt-published" datetime={post.publishedAt}>
|
|
63
|
-
{post.publishedAtFormatted}
|
|
64
|
-
</time>
|
|
65
|
-
</a>
|
|
66
|
-
</footer>
|
|
67
|
-
</div>
|
|
68
|
-
</article>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Link Card Component
|
|
3
|
-
*
|
|
4
|
-
* External link emphasis for type="link" posts.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { FC } from "hono/jsx";
|
|
8
|
-
import type { TimelineCardProps } from "../../../types.js";
|
|
9
|
-
|
|
10
|
-
export const LinkCard: FC<TimelineCardProps> = ({ post, compact }) => {
|
|
11
|
-
return (
|
|
12
|
-
<article
|
|
13
|
-
class={`h-entry timeline-card timeline-card-link${compact ? " timeline-card-compact" : ""}`}
|
|
14
|
-
>
|
|
15
|
-
{post.sourceDomain && (
|
|
16
|
-
<div class="text-xs text-muted-foreground mb-1 flex items-center gap-1">
|
|
17
|
-
<svg
|
|
18
|
-
class="size-3"
|
|
19
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
-
fill="none"
|
|
21
|
-
viewBox="0 0 24 24"
|
|
22
|
-
stroke-width="2"
|
|
23
|
-
stroke="currentColor"
|
|
24
|
-
>
|
|
25
|
-
<path d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25" />
|
|
26
|
-
</svg>
|
|
27
|
-
<span>{post.sourceDomain}</span>
|
|
28
|
-
</div>
|
|
29
|
-
)}
|
|
30
|
-
{post.title && (
|
|
31
|
-
<h2
|
|
32
|
-
class={`p-name font-semibold ${compact ? "text-sm" : "text-base"} mb-1`}
|
|
33
|
-
>
|
|
34
|
-
<a
|
|
35
|
-
href={post.sourceUrl || post.permalink}
|
|
36
|
-
class="u-url hover:underline"
|
|
37
|
-
target={post.sourceUrl ? "_blank" : undefined}
|
|
38
|
-
rel={post.sourceUrl ? "noopener noreferrer" : undefined}
|
|
39
|
-
>
|
|
40
|
-
{post.title}
|
|
41
|
-
</a>
|
|
42
|
-
</h2>
|
|
43
|
-
)}
|
|
44
|
-
{!compact && post.contentHtml && (
|
|
45
|
-
<div
|
|
46
|
-
class="e-content prose prose-sm text-muted-foreground"
|
|
47
|
-
dangerouslySetInnerHTML={{ __html: post.contentHtml }}
|
|
48
|
-
/>
|
|
49
|
-
)}
|
|
50
|
-
<footer class="mt-2 text-xs text-muted-foreground">
|
|
51
|
-
<a href={post.permalink} class="hover:underline">
|
|
52
|
-
<time class="dt-published" datetime={post.publishedAt}>
|
|
53
|
-
{post.publishedAtFormatted}
|
|
54
|
-
</time>
|
|
55
|
-
</a>
|
|
56
|
-
</footer>
|
|
57
|
-
</article>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { NoteCard } from "./NoteCard.js";
|
|
2
|
-
export { ArticleCard } from "./ArticleCard.js";
|
|
3
|
-
export { LinkCard } from "./LinkCard.js";
|
|
4
|
-
export { QuoteCard } from "./QuoteCard.js";
|
|
5
|
-
export { ImageCard } from "./ImageCard.js";
|
|
6
|
-
export { ThreadPreview } from "./ThreadPreview.js";
|
|
7
|
-
export { TimelineItem, TimelineItemFromPost } from "./TimelineItem.js";
|
|
8
|
-
export { TimelineFeed } from "./TimelineFeed.js";
|