Skip to content

Commit fe551d8

Browse files
author
hfcai
committed
feat: 首次提交创建模板
1 parent fdc72c5 commit fe551d8

15 files changed

+2359
-18
lines changed

.gitignore

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
1-
# Build and Release Folders
2-
bin-debug/
3-
bin-release/
4-
[Oo]bj/
5-
[Bb]in/
6-
7-
# Other files and folders
8-
.settings/
9-
10-
# Executables
11-
*.swf
12-
*.air
13-
*.ipa
14-
*.apk
15-
16-
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
17-
# should NOT be excluded as they contain compiler settings and other important
18-
# information for Eclipse / Flash Builder.
1+
.next
2+
node_modules

components/counters.module.css

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.counter {
2+
border: 1px solid #ccc;
3+
border-radius: 5px;
4+
padding: 2px 6px;
5+
margin: 12px 0 0;
6+
}

components/counters.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Example from https://beta.reactjs.org/learn
2+
3+
import { useState } from 'react'
4+
import styles from './counters.module.css'
5+
6+
function MyButton() {
7+
const [count, setCount] = useState(0)
8+
9+
function handleClick() {
10+
setCount(count + 1)
11+
}
12+
13+
return (
14+
<div>
15+
<button onClick={handleClick} className={styles.counter}>
16+
Clicked {count} times
17+
</button>
18+
</div>
19+
)
20+
}
21+
22+
export default function MyApp() {
23+
return <MyButton />
24+
}

next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const withNextra = require('nextra')({
2+
theme: 'nextra-theme-docs',
3+
themeConfig: './theme.config.tsx',
4+
})
5+
6+
module.exports = withNextra()

package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "magic-webpack-docs",
3+
"version": "0.0.1",
4+
"description": "magic webpack docs",
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/amikoj/magic-webpack-docs.git"
13+
},
14+
"author": "Shu Ding <[email protected]>",
15+
"license": "MIT",
16+
"bugs": {
17+
"url": "https://github.com/shuding/nextra-docs-template/issues"
18+
},
19+
"homepage": "https://github.com/amikoj/magic-webpack-docs#readme",
20+
"dependencies": {
21+
"next": "^13.0.6",
22+
"nextra": "latest",
23+
"nextra-theme-docs": "latest",
24+
"react": "^18.2.0",
25+
"react-dom": "^18.2.0"
26+
},
27+
"devDependencies": {
28+
"@types/node": "18.11.10",
29+
"typescript": "^4.9.3"
30+
}
31+
}

pages/_meta.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"index": "Introduction",
3+
"another": "Another Page",
4+
"advanced": "Advanced (A Folder)",
5+
"about": {
6+
"title": "关于",
7+
"type": "page"
8+
},
9+
"contact": {
10+
"title": "联系我 ↗",
11+
"type": "page",
12+
"href": "https://github.com/amikoj",
13+
"newWindow": true
14+
}
15+
}

pages/about.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# About
2+
3+
This is the about page! This page is shown on the navbar.

pages/advanced.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Advanced
2+
3+
This is the index page for the Advanced folder!

pages/advanced/satori.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Satori
2+
3+
Satori (悟り) is a Japanese Buddhist term for awakening, "comprehension; understanding".

pages/another.mdx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Another Page
2+
3+
```js filename="demo.js" {3} copy
4+
let a = 1;
5+
6+
console.log(a);
7+
```
8+
9+
## Component
10+
11+
import { useState } from 'react'
12+
13+
{/* Import CSS modules */}
14+
import styles from '../components/counters.module.css'
15+
16+
export const Counter = () => {
17+
const [count, setCount] = useState(0);
18+
return (
19+
<div>
20+
<button onClick={() => setCount(count + 1)} className={styles.counter}>Clicked {count} times</button>
21+
</div>
22+
);
23+
};
24+
25+
<Counter/>
26+
27+
## External Component
28+
29+
import Counters from '../components/counters'
30+
31+
<Counters />

pages/index.mdx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Introduction
2+
3+
Welcome to Nextra! This is a basic docs template. You can use it as a starting point for your own project :)
4+
5+
## What is Nextra?
6+
7+
A **simple**, **powerful** and **flexible** site generation framework with everything you love from Next.js.
8+
9+
## Documentation
10+
11+
The documentation is available at [https://nextra.site](https://nextra.site).

0 commit comments

Comments
 (0)