Building code under the cloud gitee + hexo blog mac

Prior to myself a lot of notes, but they are in the private cloud notes, some classic, some messy, independence, Better Together, thought, or to be a blog, finishing the review process, the hope has a nice ring harvest ~

Individual static blog, in fact, less than dedicated servers to buy, with a good point templates, search, map bed, visitor statistics, comments, and other functions are readily available, and easy to set up.

Online way to build the complex, all kinds, the paper summed up, leaving only the essence, and error-prone details, and recorded reference links at the end.

The general idea is to use gitee (code cloud) do storage (articles and pictures), github is not personally feel at home cloud faster access code. Automatically generating and using a deployment frame is hexo.

Pre-need to install Git, Node.js, this brew can be used directly in the mac.

First, the initial text describes how to create and access a personal blog page under test gitee own domain name.

Then explain how to deploy a default template hexo, and generate, distribute, show success.

The rest is to explain how to use a good template.

Comments are currently not fumble too, such as free after the test is successful, then a record.

Warehouse of the same name created in the cloud code, and test new index.html

If you want to access your pages home address without a secondary directory, such as ipvb.gitee.io, you need to build a warehouse of the same name and address of their personality, such as https://gitee.com/ipvb the user wants to create its own site, but do not want access to a subdirectory, I would like to ipvb.gitee.io direct access, then he can create a name for the warehouse ipvb of https://gitee.com/ipvb/ipvb deployment is complete, it can https://ipvb.gitee.io be visited.

Once created, the new index.html

Select Service - "Gitee Pages

Installation hexo, deployment topics

Client installation hexo

npm install -g hexo-cli

Deployment directory with hexo

hexo init myblog
cd myblog
npm install

Local to see results

hexo server

accesshttp://localhost:4000

Install deployment module:

npm install hexo-deployer-git --save

modify_config.yml

url: https://veyronc.gitee.io/
root: /
deploy:
  type: git
  repo: https://gitee.com/veyronc/veyronc.git
  branch: master

Note that there is a space after the colon configuration.

Clean build deployment

hexo clean
hexo generate
hexo deploy

hexo deployCode is about to spread to new cloud project code just built. Enter the code to make the first performance of the cloud user name and password.

Once uploaded, you need to code a cloud service - "Gitee Pages, which again click Update.

The default theme may load slowly, the purpose is to introduce familiar hexo update and publish operations, the actual use of the following themes look better. Previously generated folder deleted it does not matter.

Change theme

Theme can go to https://hexo.io/themes/ to choose, bloggers election is aircloud.

https://github.com/aircloud/hexo-aircloud-blog

Not just under the directory operations. Re-find a place.

git clone https://github.com/aircloud/hexo-aircloud-blog.git --recursive
cd hexo-aircloud-blog
npm install
hexo serve

Such as modifying the last chapter_config.yml

url: https://veyronc.gitee.io/
root: /
deploy:
  type: git
  repo: https://gitee.com/veyronc/veyronc.git
  branch: master

Clean up, build, deploy,

hexo clean
hexo generate
hexo deploy

Or you can do one of the following commands, let Hexo automatic deployment site after the completion of generation, the role of the two commands are the same.

hexo generate --deploy
hexo deploy --generate

It can be abbreviated as

hexo g -d
hexo d -g

After each deploy change, want to visit https://veyronc.gitee.io/to see the results, you need to code in the cloud service time - "Gitee Pages, click inside the update again.

Adding and deleting articles

Add article hexo new '文章新建测试'will see

INFO  Created: ……/hexo-aircloud-blog/source/_posts/文章新建测试.md

Then to modify it. Tags can be multiple.

---
title: 文章新建测试
date: 2019-03-21 01:03:47
tags:
    - 标签1
    - 标签2
---

Delete the article to be deleted is the directory hexo-aircloud-blog/source/_postswhere the article

After the implementation or build, deploy, and finally remember to update Pages service in gitee.

hexo cleanOperating official description is:

Cleans the cache file (db.json) and generated files (public).

Discover the test, if you do not execute the command to delete the source/_postsinside of the article, visit the page can not see, but will continue to exist gitee the publicfolder.

Articles used in the picture

Pictures can also use gitee storage, and laid themhexo-aircloud-blog/source/img

md file loaded with ![](/img/kds.jpg)

Note: blog source code and the generated code is stored separately

A series of operations described above, is the blog generated code spread code released cloud-code repository. In addition, Imagine if your local computer break up how to do, the next generation configuration is not too much trouble, so the whole hexo-aircloud-blog folder, or create a new code repository to save it can be saved as a private warehouse.

"Blog source code": Hexo source code, including the themes directory (blog template), source directory (use MarkDown write a blog), etc.

"Blog generated code": execute code hexo generate or hexo server command generated Hexo is automatically generated, and then the public directory.

Bloggers method used should be relatively easy to create a new private warehouse blog-source, clone down after the previous blog to generate code directory so copy the file over.

In the blog-source root operation is equivalent to spread git private blog source code repository blog-source.

With hexo command operation is uploaded to the blog generated code repository.

reference

https://gitee.com/help/articles/4136#article-header1

https://github.com/aircloud/hexo-theme-aircloud

https://blog.csdn.net/adobeid/article/details/81259381#giteement

https://wudong.tech/2018/08/29/Hexo%E6%8E%A5%E5%85%A5%E7%A0%81%E4%BA%91%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F/

https://blog.csdn.net/qq_34461514/article/details/79733669

https://hexo.io/docs/commands

https://hexo.io/zh-cn/docs/deployment

https://segmentfault.com/q/1010000008049369/a-1020000008049754

Guess you like

Origin www.cnblogs.com/xrszff/p/10960147.html