Skip to content

Commit 209cad7

Browse files
committed
Some fixes
1 parent 1de4f61 commit 209cad7

File tree

14 files changed

+766
-72
lines changed

14 files changed

+766
-72
lines changed

.velite/hobbies.json

Lines changed: 92 additions & 1 deletion
Large diffs are not rendered by default.

.velite/options.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
{"name":"Li Yuxuan","title":"Li Yuxuan","description":"Li Yuxuan's personal website","keywords":["Li Yuxuan","portfolio","personal website","projects","hobbies","posts","photography","film","books","music"],"author":{"name":"Li Yuxuan","email":"me@liyuxuan.ev","url":"https://liyuxuan.dev/about"}}
1+
{
2+
"name": "Li Yuxuan",
3+
"title": "Li Yuxuan",
4+
"description": "Li Yuxuan's personal website",
5+
"keywords": [
6+
"Li Yuxuan",
7+
"portfolio",
8+
"personal website",
9+
"projects",
10+
"hobbies",
11+
"posts",
12+
"photography",
13+
"film",
14+
"books",
15+
"music"
16+
],
17+
"author": {
18+
"name": "Li Yuxuan",
19+
"email": "me@liyuxuan.ev",
20+
"url": "https://liyuxuan.dev/about"
21+
}
22+
}

.velite/pages.json

Lines changed: 141 additions & 1 deletion
Large diffs are not rendered by default.

.velite/posts.json

Lines changed: 375 additions & 1 deletion
Large diffs are not rendered by default.

.velite/tags.json

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
1-
[{"name":"edtech","slug":"edtech","count":{"total":7,"posts":7},"permalink":"tags/edtech"},{"name":"taboo-ai","slug":"taboo-ai","permalink":"tags/taboo-ai","count":{"total":1,"posts":1}},{"name":"english-learning","slug":"english-learning","permalink":"tags/english-learning","count":{"total":1,"posts":1}},{"name":"ai","slug":"ai","permalink":"tags/ai","count":{"total":2,"posts":2}}]
1+
[
2+
{
3+
"name": "edtech",
4+
"slug": "edtech",
5+
"count": {
6+
"total": 7,
7+
"posts": 7
8+
},
9+
"permalink": "tags/edtech"
10+
},
11+
{
12+
"name": "taboo-ai",
13+
"slug": "taboo-ai",
14+
"permalink": "tags/taboo-ai",
15+
"count": {
16+
"total": 1,
17+
"posts": 1
18+
}
19+
},
20+
{
21+
"name": "english-learning",
22+
"slug": "english-learning",
23+
"permalink": "tags/english-learning",
24+
"count": {
25+
"total": 1,
26+
"posts": 1
27+
}
28+
},
29+
{
30+
"name": "ai",
31+
"slug": "ai",
32+
"permalink": "tags/ai",
33+
"count": {
34+
"total": 2,
35+
"posts": 2
36+
}
37+
}
38+
]

app/posts/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Fragment } from 'react';
12
import { Metadata } from 'next';
23
import pluralize from 'pluralize';
34

@@ -36,14 +37,14 @@ export default async function PostsPage() {
3637
});
3738

