Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
w568w committed Jul 30, 2023
1 parent 3eb9e2d commit f91e9e9
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 107 deletions.
3 changes: 3 additions & 0 deletions docs/danxi/01-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 应用简介

This is my **first Docusaurus document**!
9 changes: 9 additions & 0 deletions docs/danxi/02-architecture/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "应用架构",
"collapsible": true,
"collapsed": true,
"link": {
"type": "generated-index",
"title": "架构总览"
}
}
1 change: 1 addition & 0 deletions docs/danxi/02-architecture/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Feature
51 changes: 10 additions & 41 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
---
sidebar_position: 1
---
import DocCardList from '@theme/DocCardList';

# Tutorial Intro
# 导航

Let's discover **Docusaurus in less than 5 minutes**.
欢迎来到旦夕开发文档。

## Getting Started

Get started by **creating a new site**.

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.

### What you'll need

- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.

## Generate a new site

Generate a new Docusaurus site using the **classic template**.

The classic template will automatically be added to your project after you run the command:

```bash
npm init docusaurus@latest my-website classic
```

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to run Docusaurus.

## Start your site

Run the development server:

```bash
cd my-website
npm run start
```

The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
<DocCardList items={[
{
type: 'link',
label: '旦夕 App(Flutter)',
href: 'danxi/intro'
}
]} />
8 changes: 0 additions & 8 deletions docs/tutorial-basics/_category_.json

This file was deleted.

7 changes: 0 additions & 7 deletions docs/tutorial-extras/_category_.json

This file was deleted.

68 changes: 37 additions & 31 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const config = {
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-test-site.com',
url: 'https://danxi.fduhole.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
baseUrl: '/docs/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down Expand Up @@ -42,14 +42,14 @@ const config = {
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
'https://github.com/DanXi-Dev/docs',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
'https://github.com/DanXi-Dev/docs',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand All @@ -64,21 +64,27 @@ const config = {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Site',
title: '旦夕开发',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
sidebarId: 'introSidebar',
position: 'left',
label: 'Tutorial',
label: '总览',
},
{
type: 'docSidebar',
sidebarId: 'danxiAppSidebar',
position: 'left',
label: '旦夕 App',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/DanXi-Dev/docs',
label: 'GitHub',
position: 'right',
},
Expand All @@ -88,46 +94,46 @@ const config = {
style: 'dark',
links: [
{
title: 'Docs',
title: '文档',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
to: 'docs/intro',
},
],
},
// {
// title: 'Community',
// items: [
// {
// label: 'Stack Overflow',
// href: 'https://stackoverflow.com/questions/tagged/docusaurus',
// },
// {
// label: 'Discord',
// href: 'https://discordapp.com/invite/docusaurus',
// },
// {
// label: 'Twitter',
// href: 'https://twitter.com/docusaurus',
// },
// ],
// },
{
title: 'More',
title: '更多',
items: [
{
label: 'Blog',
to: '/blog',
to: 'blog',
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/DanXi-Dev/docs',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} DanXi-Dev. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
Expand Down
33 changes: 19 additions & 14 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,26 @@

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
introSidebar: ["intro", {
"Document Basic": [
{
type: 'autogenerated',
dirName: 'tutorial-basics',
}
],
"Document Extra": [
{
type: 'autogenerated',
dirName: 'tutorial-extras',
}
],
},],
danxiAppSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
*/
type: 'autogenerated',
dirName: 'danxi',
}
]
};

module.exports = sidebars;
12 changes: 6 additions & 6 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function HomepageHeader() {
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/intro">
Docusaurus Tutorial - 5min ⏱️
to="docs/intro">
阅读文档 📖
</Link>
</div>
</div>
Expand All @@ -27,15 +27,15 @@ function HomepageHeader() {
}

export default function Home(): JSX.Element {
const {siteConfig} = useDocusaurusContext();
// const {siteConfig} = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
title={`首页`}
description="Description will go into a meta tag in <head />">
<HomepageHeader />
<main>
{/* <main>
<HomepageFeatures />
</main>
</main> */}
</Layout>
);
}

0 comments on commit f91e9e9

Please sign in to comment.