Wivern Blog

Personal-Tech memorandum

Octopress 続きを読む(Moreタグ)の設定

<!--more-->タグの追加

ブログを表示すると公開済の記事が時系列順にタイトルと本文が全て表示されるので、 ブログを表示した時に本文を全て表示するのではなく一部だけを表示しておき、 全ての本文を読むには「続きを読む >>」と書かれたリンクをクリックした時に 表示させるよう<!--more-->タグを設置する。

bundel exec rake new_post[title]で作成後、source/_posts/source/_posts/YYYY-MM-DDD-title.markdownファイルができ 記事の途中に以下を追記する。

 <!-- more -->

ただし上記の追記だけでは表示が”Read on →“になってるので_config.ymlexcerpt_linkを変更する。

1
2
- excerpt_link: "Read on &rarr;"  # "Continue reading" link text at the bottom of excerpted articles
+ excerpt_link: "続きを読む &raquo;"  # "Continue reading" link text at the bottom of excerpted articles