Skip to content

Commit aedf275

Browse files
committed
Merge branch 'dev' into tailwind-v4
2 parents 9934942 + 4d20e57 commit aedf275

20 files changed

+75
-12
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ yarn-error.log*
3636
next-env.d.ts
3737

3838
public/google*.html
39+
40+
public/admin/static

README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ npm create sanity@latest -- --template nuotsu/sanitypress
2626

2727
Full instructions on the [docs](https://sanitypress.dev/docs).
2828

29-
1. **Run the install command**:
29+
### 1. **Install with the Sanity CLI**
30+
31+
Run the following command to initialize this template on your local computer.
32+
33+
See the documentation if you are [having issues with the CLI](https://www.sanity.io/help/cli-errors).
3034

3135
```ini
3236
# .env.local
@@ -42,7 +46,9 @@ NEXT_PUBLIC_GITHUB_TOKEN = # used for Reputation blocks
4246

4347
You can also clone or fork [the GitHub template](https://github.com/nuotsu/sanitypress) to set up manually.
4448

45-
2. **Add content**: In your new Sanity Studio, publish the **required** `site` and `page` documents.
49+
### 2. **Add content**
50+
51+
In your new Sanity Studio, publish the **required** `site` and `page` documents.
4652

4753
| Document | Slug | Use | Required? | Notes |
4854
| -------- | -------- | --------------- | :-------: | ---------------------------------------------------------------------------------------------- |
@@ -52,19 +58,25 @@ You can also clone or fork [the GitHub template](https://github.com/nuotsu/sanit
5258
| `page` | `blog` | Blog listing | | Add the [**Blog frontpage**](https://sanitypress.dev/docs/modules/blog-frontpage) module |
5359
| `page` | `blog/*` | Blog post | | Add the [**Blog post content**](https://sanitypress.dev/docs/modules/blog-post-content) module |
5460

61+
Read the [Getting Started docs](https://sanitypress.dev/docs/getting-started) for more information.
62+
5563
Alternatively, you can import the [demo site](https://demo.sanitypress.dev) dataset:
5664

5765
```sh
5866
sanity dataset import src/sanity/demo.tar.gz
5967
```
6068

61-
3. **Set up deployments**: Add a [Vercel](https://www.sanity.io/plugins/vercel-dashboard-widget) or [Netlify](https://www.sanity.io/plugins/sanity-plugin-dashboard-widget-netlify) widget to enable deployments from the Studio.
69+
### 3. **Set up deployments**
70+
71+
Add a [Vercel](https://www.sanity.io/plugins/vercel-dashboard-widget) or [Netlify](https://www.sanity.io/plugins/sanity-plugin-dashboard-widget-netlify) widget to enable deployments from the Studio.
72+
73+
### 4. **Customize**
6274

63-
4. **Customize**: Adjust frontend styles, edit/add Sanity schema and modules, and more.
75+
Adjust frontend styles, edit/add Sanity schema and modules, and [more](https://sanitypress.dev/blog/the-developers-guide-to-customizing-sanitypress).
6476

6577
## Resources
6678

67-
- [The _Impressive_ Blog](https://sanitypress.dev/blog)
79+
- [_The Styled Heart_](https://sanitypress.dev/blog) — SanityPress Blog
6880
- [Visual Editing with Next.js and Sanity](https://www.sanity.io/guides/nextjs-app-router-live-preview)
6981
- [`next-sanity`](https://www.sanity.io/plugins/next-sanity) — Sanity toolkit for Next.js
7082
- [nuqs](https://nuqs.47ng.com/) — Type-safe search params state manager for React

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"scripts": {
88
"dev": "next dev",
99
"dev:turbopack": "next dev --turbopack",
10-
"build": "next build",
10+
"build": "npm run manifest && next build",
1111
"start": "next start",
1212
"lint": "next lint",
13+
"manifest": "sanity manifest extract --path public/admin/static",
1314
"typecheck": "tsc --noEmit"
1415
},
1516
"dependencies": {

src/sanity/schemaTypes/modules/accordion-list.ts

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ export default defineType({
1414
type: 'module-options',
1515
group: 'options',
1616
}),
17+
defineField({
18+
name: 'pretitle',
19+
type: 'string',
20+
group: 'content',
21+
}),
1722
defineField({
1823
name: 'intro',
1924
type: 'array',

src/sanity/schemaTypes/modules/blog-list.ts

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export default defineType({
1313
{ name: 'options' },
1414
],
1515
fields: [
16+
defineField({
17+
name: 'pretitle',
18+
type: 'string',
19+
group: 'content',
20+
}),
1621
defineField({
1722
name: 'intro',
1823
type: 'array',
@@ -49,6 +54,7 @@ export default defineType({
4954
title: 'Number of posts to show',
5055
description: 'Leave empty to show all posts',
5156
type: 'number',
57+
initialValue: 6,
5258
validation: (Rule) => Rule.min(1).integer(),
5359
group: 'filtering',
5460
}),

src/sanity/schemaTypes/modules/creative/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { defineArrayMember, defineField, defineType } from 'sanity'
2-
import creativeCtas from './creativeCtas'
3-
import creativeIcon from './creativeIcon'
4-
import creativeImage from './creativeImage'
5-
import creativeRichtext from './creativeRichtext'
2+
import creativeCtas from './ctas.creative'
3+
import creativeIcon from './icon.creative'
4+
import creativeImage from './image.creative'
5+
import creativeRichtext from './richtext.creative'
66
import {
77
textAlign,
88
alignItems,

src/sanity/schemaTypes/modules/stat-list.ts

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ export default defineType({
1111
type: 'object',
1212
groups: [{ name: 'content', default: true }, { name: 'options' }],
1313
fields: [
14+
defineField({
15+
name: 'pretitle',
16+
type: 'string',
17+
group: 'content',
18+
}),
1419
defineField({
1520
name: 'intro',
1621
type: 'array',

src/sanity/schemaTypes/modules/step-list.ts

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export default defineType({
88
icon: VscListOrdered,
99
type: 'object',
1010
fields: [
11+
defineField({
12+
name: 'pretitle',
13+
type: 'string',
14+
}),
1115
defineField({
1216
name: 'intro',
1317
type: 'array',

src/sanity/schemaTypes/modules/testimonial-list.ts

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export default defineType({
1010
type: 'object',
1111
groups: [{ name: 'content', default: true }, { name: 'options' }],
1212
fields: [
13+
defineField({
14+
name: 'pretitle',
15+
type: 'string',
16+
group: 'content',
17+
}),
1318
defineField({
1419
name: 'intro',
1520
type: 'array',

src/ui/Announcement.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ export default async function Announcement() {
2222
<>
2323
{announcements?.map(({ start, end, content, cta, _id }) => (
2424
<Scheduler start={start} end={end} key={_id}>
25-
<aside className="flex items-center justify-center gap-x-4 text-balance bg-accent p-2 text-center text-canvas max-md:text-sm md:gap-x-6">
25+
<aside
26+
id="announcement"
27+
className="flex items-center justify-center gap-x-4 text-balance bg-accent p-2 text-center text-canvas max-md:text-sm md:gap-x-6"
28+
>
2629
<div className="anim-fade-to-r [&_a]:link">
2730
<PortableText value={content} />
2831
</div>

src/ui/modules/AccordionList.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import moduleProps from '@/lib/moduleProps'
2+
import Pretitle from '@/ui/Pretitle'
23
import { PortableText } from 'next-sanity'
34
import { cn } from '@/lib/utils'
45

56
export default function AccordionList({
7+
pretitle,
68
intro,
79
items,
810
layout = 'vertical',
911
generateSchema,
1012
...props
1113
}: Partial<{
14+
pretitle: string
1215
intro: any
1316
items: {
1417
summary: string
@@ -39,6 +42,7 @@ export default function AccordionList({
3942
: 'text-center',
4043
)}
4144
>
45+
<Pretitle>{pretitle}</Pretitle>
4246
<PortableText value={intro} />
4347
</header>
4448

src/ui/modules/FlagList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import Pretitle from '@/ui/Pretitle'
12
import { PortableText, stegaClean } from 'next-sanity'
23
import Img from '@/ui/Img'
34
import { cn } from '@/lib/utils'
4-
import Pretitle from '../Pretitle'
55

66
export default function FlagList({
77
pretitle,

src/ui/modules/StatList.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import Pretitle from '@/ui/Pretitle'
12
import { PortableText, stegaClean } from 'next-sanity'
23

34
export default function StatList({
5+
pretitle,
46
intro,
57
stats,
68
textAlign = 'center',
79
}: Partial<{
10+
pretitle: string
811
intro: any
912
stats: Partial<{
1013
prefix: string
@@ -21,6 +24,7 @@ export default function StatList({
2124
>
2225
{intro && (
2326
<header className="richtext text-center">
27+
<Pretitle>{pretitle}</Pretitle>
2428
<PortableText value={intro} />
2529
</header>
2630
)}

src/ui/modules/StepList.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import Pretitle from '@/ui/Pretitle'
12
import { PortableText } from 'next-sanity'
23

34
export default function StepList({
5+
pretitle,
46
intro,
57
steps,
68
}: Partial<{
9+
pretitle: string
710
intro: any
811
steps: {
912
content: any
@@ -13,6 +16,7 @@ export default function StepList({
1316
<section className="section space-y-8">
1417
{intro && (
1518
<header className="richtext text-center text-balance">
19+
<Pretitle>{pretitle}</Pretitle>
1620
<PortableText value={intro} />
1721
</header>
1822
)}

src/ui/modules/TestimonialList.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
import Pretitle from '@/ui/Pretitle'
12
import { PortableText, stegaClean } from 'next-sanity'
23
import Img from '@/ui/Img'
34
import { cn } from '@/lib/utils'
45

56
export default function TestimonialList({
7+
pretitle,
68
intro,
79
testimonials,
810
layout,
911
}: Partial<{
12+
pretitle: string
1013
intro: any
1114
testimonials: Sanity.Testimonial[]
1215
layout: 'grid' | 'carousel'
@@ -17,6 +20,7 @@ export default function TestimonialList({
1720
<section className="section space-y-8 text-center">
1821
{intro && (
1922
<header className="richtext">
23+
<Pretitle>{pretitle}</Pretitle>
2024
<PortableText value={intro} />
2125
</header>
2226
)}

src/ui/modules/blog/BlogList/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
import { Suspense } from 'react'
22
import { fetchSanity } from '@/sanity/lib/fetch'
33
import { groq } from 'next-sanity'
4+
import Pretitle from '@/ui/Pretitle'
45
import { PortableText, stegaClean } from 'next-sanity'
56
import FilterList from '@/ui/modules/blog/BlogList/FilterList'
67
import PostPreview from '../PostPreview'
78
import List from './List'
89
import { cn } from '@/lib/utils'
910

1011
export default async function BlogList({
12+
pretitle,
1113
intro,
1214
layout,
1315
limit,
1416
showFeaturedPostsFirst,
1517
displayFilters,
1618
filteredCategory,
1719
}: Partial<{
20+
pretitle: string
1821
intro: any
1922
layout: 'grid' | 'carousel'
2023
limit: number
@@ -55,6 +58,7 @@ export default async function BlogList({
5558
<section className="section space-y-8">
5659
{intro && (
5760
<header className="richtext">
61+
<Pretitle>{pretitle}</Pretitle>
5862
<PortableText value={intro} />
5963
</header>
6064
)}

0 commit comments

Comments
 (0)