LoginSignup
5
5

More than 5 years have passed since last update.

Hexoの新規投稿をちょっと使いやすくする

Posted at

はじめに

こんにちは。インフラエンジニアレベル1のf_prgです。
Hexoで新規投稿でファイルを生成しますと、source/_postsフォルダにファイルが生成されます。今後投稿していきますと、ファイルの管理が必要になりそうです。
今回はちょっとだけ投稿を使いやすくする方法をご紹介します。

日付ごとにファイルを生成するようにする

_config.ymlの設定を変更する

初期状態のconfigは下記の通りですが

_config.yml
new_post_name: :title.md # File name of new posts

_config.yml
new_post_name: :year/:month/:day/:title.md # File name of new posts

と変更します。

新規投稿を生成する

[01:20:43][f_prg@mba:_posts]# hexo new hexo_easy_post
[info] File created at /Users/f_prg/Documents/project/node-hexo-blog/blog/source/_posts/2014/08/16/hexo_easy_post.md

と日付ごとのフォルダができて、ファイルが生成されます。

まとめ

できるかなーと思ってちょっとやったら、とても簡単にできました。
ちょっと_config.yml変更させるだけで、いろいろとできそうです。
その前の記事は、自分で移動させました。まあ。仕方が無いですね。
管理画面のhexo-adminプラグインを使っており
一覧で投稿日時がでてましたので、面倒な作業はなくドラッグアンドドロップの移動だけでした。

http://hexo.io/docs/migration.html
こちらに同じような内容がありました。

参考資料・リンク

http://hexo.io/docs/migration.html

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