generated from openpeeps/pistachio
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: George Lemon <[email protected]>
- Loading branch information
1 parent
18f1a72
commit 84cd929
Showing
8 changed files
with
173 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import ../src/tim | ||
import std/os | ||
|
||
var | ||
engine = newTim( | ||
src = "templates", | ||
output = "storage", | ||
basepath = currentSourcePath(), | ||
minify = true, | ||
indent = 2 | ||
) | ||
|
||
engine.precompile() | ||
sleep(40) | ||
let x = engine.render("index") | ||
writeFile(getCurrentDir() / "example" / "preview.html", x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCKTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta content="width=device-width, initial-scale=1" name="viewport"> | ||
<title>Tim Engine is Awesome</title> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> | ||
<style> body{background-color:#212121;color:whitesmoke}</style> | ||
</head> | ||
<body> | ||
<section> | ||
<div class="container"> | ||
<div class="row vh-100 align-items-center"> | ||
<div id="content-zone" class="col-lg-7 mx-auto"> | ||
<div class="text-center"> | ||
<img src="https://raw.githubusercontent.com/openpeeps/tim/main/.github/timengine.png" width="200px" alt="Tim Engine"> | ||
</div> | ||
<h1 class="display-4 fw-bold">This is Tim Engine 👋 A super fast template engine for cool kids!</h1> | ||
<p style="line-height: 1.8em" class="mb-4 h4 fw-normal px-4">Build sleek, dynamic websites and apps in a breeze with Tim Engine's intuitive syntax and powerful features. It's the template engine that keeps up with your creativity.</p> | ||
<div class="text-center"> | ||
<div class="mb-3"> | ||
<a target="_blank" class="btn btn-light btn-lg rounded-pill px-4 py-2" href="https://github.com/openpeeps/tim"> | ||
<svg viewBox="0 0 24 24" width="24" stroke-width="2" class="css-i6dzq1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" height="24"> | ||
<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"> | ||
</path> | ||
</svg> | ||
<span class="fw-bold">Check it on GitHub</span> | ||
</a> | ||
</div> | ||
<div> | ||
<p class="mb-0">Made by Humans from OpenPeeps</p> | ||
<p>Open Source | LGPLv3 License</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
<script type="text/javascript">document.addEventListener('DOMContentLoaded', function(){{}}); | ||
// some JS code that runs after DOMContentLoaded | ||
document.addEventListener('DOMContentLoaded', function() { | ||
document.querySelector('#submitMessage').addEventListener('click', function(e){ | ||
e.preventDefault() | ||
console.log(e) | ||
}) | ||
}) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
html | ||
head | ||
meta charset="UTF-8" | ||
meta name="viewport" content="width=device-width, initial-scale=1" | ||
title: "Tim Engine is Awesome" | ||
link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
style: " | ||
body { | ||
background-color: #212121; | ||
color: whitesmoke | ||
} | ||
.btn-primary { | ||
--bs-btn-color: #fff; | ||
--bs-btn-bg: #ea4444; | ||
--bs-btn-border-color: #ea4444; | ||
--bs-btn-hover-color: #fff; | ||
--bs-btn-hover-bg: #c73434; | ||
--bs-btn-hover-border-color: #c73434; | ||
--bs-btn-focus-shadow-rgb: 49,132,253; | ||
--bs-btn-active-color: #fff; | ||
--bs-btn-active-bg: #b62929; | ||
--bs-btn-active-border-color: #b62929; | ||
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); | ||
--bs-btn-disabled-color: #fff; | ||
--bs-btn-disabled-bg: #0d6efd; | ||
--bs-btn-disabled-border-color: #0d6efd; | ||
} | ||
" | ||
body | ||
@view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
a.btn.btn-primary.btn-lg.rounded-pill.px-4.py-2 href="https://github.com/openpeeps/tim" target="_blank": | ||
svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1" | ||
path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" | ||
span.fw-bold: "Check it on GitHub" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
section > div.container > div.row.vh-100.align-items-center > div#content-zone.col-lg-7.mx-auto | ||
div.text-center > img src="https://raw.githubusercontent.com/openpeeps/tim/main/.github/timengine.png" alt="Tim Engine" width="200px" | ||
h1.display-4.fw-bold: | ||
"This is Tim 👋 A super fast template engine for cool kids!" | ||
p.mb-4.h4.fw-normal.px-4 style="line-height: 1.8em": | ||
"Build sleek, dynamic websites and apps in a breeze with Tim Engine's intuitive | ||
syntax and powerful features. It's the template engine that keeps up with your creativity." | ||
div.text-center | ||
div.mb-3 | ||
@include "btn" | ||
div | ||
p.mb-0: "Made by Humans from OpenPeeps" | ||
p: "Open Source | LGPLv3 License" | ||
|
||
@client target="#content-zone" | ||
// transpile to JavaScript for client-side rendering | ||
@end | ||
|
||
@js | ||
document.addEventListener('DOMContentLoaded', function() { | ||
console.log(e) | ||
}) | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters