Skip to content

Commit

Permalink
docs: update next-pages-router example
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesRijckaert committed Dec 10, 2024
1 parent ed7ee64 commit fc5bd64
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 54 deletions.
2 changes: 1 addition & 1 deletion examples/next-pages-router/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.17.0
v20.17.0
2 changes: 1 addition & 1 deletion examples/next-pages-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Next, add these fields (you don't have to modify the settings unless specified):
- `details` - **Rich text** field
- `date` - **Date and time** field
- `author` - **Text** field (type **short text**)
- `category` - **Text** field (type **short text**)
- `categoryName` - **Text** field (type **short text**)
- `heroImage` - **Media** field (type **one file**)

Save the content type and continue.
Expand Down
22 changes: 12 additions & 10 deletions examples/next-pages-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@contentful/live-preview": "^3.1.0",
"@contentful/rich-text-react-renderer": "^15.19.3",
"@contentful/live-preview": "^4.5.17",
"contentful": "^10.6.21",
"next": "14.2.10",
"react": "^18",
"react-dom": "^18",
"swr": "^2.2.4"
"next": "15.0.4",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"eslint-config-next": "15.0.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
},
"overrides": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1"
}
}
11 changes: 0 additions & 11 deletions examples/next-pages-router/pages/blogs/[slug].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Blog, getAllBlogsWithSlug, getBlog } from '@/lib/contentful/api';

import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next';
import { documentToReactComponents } from '@contentful/rich-text-react-renderer';
import {
useContentfulInspectorMode,
useContentfulLiveUpdates,
Expand Down Expand Up @@ -67,16 +66,6 @@ export default function BlogPage({ blog }: { blog: Blog }) {
fieldId: 'file',
})}
/>
<div className="space-y-4 md:space-y-6">
<div className="space-y-2">
<div
className="max-w-[900px] text-zinc-500 md:text-xl/relaxed lg:text-base/relaxed xl:text-xl/relaxed dark:text-zinc-400"
{...inspectorProps({ fieldId: 'details' })}
>
{documentToReactComponents(updatedBlog.fields.details)}
</div>
</div>
</div>
</div>
</div>
</section>
Expand Down
30 changes: 0 additions & 30 deletions examples/next-pages-router/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
3 changes: 2 additions & 1 deletion examples/next-pages-router/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
],
"paths": {
"@/*": ["./*"]
}
},
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit fc5bd64

Please sign in to comment.