Skip to content

Commit abfeacd

Browse files
committed
Added some new options in the NavigationView 🚀
1 parent 6d0abd0 commit abfeacd

File tree

138 files changed

+28320
-16456
lines changed

Some content is hidden

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

138 files changed

+28320
-16456
lines changed

.test.ts.swp

12 KB
Binary file not shown.

docs/.github/screenshot.png

286 KB
Loading

docs/.gitignore

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
# Dependencies
2-
/node_modules
3-
4-
# Production
5-
/build
6-
7-
# Generated files
8-
.docusaurus
9-
.cache-loader
10-
11-
# Misc
12-
.DS_Store
13-
.env.local
14-
.env.development.local
15-
.env.test.local
16-
.env.production.local
17-
18-
npm-debug.log*
19-
yarn-debug.log*
20-
yarn-error.log*
1+
.next
2+
node_modules
3+
_pagefind/

docs/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Shu Ding
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
1-
# Website
1+
# Nextra Docs Starter
22

3-
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
3+
This starter template includes the following features:
44

5-
### Installation
5+
- [x] **Nextra 4**
6+
- [x] **Search with Pagefind**
7+
- [x] **Lucide Icons**
68

7-
```
8-
$ yarn
9-
```
10-
11-
### Local Development
12-
13-
```
14-
$ yarn start
15-
```
9+
[**Live Demo →**](https://nextra-docs-starter.vercel.app)
1610

17-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
11+
[![](.github/screenshot.png)](https://nextra-docs-starter.vercel.app)
1812

19-
### Build
13+
## Quick Start
2014

21-
```
22-
$ yarn build
23-
```
15+
You can deploy this template on Vercel by clicking the button below
2416

25-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
17+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fphucbm%2Fnextra-docs-starter)
2618

27-
### Deployment
19+
## Local Development
2820

29-
Using SSH:
21+
### Clone this repository
3022

31-
```
32-
$ USE_SSH=true yarn deploy
23+
Using the GitHub CLI:
24+
```bash
25+
gh repo clone phucbm/nextra-docs-starter
3326
```
3427

35-
Not using SSH:
36-
28+
### Install
29+
```bash
30+
pnpm i
3731
```
38-
$ GIT_USER=<Your GitHub username> yarn deploy
32+
33+
### Run the development server
34+
```bash
35+
pnpm dev
3936
```
4037

41-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
38+
## License
39+
40+
This project is licensed under the MIT License.

docs/app/[[...mdxPath]]/page.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { generateStaticParamsFor, importPage } from 'nextra/pages'
2+
import { useMDXComponents as getMDXComponents } from '../../mdx-components'
3+
4+
export const generateStaticParams = generateStaticParamsFor('mdxPath')
5+
6+
export async function generateMetadata(props) {
7+
const params = await props.params
8+
const { metadata } = await importPage(params.mdxPath)
9+
return metadata
10+
}
11+
12+
const Wrapper = getMDXComponents().wrapper
13+
14+
export default async function Page(props) {
15+
const params = await props.params
16+
const result = await importPage(params.mdxPath)
17+
const { default: MDXContent, toc, metadata } = result
18+
return (
19+
<Wrapper toc={toc} metadata={metadata}>
20+
<MDXContent {...props} params={params} />
21+
</Wrapper>
22+
)
23+
}

docs/app/layout.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { Footer, Layout, Navbar } from "nextra-theme-docs";
2+
import { Banner, Head, Search } from "nextra/components";
3+
import { getPageMap } from "nextra/page-map";
4+
import "nextra-theme-docs/style.css";
5+
import Link from "next/link";
6+
7+
export const metadata = {
8+
// Define your metadata here
9+
// For more information on metadata API, see: https://nextjs.org/docs/app/building-your-application/optimizing/metadata
10+
};
11+
12+
const banner = (
13+
<Banner storageKey="some-key">
14+
This template was created with 🩸 and 💦 by{" "}
15+
<Link href="https://github.com/phucbm">PHUCBM</Link> 🐧
16+
</Banner>
17+
);
18+
const navbar = (
19+
<Navbar
20+
logo={
21+
<img src="/images/general/logo.svg" alt="Logo" width={100} height={20} />
22+
}
23+
// ... Your additional navbar options
24+
/>
25+
);
26+
const footer = <Footer>MIT {new Date().getFullYear()} © Nextra.</Footer>;
27+
28+
export default async function RootLayout({ children }) {
29+
return (
30+
<html
31+
// Not required, but good for SEO
32+
lang="en"
33+
// Required to be set
34+
dir="ltr"
35+
// Suggested by `next-themes` package https://github.com/pacocoursey/next-themes#with-app
36+
suppressHydrationWarning
37+
>
38+
<Head
39+
// ... Your additional head options
40+
>
41+
<link rel="shortcut icon" href="/images/general/icon.svg" />
42+
{/* Your additional tags should be passed as `children` of `<Head>` element */}
43+
</Head>
44+
<body>
45+
<Layout
46+
banner={banner}
47+
navbar={navbar}
48+
pageMap={await getPageMap()}
49+
docsRepositoryBase="https://github.com/phucbm/nextra-docs-starter/tree/main"
50+
footer={footer}
51+
// ... Your additional layout options
52+
>
53+
{children}
54+
</Layout>
55+
</body>
56+
</html>
57+
);
58+
}
59+
60+
export function getState() {}

docs/babel.config.js

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

docs/components/ResponsiveImage.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export function ResponsiveImage({
2+
src,
3+
alt,
4+
width = "100%",
5+
style = {},
6+
}: {
7+
src: string;
8+
alt?: string;
9+
width?: string;
10+
style?: React.CSSProperties;
11+
}) {
12+
return (
13+
<img
14+
src={src}
15+
alt={alt}
16+
style={{
17+
maxWidth: width,
18+
height: "auto",
19+
display: "block",
20+
margin: "0 auto",
21+
...style,
22+
}}
23+
/>
24+
);
25+
}

docs/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./ResponsiveImage";

0 commit comments

Comments
 (0)