Fork me on GitHub

hexo常用命令笔记

hexo

npm install -g hexo
npm update -g hexo
hexo init 

常用

hexo n == hexo new "a new post"  新建文章,最好用双引号括起来

hexo g == hexo generate     生成静态文件到public文件夹

hexo s == hexo server    Server at localhost:4000,根目录为public

hexo d == hexo deploy   部署到远程服务里,例如github

hexo p == hexo publish  新建草稿draft

hexo clean     清除缓存文件

hexo new page "about" 生成 /source/about/index.md 文件

服务器

hexo server    默认为动态监听

hexo server -s   静态模式

hexo server -p 5000  指定端口

hexo server -i 10.20.62.123   指定IP

文章摘要  

方式1:在front-matter中编写

description: "This a digest bla bla..."

方式2

在文章中插入一行 <!--more--> 以上部分为摘要

 添加RSS

npm install hexo-generator-feed --save

使用方法:在hexo/_config.yml中添加
feed:
  type: atom
  path: atom.xml
  limit: 20
  hub: 

重新 hexo g 就会在public中生成atom.xml了

然后可以在所用的theme的_config.yml中添加菜单

  menu:

   ...

     RSS: /atom.xml

     ...


添加sitemap

npm install hexo-generator-sitemap --save

_config.yml

sitemap:
    path: sitemap.xml

 

 

 

 

 

 

posted @ 2016-05-20 02:26  Roronoa__Zoro  阅读(614)  评论(0编辑  收藏  举报