I was searching a simple render engine for Express that support nested object and nested partial html.
I was pissed off to not find what I wanted.
I just created a new one, enough fast to write a new one.
Container page, called sometime Layout, is a WebPage class.
It contains partial pages, called Component.
WebPage class inherits from Component.
Each Component can contains several other Components.
A Component reference a Component by its name like this:
'#Component.topMenu#'
local object binding is done by declaring the property of the localData object:
'#title#' or
'#user.name#'
##Sample:
new WebPage("home", "home.html",
{ "og:site_name": "Fratelo", "og:type": "website" },
{
title: "Fratelo is your toolbox for freelancing",
updated: "2019-07-15", token: "afeab-231e"
},
[
new Component("topMenu", "_topMenu.html"),
new Component("login", "_login.html", { username: "Pascal Martin" }),
new Component("bodyContent", "_homeBodyContent.html")
])