Commands: help Get help on a command. init Create a new Hexo folder. version Display version information.
Global Options: --config Specify config file instead of using _config.yml --cwd Specify the CWD --debug Display all verbose messages in the terminal --draft Display draft posts --safe Disable all plugins and scripts --silent Hide output on console
For more help, you can use 'hexo help [command]' for the detailed information or you can check the docs: http://hexo.io/docs/ Sing-2:~ Sing$
Sing-2:hexo1 Sing$ hexo generate hexo serverINFO Start processing INFO Files loaded in 200 ms INFO Generated: index.html ... INFO Generated: css/fonts/fontawesome-webfont.svg INFO 28 files generated in 623 ms Sing-2:hexo1 Sing$ hexo server INFO Start processing INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
可以看到成功启动了服务,并且在浏览器输入 http://localhost:4000/ 查看,按Ctrl+C停止服务。 如果执行 hexo server 提示找不到该指令的话需要安装 server 并重新执行命令即可(Hexo 3.0 后 server 被单独出来)
1
npm install hexo -server --save
搭建 gighub 个人博客
前面已经说到了注册 github 账号,注册登录之后在右上角点击 “+” 选择 New repository 此时你已经可以通过 https://账户名.github.io 来访问你的博客了,然后我们将本地的hexo和你的github博客同步起来。
# Site title: Sing #网站标题 subtitle: 笔记 #网站副标题 description: #网站描述 author: Sing #作者 language: zh-CN #语言 timezone: # 网站时区,默认使用您电脑的时区。
# URL ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' url: #你的站点Url root: / #站点的根目录 permalink: :year/:month/:day/:title/ #文章的 永久链接 格式 permalink_defaults: #永久链接中各部分的默认值
# Home page setting # path: Root path for your blogs index page. (default = '') # per_page: Posts displayed per page. (0 = disable pagination) # order_by: Posts order. (Order by date descending by default) index_generator: path: '' per_page: 10 # 首页每页10条数据 order_by: -date # 时间倒序排列
# Category & Tag default_category: uncategorized category_map: #分类别名 tag_map: #标签别名
# Date / Time format ## Hexo uses Moment.js to parse and display date ## You can customize the date format as defined in ## http://momentjs.com/docs/#/displaying/format/ date_format: YYYY-MM-DD #日期格式 time_format: HH:mm:ss #时间格式
# Pagination ## Set per_page to 0 to disable pagination per_page: 10 #分页数量 pagination_dir: page