Deploy vuepress on centos7

Vuepress is an excellent and concise document generator, which can automatically generate corresponding html files according to the md documents in the directory, with a simple and generous interface. Every page generated by VuePress comes with pre-rendered HTML, so it has very good loading performance and search engine optimization (SEO). This article will introduce how to deploy vuepress in CentOS7 environment. You can appreciate the effect before deciding whether to build it: https://mfrank2016.github.io/wikibook/. Personally, I think it's pretty good, simple and generous.

One, install nodejs

curl -sL https://rpm.nodesource.com/setup_8.x | sudo bash -
yum install nodejs

Two, install vuepress

npm install -g vuepress

Three, create a working directory

mkdir project
cd project
mkdir docs

Four, before initialization

npm init -y
vim package.json

Edited to the following content, here is actually setting the command alias.

{" scripts":{"docs:dev":"vuepress dev docs","docs:build":"vuepress build docs"}}

Create a .vuepress directory.

mkdir .vuepress
cd .vuepress

Create config.js, this is the global configuration file of vuepress, most of the properties are set here.

mkdir public
vim config.js

Modified to the following content, the corresponding content can be modified by yourself. The official documentation is here: https://vuepress.vuejs.org/zh/config/

module.exports ={
 title:'Cool breeze wiki',
 description:'I'm waiting for the wind, also waiting for you',//The path relative to the git repository, such as the full path: https://mfrank2016.github.io/wikibook/Then set to'/wikibook/'
 base:'/wikibook/',
 host:'0.0.0.0',//Run port
 port:8081,

 themeConfig:{//gitc warehouse address
  repo:'https://github.com/MFrank2016/wikibook',//If your document is not at the root of the repository
   docsDir:'docs',//Optional, default is master
  docsBranch:'master',//The default is true, set to false to disable
  editLinks:true,//Navigation Bar
  nav:[{ text:'Home', link:'/'},{ text:'Guide', link:'/guide/'},{ text:'External', link:'https://google.com'},{ text:'Languages',
    items:[{ text:'Chinese', link:'/language/chinese'},{ text:'Japanese', link:'/language/japanese'}]}],
   sidebar:[{
   title:'Group 1',
   collapsable:false,
   children:['/']},{
   title:'Group 2',
   children:['/']}]},//search for
 search:true,
 searchMaxSuggestions:10,
 lastUpdated:'Last Updated',// string | boolean}

the whole frame

project
├─── docs
│ ├── README.md
│ ├── .vuepress
│ ├── config.js
│ └── public
│ └── hero.png
│ └── guide
│ └── README.md
└── package.json

Five, initialization

Create README.md in the docs directory

---
home:true
heroImage:/hero.png
actionText:click to read
actionLink:/guide/
footer: MIT Licensed | Copyright © 2018-present Frank
---

Then go back to the project directory

# Open debugging mode, run the service, open http at this time://localhost:8081(Here is the port set above)I can see the simplest page
vuepress dev

# Build, at this time, the md document will be converted into an html file and stored in docs/.vuepress/dist directory
vuepress build

Six, debug deployment

At this point, the static web page has been generated in the docs/.vuepress/dist directory, you can first turn on the debugging mode, and then use ftp and other software to connect to the server remotely, modify the document under docs, and upload each modification , It will be recompiled automatically, of course, the whole process takes one or two minutes, depending on the performance of the server. Adjust it to a suitable level and move it to the corresponding directory of nginx or apache.

Recommended Posts

Deploy vuepress on centos7
Deploy Jenkin on centos7
Centos7.6 deploy django+nginx+uwsgi
CentOS 7 deploy OpenLDAP+FreeRadius
Kickstart+PXE automatically deploy CentOS6.6
Install Docker on Centos7
Deploy GitBook under CentOS7
install LNMP on centos7.4
Build k8s1.9.9 on centos7
Install Java on Centos 7
Xfs configuration on centos7
Configure Ocserv on CentOS 6
Nodejs install on centos7
Install FFmpeg on CentOS 8
Install RabbitMQ on CentOS 7
Install Node.js on Centos
CentOS 6.8 deploy zookeeper cluster
CentOS 7 deploy saltstack service
Maven install on centos7
Install MongoDB on CentOS 7
Jenkins build on centos
Install Surelog on CentOS8
Deploy JDK+Tomcat8 under CentOS
Openjdk install on centos7
Install Jenkins on centos7
Use RapidSVN on CentOS7
Centos6.8 deploy vnc service
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
install Docker on centos6.5
install oracle on centos
Install Elasticsearch 6 on centos7
Install RabbitMQ on CentOS7
CentOS7 deploy vsftp (FTP) service
Install mysql online on centos
Install ElasticSearch 7.x on CentOS 7
Glusterfs cluster installation on Centos7
Build MariaDB replication on CentOS
CentOS 7.2 deploy Node.js development environment
Install MySQL 8.0.16 on Linux Centos
Deploy front-end projects using centOS 7
Deployment of graphite on centos7
Install docker transfer on Centos7
CentOS 7.2 deploy mail server (Postfix)
Configure swap space on CentOS7
Install docker on Centos system
install EPEL repo on centos
CentOS7.7 deploy k8s (1 master + 2 node)
Install Zabbix 3.4 based on CentOS 7
install virtualbox on centos server
Docker EE installation on centos7
Install Nginx server on CentOS 7
How to install jdk1.8 on centOS7
Common Linux operations (based on centos7)
How to install Memcached on CentOS 8
Install MATE or XFCE on CentOS 7
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
CentOS 8 (2)
How to install TensorFlow on CentOS 8
How to Update to gcc4.9.x on Centos7