18 lines
429 B
Ruby
18 lines
429 B
Ruby
|
# This goes in _plugins/excerpt.rb
|
||
|
module Jekyll
|
||
|
class Post
|
||
|
alias_method :original_to_liquid, :to_liquid
|
||
|
def to_liquid
|
||
|
original_to_liquid.deep_merge({
|
||
|
'excerpt' => content.match('<!--more-->') ? content.split('<!--more-->').first : nil
|
||
|
})
|
||
|
end
|
||
|
end
|
||
|
|
||
|
module Filters
|
||
|
def mark_excerpt(content)
|
||
|
content.gsub('<!--more-->', '<div id="more"><a name="more"></a></div>')
|
||
|
end
|
||
|
end
|
||
|
end
|