Skip to content

Commit 750a9ee

Browse files
authored
Migrate to nextra v3 (#1094)
* release notes init * typo * migration changes * Update versions * Make social card link external * Fix headings * Add spacing * update release notes * update sitemap
1 parent 92d12ee commit 750a9ee

File tree

166 files changed

+2482
-2462
lines changed

Some content is hidden

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

166 files changed

+2482
-2462
lines changed

components/Footer.js

+16-17
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@ import Image from "next/image";
33
import Link from "next/link";
44

55
const ExternalLink = ({ href, children }) => (
6-
<Link
7-
href={href}
8-
target="_blank"
9-
rel="noopener noreferrer"
10-
className="external-link"
11-
>
12-
<span className="external-link-text">{children}</span>
13-
<Image
14-
src="/docs/external-link.svg"
15-
alt="External Link"
16-
width={16}
17-
height={17}
18-
/>
19-
</Link>
6+
<a href={href} target="_blank" rel="noopener noreferrer" className="external-link">
7+
<span className="external-link-text">{children}</span>
8+
<Image
9+
src="/docs/external-link.svg"
10+
alt="External Link"
11+
width={16}
12+
height={17}
13+
/>
14+
</a>
2015
);
2116

22-
const Footer = () => (
23-
<footer className="flex flex-col pt-[56px] lg:pt-[107px] px-[40px] lg:px-[156px] h-full lg:h-[511px] bg-[#F9F9F9] dark:bg-[#231F20] items-center">
17+
const Footer = () => {
18+
return (
19+
<div className="whole-footer-wrapper">
20+
<footer className="flex flex-col pt-[56px] lg:pt-[107px] px-[40px] lg:px-[156px] h-full lg:h-[511px] bg-[#F9F9F9] dark:bg-[#231F20] items-center">
2421
<div className="flex flex-col lg:flex-row gap-[40px] lg:gap-[80px] mb-[45px]">
2522
<div className="flex flex-col mr-[140px] w-[162px] h-[56px]">
2623
<a href="https://memgraph.com">
@@ -105,6 +102,8 @@ const Footer = () => (
105102
Copyright © {new Date().getFullYear()} Memgraph
106103
</div>
107104
</footer>
108-
);
105+
</div>
106+
);
107+
};
109108

110109
export default Footer;

components/HeadComponent.tsx

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { useRouter } from "next/router";
2+
import { useConfig } from "nextra-theme-docs";
3+
4+
export const HeadComponent = () => {
5+
const { asPath, defaultLocale, locale } = useRouter();
6+
const { frontMatter } = useConfig();
7+
8+
const url =
9+
"https://memgraph.com/docs" +
10+
(defaultLocale === locale ? asPath : `/${locale}${asPath}`);
11+
const description =
12+
frontMatter.description ||
13+
"Discover the comprehensive Memgraph documentation and learn how to use the powerful graph database to its full potential.";
14+
const imageUrl =
15+
frontMatter.image ||
16+
"https://memgraph.com/docs/memgraph-docs-ogimage-small.png";
17+
18+
return (
19+
<>
20+
{/* Basic Metadata */}
21+
<title>{frontMatter.title || "Memgraph documentation"}</title>
22+
<meta name="description" content={description} />
23+
<link rel="icon" href="/docs/favicon.png" type="image/png" />
24+
<link rel="canonical" href={url} />
25+
26+
{/* Open Graph Meta Tags */}
27+
<meta property="og:type" content="website" />
28+
<meta property="og:url" content={url} />
29+
<meta property="og:title" content={frontMatter.title || "Memgraph documentation"} />
30+
<meta property="og:description" content={description} />
31+
<meta property="og:image" content={imageUrl} />
32+
<meta property="og:image:width" content="600" />
33+
<meta property="og:image:height" content="314" />
34+
<meta property="og:site_name" content="Memgraph documentation" />
35+
36+
{/* Twitter Meta Tags */}
37+
<meta property="twitter:card" content="summary_large_image" />
38+
<meta property="twitter:title" content={frontMatter.title || "Memgraph documentation"} />
39+
<meta property="twitter:description" content={description} />
40+
<meta property="twitter:image" content={imageUrl} />
41+
<meta property="twitter:site" content="@memgraphdb" />
42+
<meta property="twitter:creator" content="@memgraphdb" />
43+
</>
44+
);
45+
};

components/icons/MemgraphLogo.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const MemgraphLogo = () => {
2+
return (
3+
<img
4+
src="/docs/memgraph-logo-navigation.svg"
5+
alt="Memgraph Logo"
6+
style={{ height: "24px", verticalAlign: "middle", marginRight: "1em" }}
7+
/>
8+
);
9+
};
10+

components/social-card/SocialCard.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { ReactElement } from 'react';
1+
import type { ReactNode } from 'react';
22

33
interface SocialCardProps {
4-
icon: ReactElement;
4+
icon: ReactNode;
55
title: string;
66
href: string;
77
body: string;
@@ -11,6 +11,7 @@ export function SocialCard({ icon, title, href, body }: SocialCardProps) {
1111
return (
1212
<a
1313
href={href}
14+
target='_blank'
1415
className="social-card group flex flex-col justify-start overflow-hidden rounded-lg border border-gray-200 text-current no-underline dark:shadow-none hover:shadow-gray-100 dark:hover:shadow-none shadow-gray-100 active:shadow-sm active:shadow-gray-200 transition-all duration-200 hover:border-gray-300 bg-transparent shadow-sm dark:border-neutral-800 hover:bg-slate-50 hover:shadow-md dark:hover:border-neutral-700 dark:hover:bg-neutral-900"
1516
>
1617
<div className="p-4 flex flex-col gap-2 dark:bg-[#3a3436]">

next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

next-sitemap.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/** @type {import('next-sitemap').IConfig} */
22
module.exports = {
33
siteUrl: 'https://memgraph.com/docs',
4-
generateIndexSitemap: false
5-
}
4+
generateIndexSitemap: false,
5+
exclude: ['*/_meta']
6+
}
67

next.config.js renamed to next.config.mjs

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
const withNextra = require('nextra')({
1+
import nextra from 'nextra'
2+
3+
const withNextra = nextra({
24
theme: 'nextra-theme-docs',
35
themeConfig: './theme.config.tsx',
46
latex: true,
7+
search: {
8+
codeblocks: false
9+
},
510
defaultShowCopyCode: true
611
})
712

8-
module.exports = withNextra({
13+
14+
15+
export default withNextra({
916
trailingSlash: false,
1017
basePath: '/docs',
11-
assetPrefix: '/docs',
18+
assetPrefix: '/docs',
19+
reactStrictMode: true,
1220
async redirects() {
1321
return [
1422
{

package.json

+11-9
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@
1919
},
2020
"homepage": "https://github.com/shuding/nextra-docs-template#readme",
2121
"dependencies": {
22-
"autoprefixer": "^10.4.15",
22+
"autoprefixer": "^10.4.20",
2323
"flexsearch": "0.7.31",
24-
"next": "^13.4.19",
24+
"next": "^15.1.3",
2525
"next-sitemap": "^4.2.3",
26-
"nextra": "^2.12.3",
27-
"nextra-theme-docs": "^2.12.3",
28-
"postcss": "^8.4.29",
29-
"react": "^18.2.0",
30-
"react-dom": "^18.2.0",
31-
"tailwindcss": "^3.3.3"
26+
"nextra": "^3.3.1",
27+
"nextra-theme-docs": "^3.3.1",
28+
"pnpm": "^9.15.2",
29+
"postcss": "^8.4.49",
30+
"react": "^18.3.1",
31+
"react-dom": "^18.3.1",
32+
"tailwindcss": "^3.4.17"
3233
},
3334
"devDependencies": {
3435
"@types/node": "20.6.0",
35-
"typescript": "^5.2.2"
36+
"@types/react": "18",
37+
"typescript": "^5.7.2"
3638
},
3739
"pnpm": {
3840
"overrides": {

pages/_app.tsx

-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ function MyApp({ Component, pageProps }: AppProps) {
99

1010
return (
1111
<>
12-
<Script strategy="lazyOnload" id="google-tag-manager">{`
13-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
14-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
15-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
16-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
17-
})(window,document,'script','dataLayer','GTM-N45PRD5');
18-
`}</Script>
1912
<main className={inter.className}>
2013
<Component {...pageProps} />
2114
</main>

pages/_meta.json renamed to pages/_meta.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
export default {
22
"index": "Home",
33
"getting-started": "Getting started",
44
"client-libraries": "Client libraries",
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{
1+
export default {
22
"available-algorithms": "Available algorithms",
33
"deep-path-traversal": "Deep path traversal algorithms",
44
"install-mage": "Install MAGE",
55
"run-algorithms": "Run algorithms",
66
"utilize-networkx": "Utilize NetworkX"
7-
}
7+
};

pages/advanced-algorithms/available-algorithms/_meta.json renamed to pages/advanced-algorithms/available-algorithms/_meta.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
export default {
22
"algo": "algo",
33
"betweenness_centrality_online": "betweenness_centrality_online",
44
"betweenness_centrality": "betweenness_centrality",
@@ -61,4 +61,4 @@
6161
"vrp": "vrp",
6262
"weakly_connected_components": "weakly_connected_components",
6363
"xml_module": "xml_module"
64-
}
64+
};

0 commit comments

Comments
 (0)