mirror of
https://github.com/lucaspalomodevelop/JSSTE.git
synced 2026-03-13 07:19:37 +00:00
stash
This commit is contained in:
parent
0d45397390
commit
2b2d628452
34
README.md
34
README.md
@ -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>
|
||||
```
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user