3839
return (
39-
<article className='prose prose-stone flex flex-col gap-12 dark:prose-invert'>
40+
<article className='prose prose-stone dark:prose-invert flex flex-col gap-12'>
4041
<h1 className='group relative'>
4142
posts ({pluralize('post', posts.length, true)})
4243
<ShadowSubtitle>碎碎念</ShadowSubtitle>
4344
</h1>
4445
<div className='flex flex-col gap-y-3'>
4546
{sortedPosts.map((post, index) => (
46-
<>
47+
<Fragment key={post.slug}>
4748
{index > 0 && <hr className='my-1' />}
4849
<PostCard
4950
key={post.slug}
@@ -52,7 +53,7 @@ export default async function PostsPage() {
5253
postViews.find((view) => view.slug === post.slug)?.view ?? 0
5354
}
5455
/>
55-
</>
56+
</Fragment>
5657
))}
5758
</div>
5859
</article>

app/posts/post-card.tsx

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,31 @@ type PostCardProps = {
1010

1111
export function PostCard({ post, views }: PostCardProps) {
1212
return (
13-
<Link href={`/posts/${post.slug}`} className='group relative'>
14-
<article className='flex flex-col gap-y-2 transition-transform hover:scale-105'>
15-
<div className='flex items-start justify-between gap-4'>
16-
<h3 className='mb-1 mt-0 text-base font-semibold'>{post.title}</h3>
17-
<time className='flex flex-col items-end text-xs text-muted-foreground *:whitespace-nowrap'>
18-
<span>{format(post.date, 'do LLLL')}</span>
19-
<span>{format(post.date, 'yyyy')}</span>
20-
</time>
13+
<article className='flex flex-col gap-y-2'>
14+
<div className='flex items-start justify-between gap-4'>
15+
<Link href={`/posts/${post.slug}`} className='group relative'>
16+
<h3 className='hover:text-foreground text-foreground sm:text-muted-foreground mt-0 mb-1 text-base font-semibold transition-colors'>
17+
{post.title}
18+
</h3>
19+
</Link>
20+
<time className='text-muted-foreground flex flex-col items-end text-xs *:whitespace-nowrap'>
21+
<span>{format(post.date, 'do LLLL')}</span>
22+
<span>{format(post.date, 'yyyy')}</span>
23+
</time>
24+
</div>
25+
<p className='text-sm font-normal after:[content:_"..."]'>
26+
{post.excerpt}
27+
</p>
28+
<div className='flex flex-row items-center justify-between gap-4'>
29+
<div className='flex flex-row flex-wrap gap-2'>
30+
{post.tags.map((tag) => (
31+
<CustomBadgeLink key={tag} href={`/tags/${tag}`}>
32+
{tag}
33+
</CustomBadgeLink>
34+
))}
2135
</div>
22-
<p className='text-sm font-normal after:[content:_"..."]'>
23-
{post.excerpt}
24-
</p>
25-
<div className='flex flex-row items-center justify-between gap-4'>
26-
<div className='flex flex-row flex-wrap gap-2'>
27-
{post.tags.map((tag) => (
28-
<CustomBadgeLink key={tag} href={`/tags/${tag}`}>
29-
{tag}
30-
</CustomBadgeLink>
31-
))}
32-
</div>
33-
<p className='text-xs text-muted-foreground'>{views} views</p>
34-
</div>
35-
</article>
36-
</Link>
36+
<p className='text-muted-foreground text-xs'>{views} views</p>
37+
</div>
38+
</article>
3739
);
3840
}

components/custom/toc/floating-toc-drawer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export function FloatingTOCDrawer(props: FloatingTOCDrawerProps) {
2929
return (
3030
<>
3131
<a
32-
key={heading.url}
32+
key={`${heading.url}_${indents}`}
3333
href={`#${slugify(heading.title)}`}
3434
className={cn(
35-
'rounded-lg p-2 text-left text-xs text-secondary-foreground transition-colors',
35+
'text-secondary-foreground rounded-lg p-2 text-left text-xs transition-colors',
3636
'hover:bg-secondary',
3737
isAtCurrentTOC(hash, heading.title)
3838
? 'bg-secondary font-semibold'

components/mdx-content.tsx

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import * as runtime from 'react/jsx-runtime';
2-
import Image from 'next/image';
32
import Link from 'next/link';
43

54
import { slugify } from '@/lib/utils';
65

7-
import { AspectRatio } from './ui/aspect-ratio';
86
import { BackToTopLink } from './ui/back-to-top-link';
97
import { BadgeGroup } from './ui/badge-group';
108
import { BookGrid } from './ui/book-grid';
119
import { CopyablePre } from './ui/copyable-pre';
1210
import { CustomLink } from './ui/custom-link';
1311
import { ExternalActionButtonLink } from './ui/external-action-button-link';
1412
import { FilmGrid } from './ui/film-grid';
15-
import { HoverPerspectiveContainer } from './ui/hover-perspective-container';
13+
import { ImagePerspectiveLink } from './ui/image-perspective-link';
1614
import { LoadMoreLinks } from './ui/load-more-links';
1715
import { PhotoBentoGrid } from './ui/photo-bento-grid';
1816
import { Ratings } from './ui/ratings';
@@ -37,7 +35,7 @@ export function MDXContent({ code, components }: MdxProps) {
3735
<h1 {...props}>
3836
<a
3937
id={slugify(props.children)}
40-
className='relative -top-[calc(100vh/3)] block max-h-1 w-32 [visibility:hidden]'
38+
className='[visibility:hidden] relative -top-[calc(100vh/3)] block max-h-1 w-32'
4139
>
4240
{props.children}
4341
</a>
@@ -48,7 +46,7 @@ export function MDXContent({ code, components }: MdxProps) {
4846
<h2 {...props}>
4947
<a
5048
id={slugify(props.children)}
51-
className='relative -top-[calc(100vh/3)] block max-h-1 w-32 [visibility:hidden]'
49+
className='[visibility:hidden] relative -top-[calc(100vh/3)] block max-h-1 w-32'
5250
>
5351
{props.children}
5452
</a>
@@ -59,7 +57,7 @@ export function MDXContent({ code, components }: MdxProps) {
5957
<h3 {...props}>
6058
<a
6159
id={slugify(props.children)}
62-
className='relative -top-[calc(100vh/3)] block max-h-1 w-32 [visibility:hidden]'
60+
className='[visibility:hidden] relative -top-[calc(100vh/3)] block max-h-1 w-32'
6361
>
6462
{props.children}
6563
</a>
@@ -70,29 +68,13 @@ export function MDXContent({ code, components }: MdxProps) {
7068
<h4 {...props}>
7169
<a
7270
id={slugify(props.children)}
73-
className='relative -top-[calc(100vh/3)] block max-h-1 w-32 [visibility:hidden]'
71+
className='[visibility:hidden] relative -top-[calc(100vh/3)] block max-h-1 w-32'
7472
>
7573
{props.children}
7674
</a>
7775
{props.children}
7876
</h4>
7977
),
80-
img: (props: any) => (
81-
<HoverPerspectiveContainer>
82-
<AspectRatio ratio={3 / 2}>
83-
<Image
84-
className='m-0 h-full w-full'
85-
src={props.src}
86-
alt={props.alt}
87-
width={200}
88-
height={200}
89-
style={{ objectFit: 'cover', objectPosition: 'center' }}
90-
unoptimized
91-
{...props}
92-
/>
93-
</AspectRatio>
94-
</HoverPerspectiveContainer>
95-
),
9678
a: (props: any) => (
9779
<CustomLink href={props.href} {...props}>
9880
{props.children}
@@ -110,6 +92,7 @@ export function MDXContent({ code, components }: MdxProps) {
11092
BookGrid,
11193
Ratings,
11294
Link,
95+
ImagePerspectiveLink,
11396
}}
11497
/>
11598
);

components/ui/hover-perspective-container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function HoverPerspectiveContainer({
2121
return (
2222
<div
2323
className={cn(
24-
'group relative transform overflow-hidden rounded-lg shadow-lg outline outline-[1px] outline-border transition-[transoform_border_box-shadow] duration-300 ease-out',
24+
'group outline-border relative transform overflow-hidden rounded-lg shadow-lg outline transition-[transoform_border_box-shadow] duration-300 ease-out',
2525
className
2626
)}
2727
onMouseEnter={(event) => {

0 commit comments

Comments
 (0)