Octopressに「続きを読む」のプラグイン導入
更新日:2023.05.05
作成日:2013.04.24

「続きを読む」ように、記事を折りたたむプラグインを導入。
Octopressなら、/plagins
ディレクトリに 以下のpostmore.rb
を設定する。
module PostMore
def postmorefilter(input, url, text)
if input.include? "
"
input.split("
").first + "<p class='more'><a href='#{url}'>#{text}</a></p>"
else
input
end
end
end
Liquid::Template.register_filter(PostMore)
参考
Related contents

TECH
2013.11.24
Jekyllのバージョンアップ

TECH
2013.05.23
Jekyllのお勉強 -YAML部分と記事本文を分離する正規表現-

TECH
2013.05.20
Sublime Text 2にLiveReloadを導入してMarkdown Previewを快適に!!

TECH
2013.02.03
はてなダイアリーからJekyllへお引越し

TECH
2017.01.08
静的サイトジェネレータ「Hugo」でシンプルブログサイトを構築する

TECH
2015.08.30
JekyllからHugoへの移行ポイント

TECH
2014.12.13
Jekyllのタグとカテゴリを整理するために、一覧表示するWebアプリ(個人用)をつくった

TECH
2014.12.02
Jekyllに月別アーカイブを実装する