This commit is contained in:
2025-08-18 11:30:28 -05:00
parent 312b90a66e
commit 525009d881
6 changed files with 58 additions and 25 deletions
+3
View File
@@ -1,7 +1,10 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
reactStrictMode: true, reactStrictMode: true,
output: 'export',
trailingSlash: true,
images: { images: {
unoptimized: true,
remotePatterns: [ remotePatterns: [
{ {
protocol: 'https', protocol: 'https',
+3 -3
View File
@@ -2119,9 +2119,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001706", "version": "1.0.30001735",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001706.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001735.tgz",
"integrity": "sha512-3ZczoTApMAZwPKYWmwVbQMFpXBDds3/0VciVoUwPUbldlYyVLmRVuRs/PcUZtHpbLRpzzDvrvnFuREsGt6lUug==", "integrity": "sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w==",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
+4 -1
View File
@@ -6,9 +6,12 @@
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"build:static": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit",
"deploy:cf": "npm run build:static && npx wrangler deploy",
"preview:cf": "npm run build:static && npx wrangler dev"
}, },
"keywords": [ "keywords": [
"blog", "blog",
+17 -9
View File
@@ -127,17 +127,25 @@ const AuthorPage: React.FC<AuthorPageProps> = ({ posts, author }) => {
}; };
export const getStaticPaths: GetStaticPaths = async () => { export const getStaticPaths: GetStaticPaths = async () => {
const posts = getSortedPostsData(); try {
const authors = Array.from(new Set(posts.flatMap(post => post.author))); const posts = getSortedPostsData();
const authors = Array.from(new Set(posts.flatMap(post => post.author)));
const paths = authors.map((author) => ({ const paths = authors.map((author) => ({
params: { author }, params: { author },
})); }));
return { return {
paths, paths,
fallback: false, fallback: 'blocking',
}; };
} catch (error) {
console.error('Failed to generate author paths during build:', error);
return {
paths: [],
fallback: 'blocking',
};
}
}; };
export const getStaticProps: GetStaticProps = async ({ params }) => { export const getStaticProps: GetStaticProps = async ({ params }) => {
+18 -12
View File
@@ -57,21 +57,27 @@ const AuthorsPage: React.FC<AuthorsPageProps> = ({ authors }) => {
}; };
export const getStaticProps: GetStaticProps = async () => { export const getStaticProps: GetStaticProps = async () => {
const { data: authorsData, error } = await supabase try {
.from('authors') const { data: authorsData, error } = await supabase
.select('name, bio, x_link, fb_link, insta_link, pfp_link'); .from('authors')
.select('name, bio, x_link, fb_link, insta_link, pfp_link');
if (error || !authorsData) { if (error || !authorsData) {
console.error('Error fetching authors:', error); console.error('Error fetching authors:', error);
// Return empty array for static export fallback
return { props: { authors: [] } };
}
return {
props: {
authors: authorsData,
},
};
} catch (error) {
console.error('Failed to fetch authors during build:', error);
// Fallback for static export when Supabase is not available during build
return { props: { authors: [] } }; return { props: { authors: [] } };
} }
return {
props: {
authors: authorsData,
},
revalidate: 60,
};
}; };
export default AuthorsPage; export default AuthorsPage;
+13
View File
@@ -0,0 +1,13 @@
{
"name": "confessions-of-grace",
"compatibility_date": "2025-08-18",
"assets": {
"directory": "./out"
},
"routes": [
{
"pattern": "confessionsofgrace.com",
"custom_domain": true
}
]
}