Skip to content

Commit

Permalink
Update render plugin documentation to include Erubi::CaptureBlockEngi…
Browse files Browse the repository at this point in the history
…ne example
  • Loading branch information
jeremyevans committed Jun 14, 2024
1 parent 43b81ee commit f73ba9b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/roda/plugins/render.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@ module RodaPlugins
# inject the content into the output. To get similar behavior with Roda, you have
# a few different options you can use.
#
# == Use Erubi::CaptureBlockEngine
#
# Roda defaults to using Erubi for erb template rendering. Erubi 1.13.0+ includes
# support for an erb variant that supports blocks in <tt><%=</tt> and <tt><%==</tt>
# tags. To use it:
#
# require 'erubi/capture_block'
# plugin :render, template_opts: {engine_class: Erubi::CaptureBlockEngine}
#
# See the Erubi documentation for how to capture data inside the block. Make sure
# the method call (+some_method+ in the example) returns the output you want added
# to the rendered body.
#
# == Directly Inject Template Output
#
# You can switch from a <tt><%=</tt> tag to using a <tt><%</tt> tag:
Expand Down

0 comments on commit f73ba9b

Please sign in to comment.