Skip to content

Commit 0a36e7c

Browse files
committed
Merge branch 'trunk' of github.com:codecoolture/codecoolture.com into trunk
2 parents 575e73f + ab1197d commit 0a36e7c

File tree

10 files changed

+241
-232
lines changed

10 files changed

+241
-232
lines changed

components/Blockquote/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.Blockquote {
2-
font-size: 1.2em;
2+
font-size: var(--fs-l);
33
margin-bottom: 1em;
44
padding: 0 0.5em;
55

components/Code/style.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.Code {
2-
font-size: 85%;
32
padding: 0.15em 0.25em;
43

54
background-color: var(--c-yellow-2);

components/Codeblock/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { classNames } from "@/lib/classNames";
22

3-
type CodeblockProps = Pick<React.JSX.IntrinsicElements["pre"], "children" | "className">;
3+
type CodeblockProps = React.JSX.IntrinsicElements["pre"];
44

5-
export function Codeblock({ children }: CodeblockProps) {
6-
return <pre className={classNames("Codeblock")}>{children}</pre>;
5+
export function Codeblock({ className, ...props }: CodeblockProps) {
6+
return <pre className={classNames("Codeblock", className)} {...props} />;
77
}

components/Heading/style.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
}
88

99
.Heading--Jumbo {
10-
font-size: var(--fs-xl);
10+
font-size: var(--fs-2xl);
1111
margin-bottom: 0.5em;
1212
}
1313

1414
.Heading--Xl {
15-
font-size: var(--fs-l);
15+
font-size: var(--fs-xl);
1616
margin-bottom: 0.5em;
1717
}
1818

1919
.Heading--L {
20-
font-size: calc(var(--fs-m) * 1.25);
20+
font-size: var(--fs-l);
2121
margin-bottom: 0.5em;
2222
}
2323

layouts/Post/index.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { MDXRemote, MDXRemoteSerializeResult } from "next-mdx-remote";
1+
import { MDXClient } from "next-mdx-remote-client";
2+
import { type SerializeResult } from "next-mdx-remote-client/serialize";
23

34
import { ApiArticle } from "@/cms/api/ApiArticle";
45
import { Blockquote } from "@/components/Blockquote";
@@ -20,12 +21,16 @@ import { Footer } from "./components/Footer";
2021
export interface PostProps {
2122
breadcrumbs: Array<{ label: string; url?: string }>;
2223

23-
mdx: MDXRemoteSerializeResult;
24+
mdx: SerializeResult;
2425

2526
post: ApiArticle;
2627
}
2728

28-
export function Post({ breadcrumbs, mdx, post }: PostProps) {
29+
export function Post({ breadcrumbs, mdx, post }: Readonly<PostProps>) {
30+
if ("error" in mdx) {
31+
throw mdx.error;
32+
}
33+
2934
return (
3035
<>
3136
<Seo post={post} />
@@ -38,7 +43,7 @@ export function Post({ breadcrumbs, mdx, post }: PostProps) {
3843
<Timestamp date={post.date} />
3944
</header>
4045

41-
<MDXRemote
46+
<MDXClient
4247
components={{
4348
a: Link,
4449
blockquote: Blockquote,

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
"dependencies": {
88
"@mdx-js/loader": "3.1.1",
99
"@mdx-js/react": "3.1.1",
10-
"@next/mdx": "16.1.0",
10+
"@next/mdx": "16.1.1",
1111
"@radix-ui/colors": "3.0.0",
1212
"@vercel/analytics": "1.6.1",
1313
"fathom-client": "3.7.2",
1414
"front-matter": "4.0.2",
1515
"lodash": "4.17.21",
16-
"next": "16.1.0",
17-
"next-mdx-remote": "5.0.0",
18-
"prismjs": "1.30.0",
16+
"next": "16.1.1",
17+
"next-mdx-remote-client": "^2.1.7",
1918
"react": "19.2.3",
2019
"react-dom": "19.2.3",
2120
"react-icons": "5.5.0",
@@ -30,8 +29,8 @@
3029
"@types/node": "25.0.3",
3130
"@types/react": "19.2.7",
3231
"@types/react-dom": "19.2.3",
33-
"@typescript-eslint/eslint-plugin": "8.50.0",
34-
"@typescript-eslint/parser": "8.50.0",
32+
"@typescript-eslint/eslint-plugin": "8.50.1",
33+
"@typescript-eslint/parser": "8.50.1",
3534
"cypress": "15.8.1",
3635
"eslint": "9.39.2",
3736
"eslint-config-next": "^16.1.0",

pages/blog/[slug].tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { GetStaticPaths, GetStaticProps } from "next";
2-
import { MDXRemoteSerializeResult } from "next-mdx-remote";
3-
import { serialize } from "next-mdx-remote/serialize";
2+
import { serialize, type SerializeResult } from "next-mdx-remote-client/serialize";
43
import React from "react";
5-
import rehypeHighligh from "rehype-highlight";
4+
import rehypeHighlight from "rehype-highlight";
65
import rehypeUnwrapImages from "rehype-unwrap-images";
76
import remarkGfm from "remark-gfm";
87

@@ -13,7 +12,7 @@ import { isDevelopment } from "@/lib/env";
1312

1413
interface ArticleProps {
1514
article: ApiArticle;
16-
mdx: MDXRemoteSerializeResult;
15+
mdx: SerializeResult;
1716
}
1817

1918
export default class Articles extends React.Component<ArticleProps> {
@@ -47,10 +46,14 @@ export const getStaticProps: GetStaticProps<ArticleProps> = async ({ params }) =
4746
props: {
4847
article: article.toApiArticle({ cover: "https://codecoolture.com/static/articles/cover.jpg" }),
4948

50-
mdx: await serialize(article.getContent(), {
51-
mdxOptions: {
52-
rehypePlugins: [rehypeHighligh, rehypeUnwrapImages],
53-
remarkPlugins: [remarkGfm],
49+
mdx: await serialize({
50+
source: article.getContent(),
51+
52+
options: {
53+
mdxOptions: {
54+
rehypePlugins: [rehypeHighlight, rehypeUnwrapImages],
55+
remarkPlugins: [remarkGfm],
56+
},
5457
},
5558
}),
5659
},

pages/notes/[slug].tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import { GetStaticPaths, GetStaticProps } from "next";
2-
import { MDXRemoteSerializeResult } from "next-mdx-remote";
3-
import { serialize } from "next-mdx-remote/serialize";
4-
import React from "react";
5-
import rehypeHighligh from "rehype-highlight";
2+
import rehypeHighlight from "rehype-highlight";
63
import rehypeUnwrapImages from "rehype-unwrap-images";
74
import remarkGfm from "remark-gfm";
5+
import { serialize, type SerializeResult } from "next-mdx-remote-client/serialize";
86

97
import { ApiArticle } from "@/cms/api/ApiArticle";
108
import { getNotesRepository } from "@/cms/repositories";
119
import { Post } from "@/layouts/Post";
1210
import { isDevelopment } from "@/lib/env";
1311

14-
interface NoteProps {
15-
mdx: MDXRemoteSerializeResult;
12+
type NoteProps = {
13+
mdx: SerializeResult;
1614
note: ApiArticle;
17-
}
15+
};
1816

19-
export default class Notes extends React.Component<NoteProps> {
20-
public render() {
21-
return <Post breadcrumbs={[{ label: "Notes", url: "/notes" }]} mdx={this.props.mdx} post={this.props.note} />;
22-
}
17+
export default function Note(props: Readonly<NoteProps>) {
18+
return <Post breadcrumbs={[{ label: "Notes", url: "/notes" }]} mdx={props.mdx} post={props.note} />;
2319
}
2420

2521
export const getStaticPaths: GetStaticPaths = async () => {
@@ -47,10 +43,14 @@ export const getStaticProps: GetStaticProps<NoteProps> = async ({ params }) => {
4743
props: {
4844
note: note.toApiArticle({ cover: "https://codecoolture.com/static/notes/cover.jpg" }),
4945

50-
mdx: await serialize(note.getContent(), {
51-
mdxOptions: {
52-
rehypePlugins: [rehypeHighligh, rehypeUnwrapImages],
53-
remarkPlugins: [remarkGfm],
46+
mdx: await serialize({
47+
source: note.getContent(),
48+
49+
options: {
50+
mdxOptions: {
51+
rehypePlugins: [rehypeHighlight, rehypeUnwrapImages],
52+
remarkPlugins: [remarkGfm],
53+
},
5454
},
5555
}),
5656
},

styles/index.css

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
--ff-sans-serif: var(--font-ibm-plex-sans);
2929
--ff-monospace: var(--font-ibm-plex-mono);
3030

31-
--fs-xl: 2.5rem;
32-
--fs-l: 1.5rem;
33-
--fs-m: 18px;
34-
--fs-s: 0.8rem;
35-
--fs-xs: 0.6rem;
36-
--fs-xxs: 0.5rem;
31+
/* Typographic scale based on Perfect Fourth ratio (1.333) */
32+
--fs-2xl: 2.369rem;
33+
--fs-xl: 1.777rem;
34+
--fs-l: 1.333rem;
35+
--fs-m: 1rem;
36+
--fs-s: 0.75rem;
37+
--fs-xs: 0.563rem;
3738

3839
--c-white: #fff;
3940
}

0 commit comments

Comments
 (0)