zishu's blog

zishu's blog

一个热爱生活的博主。https://zishu.me

Build a document based on docsify

1. Building#

docsify is a static documentation program similar to vuepress and gitbook. However, compared to the others, I personally prefer the style and source code of docsify. I don't want too many additional features, just the ability to write articles and have a table of contents.

Click to view the demo.

Open the terminal and enter the command to set up the local environment:

npm install docsify-cli -g

Initialize the documentation:

docsify init ./docs

Run locally:

docs serve

Then open localhost:3000 in your browser to view it.

2. Pages#

I think the most basic pages are three:

  1. _navbar.md

Navigation bar

* [About](/)

Then call it in index.html.

window.$docsify = {
    ...
    loadNavbar: true,
    ...
}

As shown in the image:

image

  1. _sidebar.md

Sidebar

* [Building a Documentation with docsify](Building a Documentation with docsify.md)

Call it in index.html.

window.$docsify = {
    ...
    loadSidebar: true,
    ...
}

As shown in the image:

image

  1. README.md

Homepage

## about

Blog address: [https://imhan.cn](https://imhan.cn)

Author: shuxhan

Date: 2021.04.20

This document serves as a backup of the blog articles. If you have any other comments on the articles, you can directly click the link to the original address.

As shown in the image:

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.