2015年7月9日木曜日

Hexo


Node.js 上にブログサイト?を作れるようだ。
Rubyベース、Pythonベースなど色々あるようだが、JavaScriptベースの「Hexo」にトライ。

npm install -g hexo
でインストールできるとあるが、resiterなんとかエラーが出る。
何が効いたか不明だが、3回目でうまくいったようだ。
C:\Users\Mobile>npm install -g hexo
\


> dtrace-provider@0.5.0 install C:\Users\Mobile\AppData\Roaming\npm\node_modules
\hexo\node_modules\bunyan\node_modules\dtrace-provider
> node scripts/install.js

npm WARN optional dep failed, continuing fsevents@0.3.6
npm WARN optional dep failed, continuing fsevents@0.3.6
C:\Users\Mobile\AppData\Roaming\npm\hexo -> C:\Users\Mobile\AppData\Roaming\npm\
node_modules\hexo\bin\hexo
hexo@3.1.1 C:\Users\Mobile\AppData\Roaming\npm\node_modules\hexo
├── hexo-front-matter@0.2.2
├── pretty-hrtime@1.0.0
├── abbrev@1.0.7
├── titlecase@1.0.2
├── archy@1.0.0
├── text-table@0.2.0
├── bluebird@2.9.32
├── moment-timezone@0.3.1
├── moment@2.10.3
├── lodash@3.10.0
├── tildify@1.1.0 (os-homedir@1.0.0)
├── chalk@1.1.0 (ansi-styles@2.1.0, supports-color@2.0.0, escape-string-regex
p@1.0.3, strip-ansi@3.0.0, has-ansi@2.0.0)
├── strip-indent@1.0.1 (get-stdin@4.0.1)
├── hexo-cli@0.1.7 (minimist@1.1.1)
├── hexo-i18n@0.2.1 (sprintf-js@1.0.2)
├── minimatch@2.0.8 (brace-expansion@1.1.0)
├── through2@1.1.1 (xtend@4.0.0, readable-stream@1.1.13)
├── swig-extras@0.0.1 (markdown@0.5.0)
├── js-yaml@3.3.1 (esprima@2.2.0, argparse@1.0.2)
├── cheerio@0.19.0 (entities@1.1.1, dom-serializer@0.1.0, css-select@1.0.0, h
tmlparser2@3.8.3)
├── hexo-util@0.1.7 (ent@2.2.0, highlight.js@8.6.0)
├── warehouse@1.0.2 (graceful-fs@3.0.8, cuid@1.2.5, JSONStream@0.10.0)
├── hexo-fs@0.1.3 (escape-string-regexp@1.0.3, graceful-fs@3.0.8, chokidar@0.
12.6)
├── nunjucks@1.3.4 (optimist@0.6.1, chokidar@0.12.6)
├── bunyan@1.4.0 (safe-json-stringify@1.0.3, dtrace-provider@0.5.0, mv@2.1.1)

└── swig@1.4.2 (optimist@0.6.1, uglify-js@2.4.23)

C:\Users\Mobile>

バージョンを調べる
C:\Users\Mobile>hexo -v
hexo-cli: 0.1.7
os: Windows_NT 6.1.7601 win32 ia32
http_parser: 2.3
node: 0.12.6
v8: 3.28.71.19
uv: 1.6.1
zlib: 1.2.8
modules: 14
openssl: 1.0.1o
続いて
C:\Users\Mobile>hexo init blog150708
INFO  Copying data to ~\blog150708
INFO  You are almost done! Don't forget to run 'npm install' before you start bl
ogging with Hexo!

ただ、ブログのルートが以下の場所に出来た。何かのサブディレクトリに入れたかった。

  C:\Users\Mobile\blog150708

インストールのコマンドに -g を入れたのが原因?
そのまま進み、指示に従って以下をたたく
C:\Users\Mobile\blog150708>npm install
長いログが出たので、ファイルにしておく
C:\Users\Mobile\blog150708\npm_install_の結果.txt
あとは hexo server して http://localhost:4000 にアクセスすると標準のホーム画面が起動した!!

最後は投稿。以下でタイトルだけは作れた。本文はどうやって書くのだろう?
C:\Users\Mobile\blog150708>hexo new
Usage: hexo new [layout] <title>

Description:
Create a new post.

Arguments:
  layout  Post layout. Use post, page, draft or whatever you want.
  title   Post title. Wrap it with quotations to escape.

Options:
  -p, --path     Post path. Customize the path of the post.
  -r, --replace  Replace the current post if existed.
  -s, --slug     Post slug. Customize the URL of the post.


C:\Users\Mobile\blog150708>hexo new post test150708
INFO  Created: ~\blog150708\source\_posts\test150708.md

C:\Users\Mobile\blog150708>hexo server
INFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.

0 件のコメント:

コメントを投稿