0%

Hexo Tutorial

Hexo官网
Maupassant主题
Next主题

配置环境

  • 安装npm环境 https://www.npmjs.com/
  • 安装nodejs https://nodejs.org/en/
  • 安装Git
  • 打开Terminal, 执行以下命令
    1
    2
    3
    4
    5
    6
    7
    8
    9
    $ npm install hexo-cli -g

    $ hexo init [your_blog_folder_name]

    $ cd [your_blog_folder_name]

    $ npm install

    $ hexo server

blog使用

Command

  • init

    1
    $ hexo init [folder]
  • new

    1
    $ hexo new [layout] <title>
  • generate

    1
    $ hexo generate
  • publish

    1
    $ hexo publish [layout] <filename>
  • server

    1
    $ hexo server

Writing

Github部署

  • 使用你的Github名字创建repo
  • 修改根目录下的 _config.yml
    deploy:
    type: git  
    repo: [your_git_repository]
    branch: [your_branch_name, e.g. master]
    message: [whatever]
    
  • 输入以下命令,部署blog
    1
    2
    3
    4
    5
    npm install hexo-deployer-git –save
    cd blog
    hexo clean
    hexo generate
    hexo deploy