All notable changes to lua-resty-template
will be documented in this file.
- Support for
template.new()
,template.new(options)
andtemplate.new(safe)
(aboolean
) - Added
safe
implementationrequire "resty.template.safe"
- Added
echo
helper function to template (#28) - Added
template.load_file
andtemplate.load_string
functions - Added
template.compile_file
andtemplate.compile_string
functions - Added
template.parse_file
andtemplate.parse_string
functions - Added
template.render_file
andtemplate.render_string
functions - Added
template.precompile_file
andtemplate.precompile_string
functions - Added
template.process
,template.process_file
andtemplate.process_string
functions - Added
template.root
andtemplate.location
properties - Added
template.visit
function (#36)
- When
plain
equals tofalse
the file io issues are considered fatal, and assertions are thrown (#32)
- Wrong template returned when using multiple server blocks (#25)
- Add a pure lua configure method (#23, #7)
- Support for the official OpenResty package manager (opm).
- Changed the change log format to keep-a-changelog.
- Allow pass layout as a template object to template.new.
- The loadngx was not working properly on non-file input. See also: #19 Thanks @zhoukk
- Added short escaping syntax.
- Support for {-verbatim-}...{-verbatim-}, and {-raw-}...{-raw-} blocks (contents is not processed by template). Please note that this could break your templates if you have used blocks with names "verbatim" or "raw".
- Issue #8: not returning value when using template.new and its render function.
- Added support for {[expression include]} syntax.
- Rewrote template.parse (cleaned up, less repetition of code, and better handling of new lines - i.e. doesn't eat newlines anymore. Also some adjustments to preceding spaces (space, tab, NUL-byte, and vertical tabs) on some tags ({% ... %}, {-block-} ... {-block-}, and {# ... #}) for a cleaner output.
- Small modification to html helper example to handle valueless tag attributess in HTML5 style.
- Fixed a bug when a view was missing from context when using layouts.
- Fixes nasty recursion bug (reported in bug #5) where sub-templates modify the context table. Thank you for reporting this @DDarko.
- Added _VERSION information to the module.
- Added CHANGES file to the project (this file).
- Lua > 5.1 uses _ENV instead of _G (Lua 5.1 uses _G). Future Proofing if Lua is deprecating _G in Lua 5.3.
- LuaRocks Support via MoonRocks.