-
-
Save yyolk/1199973 to your computer and use it in GitHub Desktop.
Jekyll filter for summary text between two <!-- CUT --> tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
module Filters | |
def summarize(str, splitstr = /<!-- CUT -->\s(.*)\s<!-- CUT -->/) | |
splitstr.match(str) do |m| | |
return m[1] | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
module Filters | |
def summarize(str, splitstr = /\s*<div id="extended">/) | |
str.split(splitstr)[0] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment