LoginSignup
3
3

More than 5 years have passed since last update.

HexoでThemeを使うまで

Last updated at Posted at 2015-04-30

Hexoとは

サイトジェネレーターです。Node.jsを使っています。この辺は、Rubyで書かれているものが多い印象ですが、GitBookと同じように、HexoはNode.js製です。そのため、テーマにもGitBookに似た感じのものがあります。

ここでは、GitBookに似たテーマを使ってみることにした。

コマンド

$ sudo npm install hexo-cli -g

$ hexo init hexo

$ cd hexo

$ sudo npm install

$ hexo server

ここまででデフォルトのテーマを使えます。

次に、インストールしたテーマを使う方法です。

$ cd themes
./hexo
├── node_modules
│   ├── hexo
│   ├── hexo-generator-archive
│   ├── hexo-generator-category
│   ├── hexo-generator-index
│   ├── hexo-generator-tag
│   ├── hexo-renderer-ejs
│   ├── hexo-renderer-marked
│   ├── hexo-renderer-stylus
│   └── hexo-server
├── scaffolds
├── source
│   └── _posts
└── "themes" # 現在のディレクトリ
    ├── landscape
    └── "next" # 新しいテーマ

$ git clone https://github.com/iissnan/hexo-theme-next next

$ cd ../

$ vim _config.yml

そして、テーマを変更します。

_config.yml
theme: next

あとは、プレビューしてみると、/themes/nextが設定されていることがわかります。

$ hexo server

Webサーバーへアップロードするファイルは、publicです。以下のコマンドで作ります。

$ hexo generate
3
3
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
3
3