how to install hexo and deploy it

博客搭建

1.nodejs

2.git

3.github.io上部署hexo项目

4.命令

4.1启动
  • npm install -g hexo-cli: install hexo client
  • hexo init empty_fold_name: create a default hexo project
  • hexo server: start hexo ,you can visit it through localhost:8080
4.2 创建并部署新文件
4.2.1 文件夹
  • hexo new directory_name file_name
4.2.2 文件
  • hexo new [layout] <title>

    • layout:
      • post(default)
      • page
      • draft

    hexo new page —path about/me “About me”` :创建文件

  • hexo generate 生成静态文件 : compile markdown file to html

  • hexo generate -d 文件生成后部署: auto depoly to site you configured

4.3 删除
  • 1.直接在_post文件夹下删除
  • 2 hexo g: 重新生成html文件
  • 3 hexo d: 部署,部署前先verify一下邮箱

5主题

  • 使用git将主题下载到themes下
  • 主配置中将主题替换你所想要的

6.心得

  • _post下的页面才会出现在主页的链接里

  • 定义标签需要 创建tags(page),并在md文件指定 type: tags

    • 其它文件归类时

      1
      tags:
      2
      - love
  • 下载next主题

7.其它

7.1 支持latex
  • 7.1.1 更换渲染器

    1
    $ npm uninstall hexo-renderer-marked --save
    2
    $ npm install hexo-renderer-kramed --save
  • 7.1.2 文章加引用

    1
    mathjax: true
  • 7.1.3 主题开启mathjax

    1
    mathjax:  
    2
    	enable: true
0%