The first step

For details on how to use gitbook, see the documentation: juejin.cn/post/698544…

The written Gitbook document file generates a collection of _book documents using the gitbook build command

The file structure is as follows:

The generated HTML page cannot be redirected

We can modify theme. Js in the gitbook folder

willifReplace (m)if(false)
Copy the code

The third step

Upload the _book folder to the server using Filezilla or SSH

The fourth step

Configure nginx

Create a new book.conf file in /etc/nginx/cond.conf

server {
        listen 8888;
        listen [::]:8888; location / { alias /home/ubuntu/_book/; autoindex on; }}Copy the code

Run the following command to load the configuration file:

/usr/sbin/nginx -t 
/usr/sbin/nginx -s reload
Copy the code

Step 5

Open your browser and view your book

There was a hiccup:

Exceptional js plug-ins, the generated image path is/Chapter1 / images/one. JPG, but our _book Chapter1 no images in the folder, can be manually create, will play pictures into it