Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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}}


```