0%

Hexo创建发布文章并同步git

通过HEXO发布文章

  1. 安装 git windows 版本

  2. 通过Git Bash或者CMD定位到HEXO搭建站的根目录下

  3. 命令行输入

    1
    $ hexo new "new article"

    之后在source/_posts目录下面,多了一个new-article.md的文件,具体可以参考 Hexo 入门指南(三) - 文章 & 草稿
    可以通过有道云笔记创建md文件并编辑,或者[mdeditor在线编辑]

  4. md文件编辑好之后,cmd命令行输入

    1
    hexo generate

然后各种静态文件会生成好:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
INFO  Files loaded in 2.37 s
INFO Generated: js/script.js
INFO Generated: fancybox/jquery.fancybox.pack.js
INFO Generated: fancybox/jquery.fancybox.js
INFO Generated: fancybox/jquery.fancybox.css
INFO Generated: fancybox/helpers/jquery.fancybox-thumbs.js
INFO Generated: fancybox/helpers/jquery.fancybox-thumbs.css
INFO Generated: fancybox/helpers/jquery.fancybox-media.js
INFO Generated: fancybox/helpers/jquery.fancybox-buttons.js
INFO Generated: fancybox/helpers/jquery.fancybox-buttons.css
INFO Generated: fancybox/helpers/fancybox_buttons.png
INFO Generated: fancybox/fancybox_sprite@2x.png
INFO Generated: fancybox/fancybox_sprite.png
INFO Generated: fancybox/fancybox_overlay.png
INFO Generated: fancybox/fancybox_loading@2x.gif
INFO Generated: fancybox/fancybox_loading.gif
INFO Generated: fancybox/blank.gif
INFO Generated: css/style.css
INFO Generated: css/images/banner.jpg
INFO Generated: css/fonts/fontawesome-webfont.woff
INFO Generated: css/fonts/fontawesome-webfont.ttf
INFO Generated: css/fonts/fontawesome-webfont.svg
INFO Generated: css/fonts/fontawesome-webfont.eot
INFO Generated: css/fonts/FontAwesome.otf
INFO Generated: 2015/12/13/Hello/index.html
INFO Generated: 2015/12/13/hello-world/index.html
INFO Generated: archives/index.html
INFO Generated: archives/2015/index.html
INFO Generated: archives/2015/12/index.html
INFO Generated: index.html
INFO 29 files generated in 2.19 s
  1. 通过hexo s 可以本地预览网站。
    1
    INFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.
    现在打开浏览器访问http://localhost:4000/试试吧!

如何同步本地HEXO项目文件到github备份

  1. 安装github桌面版
  2. 选中github上需要同步过去的项目
  3. 然后change都能清晰看到,然后直接同步即可。记住安装git和github