Archived
wrangler
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
output: 'export',
|
||||
trailingSlash: true,
|
||||
images: {
|
||||
unoptimized: true,
|
||||
remotePatterns: [
|
||||
{
|
||||
protocol: 'https',
|
||||
|
||||
Generated
+3
-3
@@ -2119,9 +2119,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001706",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001706.tgz",
|
||||
"integrity": "sha512-3ZczoTApMAZwPKYWmwVbQMFpXBDds3/0VciVoUwPUbldlYyVLmRVuRs/PcUZtHpbLRpzzDvrvnFuREsGt6lUug==",
|
||||
"version": "1.0.30001735",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001735.tgz",
|
||||
"integrity": "sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
|
||||
+4
-1
@@ -6,9 +6,12 @@
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"build:static": "next build",
|
||||
"start": "next start",
|
||||
"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": [
|
||||
"blog",
|
||||
|
||||
@@ -127,6 +127,7 @@ const AuthorPage: React.FC<AuthorPageProps> = ({ posts, author }) => {
|
||||
};
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = async () => {
|
||||
try {
|
||||
const posts = getSortedPostsData();
|
||||
const authors = Array.from(new Set(posts.flatMap(post => post.author)));
|
||||
|
||||
@@ -136,8 +137,15 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
|
||||
return {
|
||||
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 }) => {
|
||||
|
||||
@@ -57,12 +57,14 @@ const AuthorsPage: React.FC<AuthorsPageProps> = ({ authors }) => {
|
||||
};
|
||||
|
||||
export const getStaticProps: GetStaticProps = async () => {
|
||||
try {
|
||||
const { data: authorsData, error } = await supabase
|
||||
.from('authors')
|
||||
.select('name, bio, x_link, fb_link, insta_link, pfp_link');
|
||||
|
||||
if (error || !authorsData) {
|
||||
console.error('Error fetching authors:', error);
|
||||
// Return empty array for static export fallback
|
||||
return { props: { authors: [] } };
|
||||
}
|
||||
|
||||
@@ -70,8 +72,12 @@ export const getStaticProps: GetStaticProps = async () => {
|
||||
props: {
|
||||
authors: authorsData,
|
||||
},
|
||||
revalidate: 60,
|
||||
};
|
||||
} 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: [] } };
|
||||
}
|
||||
};
|
||||
|
||||
export default AuthorsPage;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "confessions-of-grace",
|
||||
"compatibility_date": "2025-08-18",
|
||||
"assets": {
|
||||
"directory": "./out"
|
||||
},
|
||||
"routes": [
|
||||
{
|
||||
"pattern": "confessionsofgrace.com",
|
||||
"custom_domain": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user