mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-21 01:41:19 -04:00
fs
-> fs/promises
-> asyncify all note parsing
This commit is contained in:
@@ -22,9 +22,10 @@ const Notes = ({ notesByYear }: NotesListProps) => (
|
||||
|
||||
export const getStaticProps: GetStaticProps = async () => {
|
||||
// parse the year of each note and group them together
|
||||
const notes = await getAllNotes();
|
||||
const notesByYear: NotesListProps["notesByYear"] = {};
|
||||
|
||||
getAllNotes().map((note) => {
|
||||
notes.map((note) => {
|
||||
const year = new Date(note.date).getUTCFullYear();
|
||||
(notesByYear[year] || (notesByYear[year] = [])).push(note);
|
||||
});
|
||||
|
Reference in New Issue
Block a user