This commit is contained in:
yumoqing 2025-10-11 12:47:37 +08:00
parent aac5d31d97
commit b12a553b5c

View File

@ -46,6 +46,10 @@ class TemplateEngine(Environment):
t = self.get_template(___name,globals=globals) t = self.get_template(___name,globals=globals)
return await t.render_async(globals) return await t.render_async(globals)
async def renders(self, tmplstr, **globals):
t = self.from_string(tmplstr)
return await t.render_async(globals)
def setupTemplateEngine(): def setupTemplateEngine():
config = getConfig() config = getConfig()
subffixes = [ i[0] for i in config.website.processors if i[1] == 'tmpl' ] subffixes = [ i[0] for i in config.website.processors if i[1] == 'tmpl' ]