Skip to content

Commit

Permalink
Update Sanity example for App Router
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Mar 6, 2024
1 parent c206d89 commit c6033ed
Show file tree
Hide file tree
Showing 100 changed files with 1,681 additions and 1,428 deletions.
14 changes: 7 additions & 7 deletions examples/cms-contentful/app/posts/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ export default async function PostPage({

return (
<div className="container mx-auto px-5">
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<h2 className="mb-20 mt-8 text-2xl font-bold leading-tight tracking-tight md:text-4xl md:tracking-tighter">
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
<article>
<h1 className="text-6xl md:text-7xl lg:text-8xl font-bold tracking-tighter leading-tight md:leading-none mb-12 text-center md:text-left">
<h1 className="mb-12 text-center text-6xl font-bold leading-tight tracking-tighter md:text-left md:text-7xl md:leading-none lg:text-8xl">
{post.title}
</h1>
<div className="hidden md:block md:mb-12">
<div className="hidden md:mb-12 md:block">
{post.author && (
<Avatar name={post.author.name} picture={post.author.picture} />
)}
</div>
<div className="mb-8 md:mb-16 sm:mx-0">
<div className="mb-8 sm:mx-0 md:mb-16">
<CoverImage title={post.title} url={post.coverImage.url} />
</div>
<div className="max-w-2xl mx-auto">
<div className="block md:hidden mb-6">
<div className="mx-auto max-w-2xl">
<div className="mb-6 block md:hidden">
{post.author && (
<Avatar name={post.author.name} picture={post.author.picture} />
)}
Expand All @@ -56,7 +56,7 @@ export default async function PostPage({
</div>
</div>

<div className="max-w-2xl mx-auto">
<div className="mx-auto max-w-2xl">
<div className="prose">
<Markdown content={post.content} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/cms-sanity/.env.local.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://github.com/vercel/next.js/tree/canary/examples/cms-sanity#using-the-sanity-cli
NEXT_PUBLIC_SANITY_PROJECT_ID=
NEXT_PUBLIC_SANITY_DATASET=
SANITY_API_READ_TOKEN=
SANITY_REVALIDATE_SECRET=
4 changes: 4 additions & 0 deletions examples/cms-sanity/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "next/core-web-vitals",
"root": true
}
2 changes: 1 addition & 1 deletion examples/cms-sanity/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ next-env.d.ts

# Env files created by scripts for working locally
.env
studio/.env.development
.env.local
Loading

0 comments on commit c6033ed

Please sign in to comment.