# docsify-demo **Repository Path**: chenylin8848/docsify-demo ## Basic Information - **Project Name**: docsify-demo - **Description**: 基于docsify构建知识库demo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-25 - **Last Updated**: 2022-01-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # docsify搭建知识库demo > A demo for docsify. ## 1.介绍 官网地址 [docsify](https://docsify.js.org/#/) ## 2.安装 ### 1.前置环境 1.查看npm ```bash npm -v ``` 2.若还未安装npm,需要先安装node.js ### 2.安装docsify 1.安装docsify ```bash npm i docsify-cli -g ``` 2.查看docsify版本 ``` bash docsify -v ``` ## 3.快速开始 ### 1.创建一个空文件夹 ### 2.初始化 ```b docsify init ``` ### 3.运行 ```bash docsify serve . ``` ### 4.目录结构 ``` | .nojekyll | index.html | README.md ``` ## 4.特色功能 ### 1.多文件 例如下目录: ``` text └── docsify-demo ├── README.md ├── guide.md └── content ├── README.md └── test.md ``` 对应的路径为: ```text docsify-demos/README.md => http://domain.com docsify-demo/guide.md => http://domain.com/#/guide docsify-demo/content/README.md => http://domain.com/#/content/ docsify-demo/content/test.md => http://domain.com/#/content/test ``` ### 2.主题 ```markdown ``` ### 3.侧边栏 1.在index.html中设置 ```js window.$docsify = { name: '', repo: '', //设置侧边栏 loadSidebar: true } ``` 2.在项目根目录下新建_sidebar.md ```markdown \* [首页](/) - [guide](guide.md) * [content](content/) ``` ### 4.导航栏 1.在index.html设置 ```js window.$docsify = { name: '', repo: '', //设置侧边栏 loadSidebar: false, //设置导航栏 loadNavbar: true } ``` 2.在项目根目录下新建_navbar.md ```markdown - [首页](/) - content - [content](content/) - [test](content/test) ``` ### 5.封面 1.在index.html设置 ```js window.$docsify = { name: '', repo: '', //设置侧边栏 loadSidebar: false, //设置导航栏 loadNavbar: true, //设置封面 coverpage: true } ``` 2.在项目根目录下新建_coverpage.md ```markdown ## docsify搭建知识库demo > A demo for docsify. - [Get Started](README.md) ``` ### 6.设置章鱼猫 在index.html设置 ```js window.$docsify = { name: '', //设置章鱼猫 repo: "https://gitee.com/chenylin8848/chens-coding", //设置侧边栏 loadSidebar: false, //设置导航栏 loadNavbar: true, //设置封面 coverpage: true, } ``` ## 5.部署 将项目文件上传到服务器,用nginx进行配置,即可访问。