Skip to content

Commit

Permalink
add nextra (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
4leite authored May 31, 2024
1 parent c62bdd6 commit b091e58
Show file tree
Hide file tree
Showing 16 changed files with 2,671 additions and 101 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import nextra from "nextra"

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
Expand All @@ -15,4 +17,10 @@ const nextConfig = {
},
}

export default nextConfig
const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.jsx",
// ... your Nextra config
})

export default withNextra(nextConfig)
2 changes: 2 additions & 0 deletions apps/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
},
"dependencies": {
"next": "14.2.3",
"nextra": "3.0.0-alpha.24",
"nextra-theme-docs": "3.0.0-alpha.24",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Binary file added apps/documentation/public/favicon.ico
Binary file not shown.
File renamed without changes
Binary file removed apps/documentation/src/app/favicon.ico
Binary file not shown.
46 changes: 0 additions & 46 deletions apps/documentation/src/app/layout.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/documentation/src/app/not-found.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions apps/documentation/src/app/page.tsx

This file was deleted.

File renamed without changes.
13 changes: 13 additions & 0 deletions apps/documentation/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import "@/globals.css"
import type { AppProps } from "next/app"
import { Montserrat } from "next/font/google"

const font = Montserrat({ subsets: ["latin"] })

export default function MyApp({ Component, pageProps }: AppProps) {
return (
<main className={font.className}>
<Component {...pageProps} />
</main>
)
}
6 changes: 6 additions & 0 deletions apps/documentation/src/pages/_meta.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
index: {
title: "Home",
type: "page",
},
}
3 changes: 3 additions & 0 deletions apps/documentation/src/pages/about.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Welcome to Nextra

Hello, world!
6 changes: 6 additions & 0 deletions apps/documentation/src/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div className="flex justify-center pt-10">
<div className="prose dark:prose-invert">
<h1>OberonCMS</h1>
<p>We're nearly here now...</p>
</div>
</div>
38 changes: 38 additions & 0 deletions apps/documentation/theme.config.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { useConfig } from "nextra-theme-docs"
import Image from "next/image"

export default {
logo: <Image src="/icon.svg" width="30" height="30" alt="OberonCMS logo" />,
project: {
link: "https://github.com/tohuhono/oberon",
},
docsRepositoryBase:
"https://github.com/tohuhono/oberon/tree/main/apps/documentation/",
useNextSeoProps() {
return {
titleTemplate: "%s – SWR",
}
},
head: () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { frontMatter } = useConfig()

return (
<>
<meta
property="og:title"
content={frontMatter.title || "OberonCMS Documentation"}
/>
<meta
property="og:description"
content={
frontMatter.description ||
"A CMS for developers, designers and content creators."
}
/>
</>
)
},

// ... other theme options
}
10 changes: 6 additions & 4 deletions apps/documentation/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"emitDeclarationOnly": false,
"paths": {
"@/*": ["./src/*"]
}
},
"strictNullChecks": true
},
"include": [
"next-env.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
".next/types/**/*.ts"
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"theme.config.jsx"
],
"exclude": ["node_modules"]
}
Loading

0 comments on commit b091e58

Please sign in to comment.