6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Hexoでgithubにデプロイする

Posted at

はじめに

こんにちは。インフラエンジニアレベル1のf_prgです。
Hexoには、deployする機能があります。
http://fprg.github.io/
にデプロイしたいと思います。

Hexoのデプロイ、github編

ドキュメント

ドキュメントはコチラです。
http://hexo.io/docs/deployment.html

_config.ymlに設定を記述します。

_config.yml
# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: github
  repo: https://github.com/fprg/fprg.github.io
  branch: master
  message: Hexo deploy

デプロイを実行します。

デプロイのコマンドはコチラを参考にしてください。
http://hexo.io/docs/commands.html#deploy
-g オプションでデプロイ前にサイトの生成が実行されます。

[22:55:38][f_prg@mba:blog]# hexo deploy -g
[info] Files loaded in 0.212s
[update] Generated: archives/index.html (174ms)
[update] Generated: archives/2014/index.html (61ms)
[update] Generated: archives/2014/08/index.html (72ms)
[update] Generated: categories/Nodejs/index.html (33ms)
[update] Generated: categories/Ruby/index.html (11ms)
[update] Generated: index.html (48ms)
[update] Generated: 2014/08/11/hexo_deploy_github/index.html (41ms)
[update] Generated: 2014/08/10/hexo_image_setting/index.html (23ms)
[update] Generated: 2014/08/10/hexo_feed_plugin/index.html (18ms)
[update] Generated: 2014/08/10/hexo_site_setup/index.html (11ms)
[update] Generated: 2014/08/10/hexo_install/index.html (38ms)
[update] Generated: 2014/08/10/mac_ruby_rbenv/index.html (15ms)
[update] Generated: 2014/08/10/hello-world/index.html (10ms)
[update] Generated: tags/Mac/index.html (19ms)
[update] Generated: tags/Ruby/index.html (28ms)
[update] Generated: tags/rbenv/index.html (23ms)
[update] Generated: tags/Hexo/index.html (36ms)
[update] Generated: tags/Nodejs/index.html (33ms)
[update] Generated: tags/github/index.html (12ms)
[update] Generated: atom.xml (2ms)
[update] Generated: 2014/08/10/hexo_install/hexo_install_001.png (5ms)
[info] 21 files generated in 0.740s
[info] Start deploying: github
[info] Setting up GitHub deployment...
Initialized empty Git repository in /Users/f_prg/Documents/project/node-hexo-blog/blog/.deploy/.git/
[master (root-commit) 3bb6716] First commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 placeholder
[info] Clearing .deploy folder...
[info] Copying files from public folder...
[master 358b0db] Hexo deploy
 45 files changed, 12032 insertions(+)
 create mode 100644 2014/08/10/hello-world/index.html
 create mode 100644 2014/08/10/hexo_feed_plugin/index.html
 create mode 100644 2014/08/10/hexo_image_setting/index.html
 create mode 100644 2014/08/10/hexo_install/hexo_install_001.png
 create mode 100644 2014/08/10/hexo_install/index.html
 create mode 100644 2014/08/10/hexo_site_setup/index.html
 create mode 100644 2014/08/10/mac_ruby_rbenv/index.html
 create mode 100644 2014/08/11/hexo_deploy_github/index.html
 create mode 100644 archives/2014/08/index.html
 create mode 100644 archives/2014/index.html
 create mode 100644 archives/index.html
 create mode 100644 atom.xml
 create mode 100644 categories/Nodejs/index.html
 create mode 100644 categories/Ruby/index.html
 create mode 100644 css/fonts/FontAwesome.otf
 create mode 100644 css/fonts/fontawesome-webfont.eot
 create mode 100644 css/fonts/fontawesome-webfont.svg
 create mode 100644 css/fonts/fontawesome-webfont.ttf
 create mode 100644 css/fonts/fontawesome-webfont.woff
 create mode 100644 css/images/banner.jpg
 create mode 100644 css/style.css
 create mode 100644 fancybox/blank.gif
 create mode 100644 fancybox/fancybox_loading.gif
 create mode 100644 fancybox/fancybox_loading@2x.gif
 create mode 100644 fancybox/fancybox_overlay.png
 create mode 100644 fancybox/fancybox_sprite.png
 create mode 100644 fancybox/fancybox_sprite@2x.png
 create mode 100644 fancybox/helpers/fancybox_buttons.png
 create mode 100644 fancybox/helpers/jquery.fancybox-buttons.css
 create mode 100644 fancybox/helpers/jquery.fancybox-buttons.js
 create mode 100644 fancybox/helpers/jquery.fancybox-media.js
 create mode 100644 fancybox/helpers/jquery.fancybox-thumbs.css
 create mode 100644 fancybox/helpers/jquery.fancybox-thumbs.js
 create mode 100644 fancybox/jquery.fancybox.css
 create mode 100644 fancybox/jquery.fancybox.js
 create mode 100644 fancybox/jquery.fancybox.pack.js
 create mode 100644 index.html
 create mode 100644 js/script.js
 delete mode 100644 placeholder
 create mode 100644 tags/Hexo/index.html
 create mode 100644 tags/Mac/index.html
 create mode 100644 tags/Nodejs/index.html
 create mode 100644 tags/Ruby/index.html
 create mode 100644 tags/github/index.html
 create mode 100644 tags/rbenv/index.html
Username for 'https://github.com': fprg
Password for 'https://fprg@github.com': 
To https://github.com/fprg/fprg.github.io.git
 + 3ef2c41...93ca6dc master -> master (forced update)
Branch master set up to track remote branch master from https://github.com/fprg/fprg.github.io.git.
[info] Deploy done: github

github.ioで確認する

http://fprg.github.io/
でブログが見れるようになりました。

補足

最初はgithubのユーザー・パスが聞かれますが
2回目移行のデプロイコマンド実行の際には聞かれませんでした。

まとめ

Markdownを編集しデプロイして、github.ioでブログが構築できますね。
github.ioは、ユーザーに最初のテンプレートが提供されていますが
サイトとしてちょっと一味変えたい場合にも有効ですね。

参考資料・リンク

http://fprg.github.io/
気まぐれでサイトがなくなってたら、すいません。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?