Skip to content

Commit 3aef627

Browse files
committed
update astro to 5
1 parent 8b09b9d commit 3aef627

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/layouts/IndexLayout.astro

+4-5
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ function border(post: Post) {
3535
}
3636
3737
function star(post: Post) {
38-
return (
39-
"w-3.5 text-[10px] leading-3 pt-[2px] rounded text-center " +
40-
(post.data.level >= 3
38+
const bgColor =
39+
post.data.level >= 3
4140
? "bg-fuchsia-500"
4241
: post.data.level === 2
4342
? "bg-orange-500"
4443
: post.data.level === 1
4544
? "bg-blue-500"
46-
: "bg-blue-100")
47-
);
45+
: "bg-blue-100";
46+
return `w-3.5 text-[10px] leading-3 pt-[2px] rounded text-center ${bgColor}`;
4847
}
4948
---
5049

src/utils/content.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
22
type CollectionEntry,
3-
type ContentEntryMap,
3+
type DataEntryMap,
44
getCollection,
55
} from "astro:content";
66

7-
export type Collection = keyof ContentEntryMap;
7+
export type Collection = keyof DataEntryMap;
88
export type Post = CollectionEntry<Collection>;
99
export type Tag = string;
1010
export type TagItem = [Tag, number];
@@ -17,7 +17,7 @@ export async function getPosts(collection: Collection) {
1717
);
1818
}
1919

20-
export function getTags(posts: Post[], all: boolean = false) {
20+
export function getTags(posts: Post[], all = false) {
2121
const res = [
2222
...posts.reduce(
2323
(map, post) =>
@@ -34,7 +34,7 @@ export function getTags(posts: Post[], all: boolean = false) {
3434
return res;
3535
}
3636

37-
export function getLevels(posts: Post[], all: boolean = false) {
37+
export function getLevels(posts: Post[], all = false) {
3838
const res = [
3939
...posts.reduce(
4040
(map, post) =>

0 commit comments

Comments
 (0)