mirror of
https://github.com/Fluffy-Bean/website.git
synced 2024-12-28 02:16:10 +00:00
style: format code with Prettier
This commit fixes the style issues introduced in 5228c0e
according to the output
from Prettier.
Details: https://github.com/Fluffy-Bean/website/pull/3
This commit is contained in:
parent
5228c0e1d0
commit
e835b2aa2c
12
src/utils.ts
12
src/utils.ts
|
@ -3,9 +3,11 @@ import { 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) {
|
||||
const posts = await getCollection(collection, ({ data }) => {
|
||||
return data.draft !== true
|
||||
})
|
||||
return data.draft !== true;
|
||||
});
|
||||
return posts.sort((a, b) =>
|
||||
a.data.pubDate && b.data.pubDate ? Number(b.data.pubDate) - Number(a.data.pubDate) : 0
|
||||
)
|
||||
}
|
||||
a.data.pubDate && b.data.pubDate
|
||||
? Number(b.data.pubDate) - Number(a.data.pubDate)
|
||||
: 0,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue