Skip to content

Commit bc1aaa1

Browse files
committed
Merge branch 'main' into staging
2 parents c4e1ad0 + a01e3ba commit bc1aaa1

File tree

6 files changed

+36
-126
lines changed

6 files changed

+36
-126
lines changed

apps/docs/app/(home)/blog/[slug]/page.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import { SciFiButton } from '@/components/landing/scifi-btn';
1515
import { Prose } from '@/components/prose';
1616
import { SciFiCard } from '@/components/scifi-card';
1717
import { getPosts, getSinglePost } from '@/lib/blog-query';
18-
import type { Post } from '@/types/post';
18+
import type { Post } from '@usemarble/core';
19+
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
1920

2021
const STRIP_HTML_REGEX = /<[^>]+>/g;
2122
const WORD_SPLIT_REGEX = /\s+/;
@@ -107,7 +108,6 @@ export default async function PostPage({
107108
return (
108109
<>
109110
<div className="relative flex min-h-[60vh] w-full items-center justify-center overflow-hidden px-4 pt-10 sm:px-6 sm:pt-12 lg:px-8">
110-
{/* Main Content */}
111111
<div className="relative z-10 mx-auto w-full max-w-lg text-center">
112112
<SciFiCard>
113113
<div className="relative rounded border border-border bg-card/50 p-8 backdrop-blur-sm transition-all duration-300 hover:border-border/80 hover:bg-card/70 sm:p-12">
@@ -163,32 +163,34 @@ export default async function PostPage({
163163
Back to blog
164164
</Link>
165165
</div>
166-
{/* Title */}
166+
167167
<h1 className="mb-3 text-balance font-semibold text-3xl leading-tight tracking-tight sm:text-4xl md:text-5xl">
168168
{post.title}
169169
</h1>
170170

171-
{/* Metadata */}
172171
<div className="mb-4 flex flex-wrap items-center gap-4 text-muted-foreground text-xs sm:text-sm">
173172
<div className="flex items-center gap-2">
174173
<UserIcon className="h-4 w-4" weight="duotone" />
175174
<div className="-space-x-2 flex">
176175
{post.authors.slice(0, 3).map((author) => (
177-
<Image
178-
alt={author.name}
179-
className="h-6 w-6 rounded border-2 border-background"
180-
height={24}
181-
key={author.id}
182-
src={author.image}
183-
width={24}
184-
/>
176+
<Avatar className="size-6 rounded border-2 border-background" key={author.id}>
177+
<AvatarImage src={author.image ?? undefined} alt={author.name} />
178+
<AvatarFallback>{author.name[0]}</AvatarFallback>
179+
</Avatar>
185180
))}
186181
</div>
187-
<span>
188-
{post.authors.length === 1
189-
? post.authors[0].name
190-
: `${post.authors[0].name} +${post.authors.length - 1}`}
191-
</span>
182+
{post.authors[0]?.socials?.[0]?.url ? (
183+
<Link href={post.authors[0].socials[0].url} target='_blank' rel='noopener noreferrer'>
184+
<span>
185+
{post.authors[0].name}
186+
</span>
187+
</Link>
188+
) : (
189+
<span>{post.authors[0].name}</span>
190+
)}
191+
{post.authors.length > 1 && (
192+
<span> +{post.authors.length - 1}</span>
193+
)}
192194
</div>
193195
<div className="flex items-center gap-2">
194196
<CalendarIcon className="h-4 w-4" weight="duotone" />

apps/docs/app/(home)/blog/page.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import { Spotlight } from '@/components/landing/spotlight';
1414
import { SciFiCard } from '@/components/scifi-card';
1515
import { StructuredData } from '@/components/structured-data';
1616
import { getPosts } from '@/lib/blog-query';
17-
import type { Post } from '@/types/post';
17+
import type { Post } from '@usemarble/core';
18+
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
1819

1920
export const revalidate = 3600;
2021

@@ -131,14 +132,10 @@ function BlogPostCard({ post }: { post: Post }) {
131132
/>
132133
<div className="-space-x-2 flex">
133134
{post.authors.slice(0, 2).map((author) => (
134-
<Image
135-
alt={author.name}
136-
className="h-6 w-6 rounded-full border-2 border-background"
137-
height={24}
138-
key={author.id}
139-
src={author.image}
140-
width={24}
141-
/>
135+
<Avatar className="size-6 rounded border-2 border-background" key={author.id}>
136+
<AvatarImage src={author.image ?? undefined} alt={author.name} />
137+
<AvatarFallback>{author.name[0]}</AvatarFallback>
138+
</Avatar>
142139
))}
143140
</div>
144141
<span className="text-muted-foreground text-xs">

apps/docs/lib/blog-query.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { cache } from 'react';
2-
31
import type {
4-
MarbleAuthorList,
5-
MarbleCategoryList,
6-
MarblePost,
7-
MarblePostList,
8-
MarbleTagList,
9-
} from '@/types/post';
2+
MarbleAuthorList,
3+
MarbleCategoryList,
4+
MarblePost,
5+
MarblePostList,
6+
MarbleTagList,
7+
} from "@usemarble/core";
8+
import { cache } from "react";
109

1110
type FetchError = { error: true; status: number; statusText: string };
1211

apps/docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@radix-ui/react-tooltip": "^1.2.7",
4343
"@radix-ui/react-use-controllable-state": "^1.2.2",
4444
"@shikijs/transformers": "^3.9.2",
45+
"@usemarble/core": "^0.1.3",
4546
"class-variance-authority": "catalog:",
4647
"clsx": "catalog:",
4748
"cmdk": "^1.1.1",

apps/docs/types/post.ts

Lines changed: 0 additions & 92 deletions
This file was deleted.

bun.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@
228228
"@radix-ui/react-tooltip": "^1.2.7",
229229
"@radix-ui/react-use-controllable-state": "^1.2.2",
230230
"@shikijs/transformers": "^3.9.2",
231+
"@usemarble/core": "^0.1.3",
231232
"class-variance-authority": "catalog:",
232233
"clsx": "catalog:",
233234
"cmdk": "^1.1.1",
@@ -1440,6 +1441,8 @@
14401441

14411442
"@upstash/redis": ["@upstash/[email protected]", "", { "dependencies": { "uncrypto": "^0.1.3" } }, "sha512-aSEIGJgJ7XUfTYvhQcQbq835re7e/BXjs8Janq6Pvr6LlmTZnyqwT97RziZLO/8AVUL037RLXqqiQC6kCt+5pA=="],
14421443

1444+
"@usemarble/core": ["@usemarble/[email protected]", "", { "dependencies": { "zod": "^4.1.11" } }, "sha512-ofcprXlIDTfEEGKmLd8Ph8eQ4Z0OoNhQHkE0wfM7O6SadxbhZzKxVS1F+YaladqlEqD696s7AwKIW53bMU0g4g=="],
1445+
14431446
"@vercel/oidc": ["@vercel/[email protected]", "", {}, "sha512-yNEQvPcVrK9sIe637+I0jD6leluPxzwJKx/Haw6F4H77CdDsszUn5V3o96LPziXkSNE2B83+Z3mjqGKBK/R6Gg=="],
14441447

14451448
"@vitejs/plugin-react": ["@vitejs/[email protected]", "", { "dependencies": { "@babel/core": "^7.28.4", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-beta.38", "@types/babel__core": "^7.20.5", "react-refresh": "^0.17.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-La0KD0vGkVkSk6K+piWDKRUyg8Rl5iAIKRMH0vMJI0Eg47bq1eOxmoObAaQG37WMW9MSyk7Cs8EIWwJC1PtzKA=="],

0 commit comments

Comments
 (0)