8000 GitHub - Gornak40/barabay: Simple template engine written in Bash.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Gornak40/barabay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

barabay

Simple template engine written in Bash.

  • No dependencies.
  • Dead simple.
  • Not very fast.

Usage

TODO

Example

Files

params.cfg

Your data lives here.

title	Gorilla
link	https://algolymp.ru

@gorilla	gorilla.html
text	Gorilla is big animal
image	/static/img/west.png
@.

text	Gorilla is gorgeous
image	/static/img/east.png
@.

gorilla.html

Element templates.

<div class="gorilla">
	<p>This is the gorilla!</p>
	<p>{{ text }}</p>
	<img src="{{ image }}">
</div>

index.html

Main template.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>{{ title }}</title>
</head>
<body>
	<h1>{{ title}}</h1>
	<div>
		<a href="{{ link }}">gorilla pic</a>
		{{ @gorilla }}
	</div>
</body>

Usage

cat params.cfg | ./barabay.sh index.html

Result

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Gorilla</title>
</head>
<body>
	<h1>Gorilla</h1>
	<div>
		<a href="https://algolymp.ru">gorilla pic</a>
		<div class="gorilla">
	<p>This is the gorilla!</p>
	<p>Gorilla is big animal</p>
	<img src="/static/img/west.png">
</div>
<div class="gorilla">
	<p>This is the gorilla!</p>
	<p>Gorilla is gorgeous</p>
	<img src="/static/img/east.png">
</div>

	</div>
</body>

About

Simple template engine written in Bash.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0