Skip to content

Commit c04b466

Browse files
authored
docs: Add link to learn.next-intl.dev (#1984)
1 parent 7261a54 commit c04b466

File tree

8 files changed

+63
-23
lines changed

8 files changed

+63
-23
lines changed

docs/src/components/Footer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default function Footer() {
1717
<div>
1818
<FooterLink href="/docs">Docs</FooterLink>
1919
<FooterSeparator />
20+
<FooterLink href="https://learn.next-intl.dev">Learn</FooterLink>
21+
<FooterSeparator />
2022
<FooterLink href="/examples">Examples</FooterLink>
2123
<FooterSeparator />
2224
<FooterLink href="/blog">Blog</FooterLink>

docs/src/pages/_meta.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ export default {
99
title: 'Docs',
1010
type: 'page'
1111
},
12+
learn: {
13+
title: 'Learn',
14+
type: 'page',
15+
titleChildren: (
16+
<span className="absolute -right-4 -top-3 rotate-6 rounded-sm bg-green-500 px-1 py-[1px] text-[10px] font-semibold uppercase tracking-wider text-white group-[.navbar-home]:bg-green-300 group-[.navbar-home]:text-green-900 dark:bg-green-300 dark:text-green-900">
17+
New!
18+
</span>
19+
),
20+
theme: {
21+
sidebar: false,
22+
toc: false
23+
},
24+
href: 'https://learn.next-intl.dev'
25+
},
1226
examples: {
1327
title: 'Examples',
1428
type: 'page',

docs/src/pages/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import GetStartedBackground from '@/components/GetStartedBackground';
2121
getStarted="Get started"
2222
viewExample="View an example"
2323
announcement={{
24-
href: '/blog/next-intl-4-0',
25-
label: 'next-intl 4.0 is out now!'
24+
href: 'https://learn.next-intl.dev',
25+
label: 'learn.next-intl.dev is out now!'
2626
}}
2727
/>
2828
<PartnerBanner intro="Presented by" />

docs/src/styles.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
/**
18-
* Navbar on home
18+
* Navbar
1919
*/
2020
.navbar-home {
2121
@apply bg-slate-850 text-white dark:bg-slate-850;
@@ -43,6 +43,10 @@
4343
@apply bg-white dark:bg-black md:bg-transparent md:dark:bg-transparent;
4444
}
4545

46+
.nextra-nav-container > nav > div:nth-child(2) {
47+
@apply py-5;
48+
}
49+
4650
/**
4751
* TOC
4852
*/

docs/src/theme.config.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,6 @@ export default {
2626
components: {
2727
pre: Pre
2828
},
29-
banner: {
30-
key: 'banner-learn-next-intl-announcement',
31-
content: (
32-
<div className="text-center">
33-
Announcing{' '}
34-
<a
35-
className="underline"
36-
href="https://learn.next-intl.dev"
37-
rel="noreferrer"
38-
target="_blank"
39-
>
40-
learn.next-intl.dev
41-
</a>
42-
!
43-
</div>
44-
)
45-
},
4629
footer: {
4730
component: Footer
4831
},
@@ -92,7 +75,7 @@ export default {
9275
if (!isRoot) return <Navbar {...props} />;
9376

9477
return (
95-
<div className="navbar-home">
78+
<div className="navbar-home group">
9679
<Navbar {...props} />
9780
</div>
9881
);

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"pnpm": {
1515
"overrides": {
1616
"@babel/parser": "7.21.9"
17+
},
18+
"patchedDependencies": {
19+
"nextra-theme-docs": "patches/nextra-theme-docs.patch"
1720
}
1821
},
1922
"packageManager": "[email protected]"

patches/nextra-theme-docs.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/dist/index.js b/dist/index.js
2+
index 56201641fd965dcc5ab7c5df53e444c41293c00e..0c1b131ffea455aeaa988b9b550bf3ab37f7e5f0 100644
3+
--- a/dist/index.js
4+
+++ b/dist/index.js
5+
@@ -1406,7 +1406,7 @@ function Navbar({ items }) {
6+
children: renderComponent(themeConfig.logo)
7+
}
8+
) : /* @__PURE__ */ jsx19("div", { className: "_flex _items-center ltr:_mr-auto rtl:_ml-auto", children: renderComponent(themeConfig.logo) }),
9+
- /* @__PURE__ */ jsx19("div", { className: "_flex _gap-4 _overflow-x-auto nextra-scrollbar _py-1.5", children: items.map((pageOrMenu) => {
10+
+ /* @__PURE__ */ jsx19("div", { className: "_flex _overflow-x-auto nextra-scrollbar _py-1.5", style: {gap: '1.5rem'}, children: items.map((pageOrMenu) => {
11+
if (pageOrMenu.display === "hidden") return null;
12+
if (pageOrMenu.type === "menu") {
13+
const menu2 = pageOrMenu;
14+
@@ -1424,12 +1424,13 @@ function Navbar({ items }) {
15+
href,
16+
className: cn11(
17+
classes2.link,
18+
- "max-md:_hidden _whitespace-nowrap _ring-inset",
19+
+ page.className,
20+
+ "max-md:_hidden _whitespace-nowrap _ring-inset _relative",
21+
!isActive || page.newWindow ? classes2.inactive : classes2.active
22+
),
23+
newWindow: page.newWindow,
24+
"aria-current": !page.newWindow && isActive,
25+
- children: page.title
26+
+ children: [page.title, page.titleChildren]
27+
},
28+
href
29+
);

pnpm-lock.yaml

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)