Compare commits

..

No commits in common. "isr-pages" and "main" have entirely different histories.

2 changed files with 3 additions and 22 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "www-aaronjy-me",
"version": "2.1.2",
"version": "2.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "www-aaronjy-me",
"version": "2.1.2",
"version": "2.1.1",
"dependencies": {
"@highlightjs/cdn-assets": "^11.11.1",
"@mdx-js/mdx": "^3.1.0",

View file

@ -9,25 +9,7 @@ import { MDXClient } from "next-mdx-remote-client";
import { serialize } from "next-mdx-remote-client/serialize";
import { NextSeo } from "next-seo";
export async function getStaticPaths() {
const res = await fetchBasicPages();
if (!res.ok) {
throw new FailedFetchBasicPagesError();
}
const pages = (await res.json()).data;
const paths = pages.map((page) => {
return {
params: {
path: page.path?.split("/") ?? [],
},
};
});
return { paths, fallback: false };
}
export async function getStaticProps({ params }) {
export async function getServerSideProps({ params }) {
const { path } = params;
const res = await fetchBasicPages([], {
path: {
@ -55,7 +37,6 @@ export async function getStaticProps({ params }) {
title,
mdxSource,
},
revalidate: 60,
};
}