From 55ebaa1bab1e308aaf615d0694c0017113b8b4ac Mon Sep 17 00:00:00 2001 From: Ryan Wiemer Date: Thu, 7 Dec 2023 19:22:21 -0800 Subject: [PATCH] Contentful Envs (#36) --- .env.local.example | 6 +- .vscode/settings.json | 2 +- app/api/revalidate/route.ts | 3 +- app/layout.tsx | 2 + lib/api.ts | 4 +- next-sitemap.config.js | 6 +- package.json | 11 +- yarn.lock | 270 ++++++++++++++++++------------------ 8 files changed, 155 insertions(+), 149 deletions(-) diff --git a/.env.local.example b/.env.local.example index eac50f1..e6e9698 100644 --- a/.env.local.example +++ b/.env.local.example @@ -1,5 +1,7 @@ +SITE_URL= CONTENTFUL_SPACE_ID= +CONTENTFUL_PREVIEW_SECRET= +CONTENTFUL_REVALIDATE_SECRET= CONTENTFUL_ACCESS_TOKEN= CONTENTFUL_PREVIEW_ACCESS_TOKEN= -CONTENTFUL_PREVIEW_SECRET= -CONTENTFUL_REVALIDATE_SECRET= \ No newline at end of file +CONTENTFUL_ENVIRONMENT= \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 6ab3a54..53e7c7b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/app/api/revalidate/route.ts b/app/api/revalidate/route.ts index 49f8095..309f881 100644 --- a/app/api/revalidate/route.ts +++ b/app/api/revalidate/route.ts @@ -10,7 +10,6 @@ export async function POST(request: NextRequest) { } // Revalidate the cache for all of the data pulled from Contentful in lib/api.ts - revalidateTag('posts') - + revalidateTag('contentfulData') return NextResponse.json({ revalidated: true, now: Date.now() }) } diff --git a/app/layout.tsx b/app/layout.tsx index 7c22d3a..41eb815 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,6 +1,7 @@ import './globals.css' import { Inter } from 'next/font/google' import { Analytics } from '@vercel/analytics/react' +import { SpeedInsights } from '@vercel/speed-insights/next' import Footer from '../components/footer' import Menu from '../components/menu' import { ThemeProvider } from '@/components/theme-provider' @@ -43,6 +44,7 @@ export default async function RootLayout({