Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2a2e9005fd |
15 changed files with 103 additions and 187 deletions
|
@ -1,15 +1,13 @@
|
|||
const fs = require("fs");
|
||||
const fm = require("front-matter");
|
||||
|
||||
const siteUrl = process.env.SITE_URL || "https://www.aaronjy.me";
|
||||
/** @type {import('next-sitemap').IConfig} */
|
||||
module.exports = {
|
||||
siteUrl,
|
||||
siteUrl: process.env.SITE_URL || "https://www.aaronjy.me",
|
||||
changefreq: "weekly",
|
||||
generateRobotsTxt: true,
|
||||
autoLastmod: false,
|
||||
generateIndexSitemap: false,
|
||||
exclude: ["/server-sitemap-index.xml"], // <= exclude here
|
||||
robotsTxtOptions: {
|
||||
policies: [
|
||||
{
|
||||
|
@ -17,25 +15,30 @@ module.exports = {
|
|||
allow: "/",
|
||||
},
|
||||
],
|
||||
additionalSitemaps: [
|
||||
`${siteUrl}/server-sitemap-index.xml`, // <==== Add here
|
||||
],
|
||||
},
|
||||
transform: async (config, path) => {
|
||||
const metadata = {
|
||||
loc: path,
|
||||
};
|
||||
// transform: async (config, path) => {
|
||||
// const metadata = {
|
||||
// loc: path
|
||||
// }
|
||||
|
||||
if (isHomepage(path)) {
|
||||
metadata.priority = 1;
|
||||
} else if (isBasePage(path)) {
|
||||
metadata.priority = 0.8;
|
||||
} else if (isArticle(path)) {
|
||||
metadata.priority = 0.6;
|
||||
}
|
||||
// if (isHomepage(path)) {
|
||||
// metadata.priority = 1
|
||||
// } else if (isBasePage(path)) {
|
||||
// metadata.priority = 0.8
|
||||
// } else {
|
||||
// if (isArticle(path)) {
|
||||
// metadata.priority = 0.6
|
||||
// const attributes = getArticleAttibutes(`content${path}.md`)
|
||||
// if (!attributes) { return null }
|
||||
|
||||
return metadata;
|
||||
},
|
||||
// metadata.lastmod = attributes.moddate ?? attributes.pubdate ?? null
|
||||
|
||||
// console.log('Calculated sitemap dates for article', path)
|
||||
// }
|
||||
// }
|
||||
|
||||
// return metadata
|
||||
// }
|
||||
};
|
||||
|
||||
function isHomepage(path) {
|
||||
|
@ -47,5 +50,20 @@ function isBasePage(path) {
|
|||
}
|
||||
|
||||
function isArticle(path) {
|
||||
return path.startsWith("/writing/") || path.startsWith("/library/");
|
||||
return path.startsWith("/writing/");
|
||||
}
|
||||
|
||||
function getArticleAttibutes(path) {
|
||||
const fileContents = fs.readFileSync(path, {
|
||||
encoding: "utf-8",
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
const { attributes } = fm(fileContents);
|
||||
|
||||
return {
|
||||
...attributes,
|
||||
pubdate: attributes.pubdate?.toUTCString() ?? null,
|
||||
moddate: attributes.moddate?.toUTCString() ?? null,
|
||||
};
|
||||
}
|
||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "www-aaronjy-me",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "www-aaronjy-me",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"dependencies": {
|
||||
"@highlightjs/cdn-assets": "^11.11.1",
|
||||
"@mdx-js/mdx": "^3.1.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "www-aaronjy-me",
|
||||
"version": "2.3.0",
|
||||
"version": "2.1.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"lint-staged": {
|
||||
|
|
|
@ -7,4 +7,3 @@ Host: https://www.aaronjy.me
|
|||
|
||||
# Sitemaps
|
||||
Sitemap: https://www.aaronjy.me/sitemap.xml
|
||||
Sitemap: https://www.aaronjy.me/server-sitemap-index.xml
|
||||
|
|
14
public/sitemap-0.xml
Normal file
14
public/sitemap-0.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
|
||||
<url><loc>https://www.aaronjy.me/</loc><priority>1</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/about/</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/cv/</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/tags/</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/attitudes-to-reading/</loc><priority>0.6</priority><pubdate>Tue, 18 Mar 2025 00:00:00 GMT</pubdate></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/moving-from-github-to-forgejo/</loc><priority>0.6</priority><pubdate>Sun, 16 Mar 2025 00:00:00 GMT</pubdate></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/performance-considerations-tcp-game-server/</loc><priority>0.6</priority><pubdate>Sun, 23 Feb 2025 21:12:37 GMT</pubdate></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/quick-reflection-katherine-may/</loc><priority>0.6</priority><pubdate>Sun, 09 Mar 2025 00:00:00 GMT</pubdate></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/static-site-on-google-cloud/</loc><priority>0.6</priority><pubdate>Wed, 01 May 2024 00:00:00 GMT</pubdate></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/support-content-filte-structure-changes-on-a-static-site/</loc><priority>0.6</priority><pubdate>Mon, 18 Mar 2024 16:47:32 GMT</pubdate></url>
|
||||
</urlset>
|
|
@ -1,44 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
|
||||
<url><loc>https://www.aaronjy.me/cv</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/tags</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-alchemist</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-invisible-man</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/wintering-the-power-of-rest-and-retreat-in-difficult-times</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-time-machine</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/when-the-moon-hits-your-eye</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-song-of-achilles</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/to-be-taught-if-fortunate</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/on-tyranny</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-dangers-of-smoking-in-bed</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-midnight-library</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/a-night-to-remember</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/sex-punishment</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/a-monster-calls</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/diary-of-an-oxygen-thief</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/1984</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/alices-adventures-in-wonderland</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-nature-of-alexander</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/eleven-kinds-of-loneliness</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/star-maker</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/stray-reflections</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/stasiland-stories-from-behind-the-berlin-wall</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/cities-that-shaped-the-ancient-world</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/animal-farm</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/a-wizard-of-earthsea</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/one-thousand-and-one-nights-a-retelling</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-tombs-of-atuan</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/childhoods-end</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library/the-farthest-shore</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/about</loc><priority>0.8</priority></url>
|
||||
<url><loc>https://www.aaronjy.me</loc><priority>1</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/migrating-from-github-to-forgejo</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/performance-considerations-when-writing-a-tcp-game-server-in-dotnet</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/deploying-aaronjy-me-on-a-google-storage-bucket</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/supporting-content-file-structure-changes-on-a-static-site</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/attitudes-to-reading-and-how-mine-have-changed</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/a-reflection-on-wintering-by-katherine-may</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing/how-my-adhd-makes-handling-relationships-difficult</loc><priority>0.6</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/cv</loc><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/library</loc><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/tags</loc><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://www.aaronjy.me/writing</loc><changefreq>weekly</changefreq><priority>0.7</priority></url>
|
||||
</urlset>
|
|
@ -1,3 +0,0 @@
|
|||
export default function Loading() {
|
||||
return <p>Loading...</p>;
|
||||
}
|
|
@ -1,35 +1,34 @@
|
|||
import Loading from "@/components/Loading/Loading";
|
||||
import { FailedFetchBasicPagesError } from "@/errors";
|
||||
import {
|
||||
FailedFetchBasicPageError,
|
||||
FailedFetchBasicPagesError,
|
||||
} from "@/errors";
|
||||
import DefaultLayout from "@/layouts/DefaultLayout/DefaultLayout";
|
||||
import { mdxComponents } from "@/lib/mdx-components";
|
||||
import { fetchBasicPages } from "@/services/content-service";
|
||||
import { MDXClient } from "next-mdx-remote-client";
|
||||
import { serialize } from "next-mdx-remote-client/serialize";
|
||||
import { NextSeo } from "next-seo";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const res = await fetchBasicPages(["path"]);
|
||||
|
||||
const res = await fetchBasicPages();
|
||||
if (!res.ok) {
|
||||
throw new FailedFetchBasicPagesError(await res.text());
|
||||
throw new FailedFetchBasicPagesError();
|
||||
}
|
||||
|
||||
const pages = (await res.json()).data;
|
||||
|
||||
return {
|
||||
paths: pages.map((page) => ({
|
||||
const paths = pages.map((page) => {
|
||||
return {
|
||||
params: {
|
||||
path: [page.path ?? ""],
|
||||
path: page.path?.split("/") ?? [],
|
||||
},
|
||||
})),
|
||||
fallback: true,
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
return { paths, fallback: false };
|
||||
}
|
||||
|
||||
export async function getStaticProps({ params }) {
|
||||
const { path } = params;
|
||||
|
||||
const res = await fetchBasicPages([], {
|
||||
path: {
|
||||
_eq: path?.join("/") ?? null,
|
||||
|
@ -45,7 +44,6 @@ export async function getStaticProps({ params }) {
|
|||
if (!page) {
|
||||
return {
|
||||
notFound: true,
|
||||
revalidate: 60,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -62,16 +60,6 @@ export async function getStaticProps({ params }) {
|
|||
}
|
||||
|
||||
export default function BasicPage({ title, mdxSource }) {
|
||||
const { isFallback } = useRouter();
|
||||
|
||||
if (isFallback) {
|
||||
return (
|
||||
<DefaultLayout>
|
||||
<Loading />
|
||||
</DefaultLayout>
|
||||
);
|
||||
}
|
||||
|
||||
if (!mdxSource || "error" in mdxSource) {
|
||||
return <p>Something went wrong: {mdxSource?.error ?? "???"}</p>;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import { FailedFetchCVError } from "@/errors";
|
|||
|
||||
export const Title = "CV";
|
||||
|
||||
export async function getStaticProps() {
|
||||
export async function getServerSideProps() {
|
||||
const res = await fetchCV([]);
|
||||
|
||||
if (!res.ok) {
|
||||
|
@ -18,7 +18,6 @@ export async function getStaticProps() {
|
|||
if (!cv) {
|
||||
return {
|
||||
notFound: true,
|
||||
revalidate: 60,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,7 +31,6 @@ export async function getStaticProps() {
|
|||
certifications,
|
||||
experience,
|
||||
},
|
||||
revalidate: 60,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -6,33 +6,37 @@ import {
|
|||
FailedFetchBookReviewError,
|
||||
FailedFetchBookReviewsError,
|
||||
} from "@/errors";
|
||||
import { useRouter } from "next/router";
|
||||
import Loading from "@/components/Loading/Loading";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const res = await fetchBookReviews(["slug"], {
|
||||
status: "published",
|
||||
});
|
||||
// export async function getStaticPaths () {
|
||||
// const res = await fetchBookReviews(['slug'], {
|
||||
// status: 'published'
|
||||
// })
|
||||
|
||||
if (!res.ok) {
|
||||
throw new FailedFetchBookReviewsError(await res.text());
|
||||
}
|
||||
// if (!res.ok) {
|
||||
// throw new FailedFetchBookReviewsError(await res.text())
|
||||
// }
|
||||
|
||||
const reviews = (await res.json()).data;
|
||||
// const reviews = (await res.json()).data
|
||||
|
||||
return {
|
||||
paths: reviews.map((post) => ({
|
||||
params: {
|
||||
slug: post.slug,
|
||||
},
|
||||
})),
|
||||
fallback: true,
|
||||
};
|
||||
}
|
||||
// return {
|
||||
// paths: reviews.map(post => ({
|
||||
// params: {
|
||||
// slug: post.slug
|
||||
// }
|
||||
// })),
|
||||
// fallback: false // false or "blocking"
|
||||
// }
|
||||
// }
|
||||
|
||||
export const getStaticProps = async ({ params }) => {
|
||||
export const getServerSideProps = async ({ params }) => {
|
||||
const { slug } = params;
|
||||
|
||||
if (!slug) {
|
||||
return {
|
||||
notFound: true,
|
||||
};
|
||||
}
|
||||
|
||||
const res = await fetchBookReviews([], {
|
||||
slug,
|
||||
status: "published",
|
||||
|
@ -46,7 +50,6 @@ export const getStaticProps = async ({ params }) => {
|
|||
if (!review) {
|
||||
return {
|
||||
notFound: true,
|
||||
revalidate: 60,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -58,17 +61,13 @@ export const getStaticProps = async ({ params }) => {
|
|||
review,
|
||||
html,
|
||||
},
|
||||
revalidate: 60,
|
||||
};
|
||||
};
|
||||
|
||||
export default function LibrarySingle({ review, html }) {
|
||||
const { isFallback } = useRouter();
|
||||
|
||||
return (
|
||||
<DefaultLayout>
|
||||
{!isFallback && <BookReview review={review} html={html} />}
|
||||
{isFallback && <Loading />}
|
||||
<BookReview review={review} html={html} />
|
||||
</DefaultLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import { NextSeo } from "next-seo";
|
|||
|
||||
export const Title = "Library";
|
||||
|
||||
export async function getStaticProps() {
|
||||
export async function getServerSideProps() {
|
||||
const res = await fetchBookReviews();
|
||||
|
||||
if (!res.ok) {
|
||||
|
@ -23,7 +23,6 @@ export async function getStaticProps() {
|
|||
props: {
|
||||
reviews: stringifyAndParse(reviews),
|
||||
},
|
||||
revalidate: 60,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
import {
|
||||
fetchBasicPages,
|
||||
fetchBookReviews,
|
||||
fetchPosts,
|
||||
} from "@/services/content-service";
|
||||
import { getServerSideSitemapIndexLegacy } from "next-sitemap";
|
||||
|
||||
const siteUrl = process.env.SITE_URL || "https://www.aaronjy.me";
|
||||
|
||||
export const getServerSideProps = async (ctx) => {
|
||||
const [basicPagesResp, bookReviewsResp, postsResp] = await Promise.all([
|
||||
fetchBasicPages().then((res) => res.json()),
|
||||
fetchBookReviews().then((res) => res.json()),
|
||||
fetchPosts().then((res) => res.json()),
|
||||
]);
|
||||
|
||||
const urls = [
|
||||
...basicPagesResp.data.map((entry) => `${siteUrl}/${entry.path ?? ""}`),
|
||||
...bookReviewsResp.data.map(
|
||||
(entry) => `${siteUrl}/library/${entry.slug ?? ""}`,
|
||||
),
|
||||
...postsResp.data.map((entry) => `${siteUrl}/writing/${entry.slug ?? ""}`),
|
||||
];
|
||||
|
||||
return getServerSideSitemapIndexLegacy(ctx, [...urls]);
|
||||
};
|
||||
|
||||
// Default export to prevent next.js errors
|
||||
export default function SitemapIndex() {}
|
|
@ -9,7 +9,7 @@ import { NextSeo } from "next-seo";
|
|||
import Link from "next/link";
|
||||
import React from "react";
|
||||
|
||||
export async function getStaticProps() {
|
||||
export async function getServerSideProps() {
|
||||
const res = await fetchPosts(["title", "date_published", "tags", "slug"], {
|
||||
status: "published",
|
||||
});
|
||||
|
@ -26,7 +26,6 @@ export async function getStaticProps() {
|
|||
tags,
|
||||
posts,
|
||||
},
|
||||
revalidate: 60,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -3,31 +3,8 @@ import DefaultLayout from "@/layouts/DefaultLayout/DefaultLayout";
|
|||
import Article from "@/components/Article/Article";
|
||||
import { fetchPosts, markdownToHtml } from "@/services/content-service";
|
||||
import { FailedFetchPostError, FailedFetchPostsError } from "@/errors";
|
||||
import { useRouter } from "next/router";
|
||||
import Loading from "@/components/Loading/Loading";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const res = await fetchPosts(["slug"], {
|
||||
status: "published",
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
throw new FailedFetchPostsError(await res.text());
|
||||
}
|
||||
|
||||
const posts = (await res.json()).data;
|
||||
|
||||
return {
|
||||
paths: posts.map((post) => ({
|
||||
params: {
|
||||
slug: post.slug,
|
||||
},
|
||||
})),
|
||||
fallback: true,
|
||||
};
|
||||
}
|
||||
|
||||
export const getStaticProps = async ({ params }) => {
|
||||
export const getServerSideProps = async ({ params }) => {
|
||||
const { slug } = params;
|
||||
const res = await fetchPosts([], {
|
||||
slug,
|
||||
|
@ -42,7 +19,6 @@ export const getStaticProps = async ({ params }) => {
|
|||
if (!post) {
|
||||
return {
|
||||
notFound: true,
|
||||
revalidate: 60,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -54,17 +30,13 @@ export const getStaticProps = async ({ params }) => {
|
|||
post,
|
||||
html,
|
||||
},
|
||||
revalidate: 60,
|
||||
};
|
||||
};
|
||||
|
||||
export default function WritingSingle({ post, html }) {
|
||||
const { isFallback } = useRouter();
|
||||
|
||||
return (
|
||||
<DefaultLayout>
|
||||
{!isFallback && <Article {...post} html={html} />}
|
||||
{isFallback && <Loading />}
|
||||
<Article {...post} html={html} />
|
||||
</DefaultLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import StaticContentList from "@/components/StaticContentList/StaticContentList"
|
|||
import { fetchPosts } from "@/services/content-service";
|
||||
import { FailedFetchPostsError } from "@/errors";
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
export const getServerSideProps = async () => {
|
||||
const res = await fetchPosts(["title", "date_published", "slug"], {
|
||||
status: "published",
|
||||
});
|
||||
|
@ -25,7 +25,6 @@ export const getStaticProps = async () => {
|
|||
props: {
|
||||
posts,
|
||||
},
|
||||
revalidate: 60,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue