LoginSignup
0
0

More than 5 years have passed since last update.

Hexoで画像投稿と大きさや位置の変更

Posted at

画像を挿入する

下記ページを参考にした
http://pagent.github.io/2014/12/03/hexo-image/
http://saucer-jp.github.io/2015/04/29/how-to-put-images-in-a-post/

が、asset_imgの機能では画像の大きさや位置の変更方法がわからなかったので
おとなしくimgタグを使った方法で行う

下記ページを参考にして
http://qiita.com/in_silico_/items/31c2c0bc1cf061c86250

_config.ymlの設定で

post_asset_folderをtrueにした状態で

$ hexo new "xxxxxx"

で作成されたフォルダに画像を入れておく

投稿記事のpermalinkが :year/:month/:day/:title/ で、投稿記事のtitleがtest-pageだとしたら

例えば2016年4月5日に投稿した記事に関しては

<img src="/2016/04/05/test-page/example.jpg" width="300px" height="200px">

としてやれば画像の大きさが設定できます

画像を左寄せしたい場合

imgタグ内にaline設定を入れて、終わったら文章の回り込みを防ぐために clearしてあげます

<img src="/2016/04/05/test-page/example.jpg" width="300px" height="200px" align="left">
<br style="clear:left;">

これで画像の投稿、大きさの変更、位置の変更ができるはずです

右寄せにしたい場合は align と clearのところをrightにしてあげればよいです

ブログのほうにはもう少し詳しく載せてます
Hexoで画像を投稿する方法

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