1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 01:41:19 -04:00

fix sitemap.xml timeouts

This commit is contained in:
2022-07-06 03:32:55 -04:00
parent 0f38ab4f0a
commit 8d47958473
5 changed files with 32 additions and 35 deletions

View File

@@ -3,14 +3,10 @@ import Content from "../../components/Content";
import NotesList from "../../components/NotesList";
import { getAllNotes } from "../../lib/helpers/parse-notes";
import { authorName } from "../../lib/config";
import type { GetStaticProps } from "next";
import type { GetStaticProps, InferGetStaticPropsType } from "next";
import type { NotesByYear } from "../../types";
type StaticProps = {
notesByYear: NotesByYear;
};
const Notes = ({ notesByYear }: StaticProps) => {
const Notes = ({ notesByYear }: InferGetStaticPropsType<typeof getStaticProps>) => {
return (
<>
<NextSeo
@@ -28,7 +24,9 @@ const Notes = ({ notesByYear }: StaticProps) => {
);
};
export const getStaticProps: GetStaticProps<StaticProps> = async () => {
export const getStaticProps: GetStaticProps<{
notesByYear: NotesByYear;
}> = async () => {
// parse the year of each note and group them together
const notes = await getAllNotes();
const notesByYear: NotesByYear = {};