This commit is contained in:
lucaspalomodevelop 2021-04-20 19:17:22 +02:00
parent 0d45397390
commit 2b2d628452
2 changed files with 35 additions and 1 deletions

View File

@ -2,3 +2,37 @@
# JSTE
JSTE is a NodeJS-Module for rendering data in static HTML
## Example JSON
```json
{
"_TEMPLATE_":"firstexample",
"TITLE": "app2",
"LINK":"http://www.google.de"
}
```
## Example HTML
```html
{
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><[TITLE]></title>
</head>
<body>
<div id="app">
<a id="googlelink"><[LINK]></a>
</div>
<[[ARRAY]]>
</body>
</html>
```

View File

@ -23,7 +23,7 @@ app.render = function(pagecode, templatecode) {
for (var i in pagecode) {
var value = undefined;
if(i.startsWith("_"))
if(new RegExp("\d*_([A-Z])\w*_",i))
continue;
value = pagecode[i].toString();