mirror of
https://github.com/Fluffy-Bean/website.git
synced 2024-12-26 17:36:12 +00:00
Merge pull request #15 from Fluffy-Bean/deepsource-transform-7ae81505
style: format code with Prettier
This commit is contained in:
commit
0085442251
|
@ -26,8 +26,8 @@ const tags = defineCollection({
|
|||
type: "content",
|
||||
schema: z.object({
|
||||
name: z.string(),
|
||||
})
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = {
|
||||
posts,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
name: "Math"
|
||||
---
|
||||
``
|
||||
|
||||
``
|
||||
|
|
12
src/utils.ts
12
src/utils.ts
|
@ -1,4 +1,8 @@
|
|||
import {type CollectionEntry, type ContentEntryMap, getCollection} from "astro:content";
|
||||
import {
|
||||
type CollectionEntry,
|
||||
type ContentEntryMap,
|
||||
getCollection,
|
||||
} from "astro:content";
|
||||
|
||||
// https://github.com/hellotham/hello-astro/blob/e05706cf488bcec6e4c5494a622eedfc4e47d763/src/config.ts#L55C1-L62C2
|
||||
export async function getPosts(collection: keyof ContentEntryMap) {
|
||||
|
@ -44,7 +48,9 @@ export function getDaySuffix(date: Date): string {
|
|||
return suffix;
|
||||
}
|
||||
|
||||
export async function getTagsBySlug(postTags: string[]): Promise<CollectionEntry<"tags">[]> {
|
||||
export async function getTagsBySlug(
|
||||
postTags: string[],
|
||||
): Promise<CollectionEntry<"tags">[]> {
|
||||
const allTags: CollectionEntry<"tags">[] = await getCollection("tags");
|
||||
const tags: CollectionEntry<"tags">[] = [];
|
||||
postTags.forEach((postTag) => {
|
||||
|
@ -53,4 +59,4 @@ export async function getTagsBySlug(postTags: string[]): Promise<CollectionEntry
|
|||
});
|
||||
});
|
||||
return tags;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue