Skip to content

Commit 6c79af3

Browse files
committed
Merge branch 'dev' into pr/hryer/15257
2 parents dd0a892 + fba9632 commit 6c79af3

File tree

311 files changed

+6932
-5553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+6932
-5553
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12715,6 +12715,15 @@
1271512715
"contributions": [
1271612716
"code"
1271712717
]
12718+
},
12719+
{
12720+
"login": "JJOptimist",
12721+
"name": "JJOptimist",
12722+
"avatar_url": "https://avatars.githubusercontent.com/u/86833563?v=4",
12723+
"profile": "https://github.com/JJOptimist",
12724+
"contributions": [
12725+
"bug"
12726+
]
1271812727
}
1271912728
],
1272012729
"contributorsPerLine": 7,

.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { addons } from "@storybook/manager-api"
22

3-
import favicon from "../public/images/favicon.png"
3+
import favicon from "../public/images/eth-home-icon.png"
44

55
import theme from "./theme"
66

.storybook/preview-head.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

.storybook/preview.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import isChromatic from "chromatic/isChromatic"
22
import { MotionGlobalConfig } from "framer-motion"
3+
import { IBM_Plex_Mono, Inter } from "next/font/google"
34
import type { Preview } from "@storybook/react"
45

56
import ThemeProvider from "@/components/ThemeProvider"
@@ -9,11 +10,24 @@ import nextIntl, { baseLocales } from "./next-intl"
910
import { withNextThemes } from "./withNextThemes"
1011

1112
import "../src/styles/global.css"
12-
import "../src/styles/fonts.css"
1313
import "../src/styles/docsearch.css"
1414

1515
import "@docsearch/css"
1616

17+
const inter = Inter({
18+
subsets: ["latin"],
19+
display: "swap",
20+
variable: "--font-inter",
21+
preload: true,
22+
})
23+
24+
const ibmPlexMono = IBM_Plex_Mono({
25+
subsets: ["latin"],
26+
weight: ["400"],
27+
display: "swap",
28+
variable: "--font-mono",
29+
})
30+
1731
MotionGlobalConfig.skipAnimations = isChromatic()
1832

1933
export const breakpointSet: [token: string, value: string][] = [
@@ -39,11 +53,13 @@ const preview: Preview = {
3953
defaultTheme: "light",
4054
}),
4155
(Story) => (
42-
<ThemeProvider>
43-
<TooltipProvider>
44-
<Story />
45-
</TooltipProvider>
46-
</ThemeProvider>
56+
<div className={`${inter.variable} ${ibmPlexMono.variable}`}>
57+
<ThemeProvider>
58+
<TooltipProvider>
59+
<Story />
60+
</TooltipProvider>
61+
</ThemeProvider>
62+
</div>
4763
),
4864
],
4965
parameters: {

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,6 +1945,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
19451945
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jenish-thapa"><img src="https://avatars.githubusercontent.com/u/141203631?v=4?s=100" width="100px;" alt="Jenish Thapa"/><br /><sub><b>Jenish Thapa</b></sub></a><br /><a href="#ideas-jenish-thapa" title="Ideas, Planning, & Feedback">🤔</a></td>
19461946
<td align="center" valign="top" width="14.28%"><a href="https://jiangxue.org/~ritsu"><img src="https://avatars.githubusercontent.com/u/57232813?v=4?s=100" width="100px;" alt="iusx"/><br /><sub><b>iusx</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=iusx" title="Code">💻</a></td>
19471947
</tr>
1948+
<tr>
1949+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/JJOptimist"><img src="https://avatars.githubusercontent.com/u/86833563?v=4?s=100" width="100px;" alt="JJOptimist"/><br /><sub><b>JJOptimist</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AJJOptimist" title="Bug reports">🐛</a></td>
1950+
</tr>
19481951
</tbody>
19491952
</table>
19501953

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import I18nProvider from "@/components/I18nProvider"
66
import mdComponents from "@/components/MdComponents"
77

88
import { dataLoader } from "@/lib/utils/data/dataLoader"
9+
import { dateToString } from "@/lib/utils/date"
910
import { getPostSlugs } from "@/lib/utils/md"
1011
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1112

@@ -18,6 +19,18 @@ import { getMdMetadata } from "@/lib/md/metadata"
1819

1920
const loadData = dataLoader([["gfissues", fetchGFIs]])
2021

22+
function getLayoutFromSlug(slug: string) {
23+
if (slug.includes("developers/docs")) {
24+
return "docs"
25+
}
26+
27+
if (slug.includes("developers/tutorials")) {
28+
return "tutorial"
29+
}
30+
31+
return "static"
32+
}
33+
2134
export default async function Page({
2235
params,
2336
}: {
@@ -49,6 +62,8 @@ export default async function Page({
4962
tocItems,
5063
lastEditLocaleTimestamp,
5164
isTranslated,
65+
contributors,
66+
timeToRead,
5267
} = await getPageData({
5368
locale,
5469
slug,
@@ -61,9 +76,14 @@ export default async function Page({
6176
})
6277

6378
// Determine the actual layout after we have the frontmatter
64-
const layout = frontmatter.template || "static"
79+
const layout = frontmatter.template || getLayoutFromSlug(slug)
6580
const Layout = layoutMapping[layout]
6681

82+
// If the page has a published date, format it
83+
if ("published" in frontmatter) {
84+
frontmatter.published = dateToString(frontmatter.published)
85+
}
86+
6787
// Get i18n messages
6888
const allMessages = await getMessages({ locale })
6989
const requiredNamespaces = getRequiredNamespacesForPage(slug, layout)
@@ -77,6 +97,8 @@ export default async function Page({
7797
tocItems={tocItems}
7898
lastEditLocaleTimestamp={lastEditLocaleTimestamp}
7999
contentNotTranslated={!isTranslated}
100+
contributors={contributors}
101+
timeToRead={Math.round(timeToRead.minutes)}
80102
>
81103
{content}
82104
</Layout>
@@ -85,7 +107,7 @@ export default async function Page({
85107
}
86108

87109
export async function generateStaticParams() {
88-
const slugs = await getPostSlugs("/", /\/developers/)
110+
const slugs = await getPostSlugs("/")
89111

90112
return LOCALES_CODES.flatMap((locale) =>
91113
slugs.map((slug) => ({
@@ -95,6 +117,8 @@ export async function generateStaticParams() {
95117
)
96118
}
97119

120+
export const dynamicParams = false
121+
98122
export async function generateMetadata({
99123
params,
100124
}: {

0 commit comments

Comments
 (0)