hexo 建站总结

Hexo 建站过程

Prerequisite

  1. 一个 Github 账号,申请教程

  2. 在电脑上安装 git,[git安装教程]在(https://blog.csdn.net/yaorongke/article/details/119085413)

  3. 在电脑上安装 NodeJS,NodeJS安装教程

Hexo 安装和本地测试

  1. 安装 hexo

    1
    npm install -g hexo-cli
  2. 查看 hexo 版本

    1
    hexo -v
  3. 创建 blog

    1
    2
    3
    hexo init {YOUR_BLOG_NAME}
    cd {YOUR_BLOG_NAME}
    npm install
  4. blog的本地启动

    1
    2
    hexo g -d # generate and deploy
    hexo s # server
  5. 浏览器访问 http://localhost:4000 即可打开新建的博客,页面的默认风格如下
    hexo默认页面

Hexo 的默认主题可能比较丑陋,不过hexo本身提供了很多不同的主题,比较常用(互联网上资源较多的)有 NeXTFluid

Github pages部署

Hexo 官方 Hello world

这个官方的 Hello world 可以看做是一个操作手册

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment


hexo 建站总结
https://duhaode520.github.io/2023/10/22/hexo-建站/
作者
Ade
发布于
2023年10月22日
许可协议