Jinja2 Nova Directive
hypernova-jinja2-directive enables you render a Hypernova placeholder for Nova Proxy using Jinja2.
Installation
You can install the package from pip.
pip install hypernova_jinja2_directive
Setup
You need to register a global function when the Jinja2 environment is defined.
from hypernova_jinja2_directive import nova
class JinjaEnvironment(Environment):
def __init__(self,**kwargs):
super(JinjaEnvironment, self).__init__(**kwargs)
self.globals['nova'] = nova
Flask.
Setupfrom hypernova_jinja2_directive import nova
app.jinja_env.globals.update(nova=nova)
Usage
You need to pass the component name and component data. The data
is optional.
{{ nova('Example', {'title':'Ara Framework'}) }}
Tutorial
Take a look in the next post: Universal Rendering in Flask using Vue.js and Ara Framework