Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arnaucube/konstrui
web templating engine for static websites, written in Go lang
https://github.com/arnaucube/konstrui
golang template-engine templating web
Last synced: about 9 hours ago
JSON representation
web templating engine for static websites, written in Go lang
- Host: GitHub
- URL: https://github.com/arnaucube/konstrui
- Owner: arnaucube
- License: gpl-3.0
- Created: 2017-05-20T13:51:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-12T00:06:46.000Z (almost 7 years ago)
- Last Synced: 2024-06-20T06:39:23.951Z (5 months ago)
- Topics: golang, template-engine, templating, web
- Language: Go
- Homepage: http://arnaucode.com/konstrui
- Size: 3.75 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Konstrui [![Go Report Card](https://goreportcard.com/badge/github.com/arnaucode/konstrui)](https://goreportcard.com/report/github.com/arnaucode/konstrui)
web templating engine for static websites, written in Go lang
![konstrui](https://raw.githubusercontent.com/arnaucode/konstrui/master/media/konstrui.png "konstrui")
## Example
#### See the full example on https://github.com/arnaucode/konstrui/tree/master/example
- Simple project structure example:
```
webInput/
konstruiConfig.json
index.html
templates/
userTemplate.html
userTemplate.json
```- Set the html file:
```html
My First Heading
My first paragraph.
```
- Set the template file:
```html
{{username}}
{{description}}
{{phone}}
```- Set the template data file:
```json
[{
"username": "Michaela Doe",
"description": "Hi, I'm here to code",
"phone": "456456456"
},
{
"username": "John Doe",
"description": "Hi, I'm here",
"phone": "123456789"
},
{
"username": "Myself",
"description": "How are you",
"phone": "no phone"
}
]
```- Set the configuration file konstruiConfig.json in the webInput directory:
```json
{
"title": "Web example",
"author": "arnaucode",
"github": "github.com/arnaucode",
"website": "arnaucode.com",
"files": [
"index.html",
"projects.html",
"app.css"
]
}
```- Execute konstrui
```
./konstrui
```- Output:
```html
Heading
Paragraph.
Michaela Doe
Hi, I'm here to code
456456456
John Doe
Hi, I'm here
123456789
Myself
How are you
no phone
```
## Features
Import templates
```html```
Load values:
```html
{{username}}
```Number of iterations:
```html
User [[i]]
```Subobjects:
```html
{{user.username}}
```