Skip to content

Commit

Permalink
⬆️ upgrade nextra
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineKM committed Jul 29, 2024
1 parent 27f3b6f commit a3fd195
Show file tree
Hide file tree
Showing 16 changed files with 1,162 additions and 856 deletions.
46 changes: 0 additions & 46 deletions components/Brand/index.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions components/Footer/index.tsx

This file was deleted.

19 changes: 4 additions & 15 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const nextra = require("nextra");

/**
* @type {import("nextra").NextraConfig}
*/
const config = {
const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.js",
unstable_flexsearch: true,
unstable_staticImage: true,
};

const withNextra = nextra(config);

module.exports = withNextra({
compiler: {
styledComponents: true,
},
themeConfig: "./theme.config.tsx",
});

module.exports = withNextra();
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@
"author": "Shu Ding",
"license": "MIT",
"dependencies": {
"@onruntime/next-link": "^0.1.5",
"@reach/skip-nav": "^0.18.0",
"@types/styled-components": "^5.1.26",
"next": "^12.1.6",
"next-seo": "^6.0.0",
"nextra": "2.0.0-alpha.56",
"nextra-theme-docs": "2.0.0-alpha.59",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^9.0.0",
"styled-components": "^5.3.5",
"react-markdown": "^9.0.1",
"urlcat": "^3.0.0"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions pages/_app.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default function App({ Component, pageProps }) {
// eslint-disable-next-line react/jsx-filename-extension
return <Component {...pageProps} />;
}
22 changes: 0 additions & 22 deletions pages/_app.tsx

This file was deleted.

55 changes: 0 additions & 55 deletions pages/_document.tsx

This file was deleted.

File renamed without changes.
File renamed without changes.
24 changes: 11 additions & 13 deletions pages/contributing/code-of-conduct.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useSSG } from 'nextra/ssg';
import Markdown from 'react-markdown';
import { useSSG } from "nextra/ssg";
import Markdown from "react-markdown";

export const getStaticProps = ({ params }) => {
return fetch(`https://raw.githubusercontent.com/onRuntime/.github/master/.github/CODE_OF_CONDUCT.md`)
return fetch(
"https://raw.githubusercontent.com/onRuntime/.github/master/.github/CODE_OF_CONDUCT.md",
)
.then((res) => res.text())
.then((text) => ({
props: {
Expand All @@ -14,17 +16,13 @@ export const getStaticProps = ({ params }) => {
},
// The page will be considered as stale and regenerated every 60 seconds.
revalidate: 60,
}))
}
}));
};

export const CodeOfConduct = ({ ssg }) => {
const { markdown } = useSSG(ssg);

return (
<Markdown>
{markdown}
</Markdown>
)
}

<CodeOfConduct />
return <Markdown>{markdown}</Markdown>;
};

<CodeOfConduct />;
47 changes: 0 additions & 47 deletions styles/global.css

This file was deleted.

2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const makePrimaryColor =
module.exports = {
content: [
"./{pages,components,context,styles}/**/*.{js,css,ts,tsx,mdx}",
"./theme.config.js",
"./theme.config.tsx",
],
theme: {
screens: {
Expand Down
35 changes: 10 additions & 25 deletions theme.config.js → theme.config.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
/* eslint-disable react/jsx-filename-extension */
import Footer from "@components/Footer";
import Brand from "@components/Brand";
import urlcat from "urlcat";
import { DocsThemeConfig, useConfig } from "nextra-theme-docs";

/**
* @type {import("./theme").DocsThemeConfig}
*/
const config = {
github: "https://github.com/onRuntime/onruntime-docs",
const config: DocsThemeConfig = {
docsRepositoryBase: "https://github.com/onRuntime/onruntime-docs/blob/master",
titleSuffix: " | onRuntime Studio",
projectChatLink: "https://discord.gg/ucX9c5yXmX",
logo: <Brand />,
head: ({ title = "onRuntime Studio", meta }) => {
logo: <span>onRuntime</span>,
head: function useHead() {
const config = useConfig();
const {
title,
frontMatter: { meta },
} = config;
const description =
meta.description ||
meta?.description ||
"Studio that brings together teams of creators and develops applications, website and game platforms.";

const ogImage = urlcat(`https://og-image.onruntime.com/${title}.jpeg`, {
Expand Down Expand Up @@ -45,18 +42,6 @@ const config = {
</>
);
},
search: true,
defaultMenuCollapsed: true,
prevLinks: true,
nextLinks: true,
footer: true,
floatTOC: true,
footerEditLink: "Edit this page on GitHub",
footerText: <Footer />,
feedbackLabels: "feedback",
feedbackLink: "Feedback",
unstable_faviconGlyph: "👋",
unstable_flexsearch: true,
};

export default config;
70 changes: 0 additions & 70 deletions theme.ts

This file was deleted.

Loading

0 comments on commit a3fd195

Please sign in to comment.