# Rules
compile '/article/*' do
filter :erb
filter :redcarpet if ['md', 'mdown', 'markdown'].include? item[:extension]
rep :atom_feed do
# Our atom feed rep doesn't need layout or #write,
# since but it does need inline syntax highlighting
filter :colorize_syntax,
:default_colorizer => :coderay,
:coderay => { :css => :style }
end
# A non-inline colorize (with a different colorizer) for all other reps
filter :colorize_syntax
rep :excerpt do
layout 'excerpt'
# Excerpt rep won't be written to a file, but
# we'll need access to #compiled_content later,
# so let's do an anonymous snapshot...
snapshot
end
layout 'article'
# "anonymous" rep for writing a PDF version
rep do
filter :pdf
# write a PDF version of the article
# note that this is chromeless because it's
# before the 'default' layout.
write item.identifier.chop + '.pdf'
end
layout 'default'
write item.identifier + 'index.html'
end
# Rules
compile '/article/*', :rep => :atom_feed do
filter :erb
filter :redcarpet if ['md', 'mdown', 'markdown'].include? item[:extension]
filter :colorize_syntax,
:default_colorizer => :coderay,
:coderay => { :css => :style }
end
route '/article/*', :rep => :atom_feed do
nil
end
compile '/article/*', :rep => :excerpt do
filter :erb
filter :redcarpet if ['md', 'mdown', 'markdown'].include? item[:extension]
filter :colorize_syntax
layout 'excerpt'
snapshot :some_arbitrary_name
end
route '/article/*', :rep => :excerpt do
nil
end
compile '/article/*', :rep => :some_arbitrary_name do
filter :erb
filter :redcarpet if ['md', 'mdown', 'markdown'].include? item[:extension]
filter :colorize_syntax
layout 'article'
filter :pdf
end
route '/article/*', :rep => :some_arbitrary_name do
item.identifier.chop + '.pdf'
end
compile '/article/*' do
filter :erb
filter :redcarpet if ['md', 'mdown', 'markdown'].include? item[:extension]
filter :colorize_syntax
layout 'article'
layout 'default'
end
route '/article/*' do
item.identifier + 'index.html'
end
(This time without comments)
# Rules
compile '/article/*' do
filter :erb
filter :redcarpet if ['md', 'mdown', 'markdown'].include? item[:extension]
rep :atom_feed do
filter :colorize_syntax,
:default_colorizer => :coderay,
:coderay => { :css => :style }
end
filter :colorize_syntax
rep :excerpt do
layout 'excerpt'
snapshot
end
layout 'article'
rep do
filter :pdf
write item.identifier.chop + '.pdf'
end
layout 'default'
write item.identifier + 'index.html'
end