Hexo blog deploy cloud framework code

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

  1. After installing Node.js https://nodejs.org/en/

  2. Install git bash tool https://gitforwindows.org/

  3. 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/

  1. 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.

  2. Local start debugging
    • hexo s (This step is mainly to see local results, after also here think it is almost upward gitee deployment.
  3. In the browser, type http: // localhost: 4000 to see results
    • Press ctrl + c in git bash window to exit the Local Service
  4. 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
  5. 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
  6. 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

  1. New warehouse and landing Gitee

    • Once you've created a watch that addresses your warehouse
  2. 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

  1. Then open the cloud Pages function code

    • Services → gitpage → start
    • Try to access links
  2. If the subject of the page not manifest, pay attention to the startup configuration pages that use Help
    • Set up URL
    url: 你仓库地址
    root: 你项目地址
  3. Deployed to the remote

    • hexo d
  4. carry out

    • https: // repository name .gitee.io / project name /

Theme change

  1. Download the zip package to extract the themes folder or git clone down

  2. Changes in the blog directory

    • theme: 主题名(默认是landscape)
  3. Clean and Build

    • hexo clean
    • hexo g
  4. Debugging and deployment
    • hexo d

Guess you like

Origin www.cnblogs.com/zxkwdw/p/11370311.html