Skip to content

Commit 5406b12

Browse files
authored
Merge pull request #1048 from timlrx/next-15
Update to next-15
2 parents 4d212bd + a25226f commit 5406b12

File tree

9 files changed

+2296
-2370
lines changed

9 files changed

+2296
-2370
lines changed

app/api/newsletter/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { NewsletterAPI } from 'pliny/newsletter'
22
import siteMetadata from '@/data/siteMetadata'
33

4+
export const dynamic = 'force-static'
5+
46
const handler = NewsletterAPI({
57
// @ts-ignore
68
provider: siteMetadata.newsletter.provider,

app/blog/[...slug]/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ const layouts = {
2121
PostBanner,
2222
}
2323

24-
export async function generateMetadata({
25-
params,
26-
}: {
27-
params: { slug: string[] }
24+
export async function generateMetadata(props: {
25+
params: Promise<{ slug: string[] }>
2826
}): Promise<Metadata | undefined> {
27+
const params = await props.params
2928
const slug = decodeURI(params.slug.join('/'))
3029
const post = allBlogs.find((p) => p.slug === slug)
3130
const authorList = post?.authors || ['default']
@@ -78,7 +77,8 @@ export const generateStaticParams = async () => {
7877
return allBlogs.map((p) => ({ slug: p.slug.split('/').map((name) => decodeURI(name)) }))
7978
}
8079

81-
export default async function Page({ params }: { params: { slug: string[] } }) {
80+
export default async function Page(props: { params: Promise<{ slug: string[] }> }) {
81+
const params = await props.params
8282
const slug = decodeURI(params.slug.join('/'))
8383
// Filter out drafts in production
8484
const sortedCoreContents = allCoreContent(sortPosts(allBlogs))

app/blog/page/[page]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export const generateStaticParams = async () => {
1111
return paths
1212
}
1313

14-
export default function Page({ params }: { params: { page: string } }) {
14+
export default async function Page(props: { params: Promise<{ page: string }> }) {
15+
const params = await props.params
1516
const posts = allCoreContent(sortPosts(allBlogs))
1617
const pageNumber = parseInt(params.page as string)
1718
const initialDisplayPosts = posts.slice(

app/robots.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { MetadataRoute } from 'next'
22
import siteMetadata from '@/data/siteMetadata'
33

4+
export const dynamic = 'force-static'
5+
46
export default function robots(): MetadataRoute.Robots {
57
return {
68
rules: {

app/sitemap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { MetadataRoute } from 'next'
22
import { allBlogs } from 'contentlayer/generated'
33
import siteMetadata from '@/data/siteMetadata'
44

5+
export const dynamic = 'force-static'
6+
57
export default function sitemap(): MetadataRoute.Sitemap {
68
const siteUrl = siteMetadata.siteUrl
79

app/tags/[tag]/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import { genPageMetadata } from 'app/seo'
88
import { Metadata } from 'next'
99
import { notFound } from 'next/navigation'
1010

11-
export async function generateMetadata({ params }: { params: { tag: string } }): Promise<Metadata> {
11+
export async function generateMetadata(props: {
12+
params: Promise<{ tag: string }>
13+
}): Promise<Metadata> {
14+
const params = await props.params
1215
const tag = decodeURI(params.tag)
1316
return genPageMetadata({
1417
title: tag,
@@ -31,7 +34,8 @@ export const generateStaticParams = async () => {
3134
return paths
3235
}
3336

34-
export default function TagPage({ params }: { params: { tag: string } }) {
37+
export default async function TagPage(props: { params: Promise<{ tag: string }> }) {
38+
const params = await props.params
3539
const tag = decodeURI(params.tag)
3640
// Capitalize first letter and convert space to dash
3741
const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1)

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
"prepare": "husky"
1313
},
1414
"dependencies": {
15-
"@headlessui/react": "1.7.19",
16-
"@next/bundle-analyzer": "14.2.3",
17-
"@tailwindcss/forms": "^0.5.7",
18-
"@tailwindcss/typography": "^0.5.12",
15+
"@headlessui/react": "2.2.0",
16+
"@next/bundle-analyzer": "15.0.2",
17+
"@tailwindcss/forms": "^0.5.9",
18+
"@tailwindcss/typography": "^0.5.15",
1919
"autoprefixer": "^10.4.13",
2020
"body-scroll-lock": "^4.0.0-beta.0",
21-
"contentlayer2": "0.5.1",
21+
"contentlayer2": "0.5.3",
2222
"esbuild": "0.20.2",
2323
"github-slugger": "^2.0.0",
2424
"gray-matter": "^4.0.2",
2525
"hast-util-from-html-isomorphic": "^2.0.0",
2626
"image-size": "1.0.0",
27-
"next": "14.2.3",
28-
"next-contentlayer2": "0.5.1",
27+
"next": "15.0.2",
28+
"next-contentlayer2": "0.5.3",
2929
"next-themes": "^0.3.0",
30-
"pliny": "0.2.1",
30+
"pliny": "0.4.0",
3131
"postcss": "^8.4.24",
32-
"react": "18.3.1",
33-
"react-dom": "18.3.1",
32+
"react": "rc",
33+
"react-dom": "rc",
3434
"reading-time": "1.5.0",
3535
"rehype-autolink-headings": "^7.1.0",
3636
"rehype-citation": "^2.0.0",
@@ -42,20 +42,20 @@
4242
"remark-gfm": "^4.0.0",
4343
"remark-github-blockquote-alert": "^1.2.1",
4444
"remark-math": "^6.0.0",
45-
"tailwindcss": "^3.4.3",
45+
"tailwindcss": "^3.4.14",
4646
"unist-util-visit": "^5.0.0"
4747
},
4848
"devDependencies": {
4949
"@svgr/webpack": "^8.0.1",
5050
"@types/mdx": "^2.0.12",
5151
"@types/react": "^18.2.73",
52-
"@typescript-eslint/eslint-plugin": "^6.1.0",
53-
"@typescript-eslint/parser": "^6.1.0",
52+
"@typescript-eslint/eslint-plugin": "^8.12.0",
53+
"@typescript-eslint/parser": "^8.12.0",
5454
"cross-env": "^7.0.3",
55-
"eslint": "^8.45.0",
56-
"eslint-config-next": "14.2.3",
57-
"eslint-config-prettier": "^8.8.0",
58-
"eslint-plugin-prettier": "^5.0.0",
55+
"eslint": "^9.14.0",
56+
"eslint-config-next": "15.0.2",
57+
"eslint-config-prettier": "^9.1.0",
58+
"eslint-plugin-prettier": "^5.2.0",
5959
"husky": "^9.0.0",
6060
"lint-staged": "^13.0.0",
6161
"prettier": "^3.0.0",

scripts/rss.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ async function generateRSS(config, allBlogs, page = 'feed.xml') {
4747

4848
if (publishPosts.length > 0) {
4949
for (const tag of Object.keys(tagData)) {
50-
const filteredPosts = allBlogs.filter((post) =>
51-
post.tags.map((t) => slug(t)).includes(tag)
52-
)
50+
const filteredPosts = allBlogs.filter((post) => post.tags.map((t) => slug(t)).includes(tag))
5351
const rss = generateRss(config, filteredPosts, `tags/${tag}/${page}`)
5452
const rssPath = path.join(outputFolder, 'tags', tag)
5553
mkdirSync(rssPath, { recursive: true })

0 commit comments

Comments
 (0)