Skip to content

Commit c88a2d0

Browse files
committed
update
1 parent 67be51a commit c88a2d0

File tree

2 files changed

+38
-42
lines changed

2 files changed

+38
-42
lines changed

src/cards/article.astro

+8-13
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,21 @@ import type { CollectionEntry } from "astro:content";
33
import FormattedDate from "../components/FormattedDate.astro";
44
55
interface Props {
6-
data: CollectionEntry<"xyy">["data"];
7-
width?: string;
8-
height?: string;
6+
data: CollectionEntry<"xyy">["data"];
7+
width?: string;
8+
height?: string;
99
}
1010
1111
const {
12-
data: { title, subTitle, tags, level, pubDate, updatedDate, heroImage },
13-
width = "512px",
14-
height = "512px",
12+
data: { title, subTitle, tags, level, pubDate, updatedDate, heroImage },
13+
width = "512px",
14+
height = "512px",
1515
} = Astro.props;
1616
---
1717

1818
<article style={{ width, height, overflow: "auto" }}>
1919
<div class="hero-image">
20-
{
21-
heroImage && (
22-
<img width={1020} height={510} src={heroImage} alt="" />
23-
)
24-
}
20+
{heroImage && <img width={1020} height={510} src={heroImage} alt="" />}
2521
</div>
2622
<div class="prose">
2723
<div class="title">
@@ -50,7 +46,6 @@ const {
5046
</div>
5147
</article>
5248

53-
5449
<style>
5550
.hero-image {
5651
width: 100%;
@@ -75,4 +70,4 @@ const {
7570
margin-bottom: 0.5em;
7671
color: rgb(var(--gray));
7772
}
78-
</style>
73+
</style>

src/cards/list-item.astro

+30-29
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,44 @@ import FormattedDate from "../components/FormattedDate.astro";
33
import { type Collection, type Post } from "../utils/content";
44
55
interface Props {
6-
collection: Collection;
7-
post: Post;
8-
index: number;
9-
width?: string;
10-
height?: string;
6+
collection: Collection;
7+
post: Post;
8+
index: number;
9+
width?: string;
10+
height?: string;
1111
}
1212
1313
const {
14-
collection,
15-
post,
16-
index,
17-
width = "128px",
18-
height = "128px",
14+
collection,
15+
post,
16+
index,
17+
width = "128px",
18+
height = "128px",
1919
} = Astro.props;
2020
2121
function border(post: Post) {
22-
return [
23-
post.data.level >= 2 ? "border-2 border-double" : "border border-solid",
24-
post.data.level >= 3
25-
? "border-fuchsia-500"
26-
: post.data.level === 2
27-
? "border-orange-500"
28-
: post.data.level === 1
29-
? "border-green-500"
30-
: "border-blue-200",
31-
];
22+
return [
23+
post.data.level >= 2 ? "border-2 border-double" : "border border-solid",
24+
post.data.level >= 3
25+
? "border-fuchsia-500"
26+
: post.data.level === 2
27+
? "border-orange-500"
28+
: post.data.level === 1
29+
? "border-green-500"
30+
: "border-blue-200",
31+
];
3232
}
3333
3434
function star(post: Post) {
35-
const bgColor =
36-
post.data.level >= 3
37-
? "bg-fuchsia-500"
38-
: post.data.level === 2
39-
? "bg-orange-500"
40-
: post.data.level === 1
41-
? "bg-green-500"
42-
: "bg-blue-200";
43-
return `w-3.5 text-[10px] leading-3 pt-[2px] rounded text-center ${bgColor}`;
35+
const bgColor =
36+
post.data.level >= 3
37+
? "bg-fuchsia-500"
38+
: post.data.level === 2
39+
? "bg-orange-500"
40+
: post.data.level === 1
41+
? "bg-green-500"
42+
: "bg-blue-200";
43+
return `w-3.5 text-[10px] leading-3 pt-[2px] rounded text-center ${bgColor}`;
4444
}
4545
---
4646

@@ -54,6 +54,7 @@ function star(post: Post) {
5454
{
5555
post.data.updatedDate && (
5656
<>
57+
<br />
5758
↻<FormattedDate date={post.data.updatedDate} />
5859
</>
5960
)

0 commit comments

Comments
 (0)