LoginSignup
5
5

More than 5 years have passed since last update.

Hexoで画像の設定する

Posted at

はじめに

こんにちは。インフラエンジニアレベル1のf_prgです。
Hexoで画像を使いたいので、設定をしてみます。

設定を変更する

configを変更する

configの参考はコチラを。
http://hexo.io/docs/configuration.html

_config.yml
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
highlight:
  enable: true
  line_number: true
  tab_replace:

_config.yml
post_asset_folder: true

とします。

記事を追加する

次のプラグインの記事用を追加してみます。

[19:54:00][f_prg@mba:blog]# hexo new hexo_plugin
[info] File created at /Users/f_prg/Documents/project/node-hexo-blog/blog/source/_posts/hexo_plugin.md
[19:54:42][f_prg@mba:blog]# ls -al source/_posts/
total 104
drwxr-xr-x  10 f_prg  staff    340  8 10 19:54 .
drwxr-xr-x   3 f_prg  staff    102  8 10 11:59 ..
-rw-r--r--@  1 f_prg  staff   6148  8 10 19:45 .DS_Store
-rw-r--r--   1 f_prg  staff    814  8 10 11:59 hello-world.md
drwxr-xr-x   4 f_prg  staff    136  8 10 19:43 hexo_install
-rw-r--r--   1 f_prg  staff  22155  8 10 19:48 hexo_install.md
drwxr-xr-x   2 f_prg  staff     68  8 10 19:54 hexo_plugin
-rw-r--r--   1 f_prg  staff     55  8 10 19:54 hexo_plugin.md
-rw-r--r--   1 f_prg  staff   1419  8 10 19:50 hexo_site_setup.md
-rw-r--r--   1 f_prg  staff   6338  8 10 18:08 mac_ruby_rbenv.md
[19:54:53][f_prg@mba:blog]# 

記事のmarkdownファイルとディレクトリが作成されてます。

記事に画像を追加するには

こちらは、Hexoインストール時の記事で使った際のものですが、下記のように使います。

![キャプチャです](/2014/08/10/hexo_install/hexo_install_001.png "キャプチャです")

専用のフォルダがあるのですが、
まだまだ使いづらいですね。都度あげるのは辛い作業になりますね。
適当にアップしても、いい感じようなのが否めません。

補足

専用のタグもあるのですが、Markdownをそのままコピペできないので私は使ってません。
http://hexo.io/docs/tag-plugins.html#Image

まとめ

ブログとすると、画像のアップロードの楽にしたい希望はありますね。
プラグインがあるようなので期待してみます。

参考資料・リンク

http://hexo.io/

5
5
2

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
5
5