title: hexo blog deploy cloud framework code
Hexo framework to achieve personal blog on cloud code
This article written inspired by https://www.jianshu.com/p/84ae2ba1c133
Local Debugging
After installing Node.js https://nodejs.org/en/
Install git bash tool https://gitforwindows.org/
- A blog folder in the directory, and cd into the directory
- Right git bash here
- Enter the command npm install -g hexo-cli
- Check whether the installation is successful, enter the command hexo -v displays the version number is the successful installation
Began to build
Can refer to the official documentation https://hexo.io/zh-cn/docs/
- Creating architecture
- hexo init
If you can not complete this step go to show that the clon github URL to download decompression, the effect is the same, bearing in mind that the theme of which is empty, you need to go to a website to download the theme theme put inside.
- Local start debugging
- hexo s (This step is mainly to see local results, after also here think it is almost upward gitee deployment.
- In the browser, type http: // localhost: 4000 to see results
- Press ctrl + c in git bash window to exit the Local Service
- Create a blog
- hexo generate (or direct input hexo g) directory will be more a public folder
- hexo new "My first post"
- Articles will be automatically generated in the / source / _post directory
Hexo provides a quick and easy one-click deployment capabilities, but we must first install a plug-in.
Enter the command in bash git:- npm install hexo-deployer-git --save
Next is the root of the configuration file modification value _config.jml deploy, the front modified as follows:
deploy:
type: git
repo: Your warehouse address
Remote deployment
New warehouse and landing Gitee
- Once you've created a watch that addresses your warehouse
- Began deploying open git bash enter commands in a blog folder:
git config --global user.name "Your Name" git config --global user.email "[email protected]"
hexo deploy
After the input code will pop up a cloud account password dialog box. After the successful deployment of code into their own cloud accounts, projects created before viewing the file appears in the local project folder in the public
Then open the cloud Pages function code
- Services → gitpage → start
- Try to access links
- If the subject of the page not manifest, pay attention to the startup configuration pages that use Help
- Set up URL
url: 你仓库地址 root: 你项目地址
Deployed to the remote
- hexo d
carry out
- https: // repository name .gitee.io / project name /
Theme change
Download the zip package to extract the themes folder or git clone down
Changes in the blog directory
theme: 主题名(默认是landscape)
Clean and Build
- hexo clean
- hexo g
- Debugging and deployment
- hexo d