-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c54da46
commit 5499231
Showing
15 changed files
with
78 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { db, WaitingList } from "astro:db"; | ||
|
||
// https://astro.build/db/seed | ||
export default async function seed() { | ||
export default async () => { | ||
await db | ||
.insert(WaitingList) | ||
.values([ | ||
{ email: "[email protected]" }, | ||
{ email: "[email protected]" }, | ||
]); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import * as React from "react"; | ||
|
||
export function useMounted() { | ||
export const useMounted = () => { | ||
const [mounted, setMounted] = React.useState(false); | ||
|
||
React.useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
return mounted; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import { getCollection } from "astro:content"; | ||
|
||
export async function getCategories() { | ||
export const getCategories = async () => { | ||
const posts = await getCollection("blog"); | ||
const categories = [ | ||
...new Set(posts.map((post) => post.data.category).flat()), | ||
]; | ||
|
||
return categories; | ||
} | ||
}; | ||
|
||
export async function getPosts() { | ||
export const getPosts = async () => { | ||
const posts = (await getCollection("blog")).sort( | ||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(), | ||
); | ||
|
||
return posts; | ||
} | ||
}; | ||
|
||
export async function getPostsByCategory(category: string) { | ||
export const getPostsByCategory = async (category: string) => { | ||
const posts = (await getCollection("blog")) | ||
.filter((post) => post.data.category.includes(category)) | ||
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); | ||
|
||
return posts; | ||
} | ||
}; | ||
|
||
export async function getGuides() { | ||
export const getGuides = async () => { | ||
const guides = (await getCollection("guides")) | ||
.filter((guide) => guide.data.published) | ||
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); | ||
|
||
return guides; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.