This repository has been archived by the owner on Apr 11, 2018. It is now read-only.
/
index.html
98 lines (78 loc) · 3.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{% extends "layouts/master.html" %}
{%- if DEV %}
{% set baseurl = '' %}
{% else %}
{% set baseurl = '/swig' %}
{% endif -%}
{% block title %}{% parent %} - A Node.js and Browser JavaScript Template Engine{% endblock %}
{% block page_content %}
<section class="content">
<h1>Swig</h1>
<div class="row guttered">
<p class="span6">A simple, powerful, and extendable JavaScript Template Engine.</p>
<p class="span6">Current Version: <strong>{{ version }}</strong>. <a href="{{ baseurl }}/docs/previous/">Looking for an older version?</a></p>
</div>
<hr class="small">
<div class="row guttered">
<section class="span6">
<h2>Super Quick Start</h2>
<p>For a more in-depth intro, check out the <a href="{{ baseurl }}/docs/">Getting Started docs</a>.</p>
<h3>Install Swig</h3>
<pre><code>npm install swig --save</code></pre>
<h3>Create Your Template</h3>
<pre><code data-language="swig">{% raw %}<h1>{{ pagename|title }}</h1>
<ul>
{% for author in authors %}
<li{% if loop.first %} class="first"{% endif %}>
{{ author }}
</li>
{% endfor %}
</ul>{% endraw %}</code></pre>
<h3>Render Your Template</h3>
<pre><code data-language="javascript">var swig = require('swig');
swig.renderFile('/path/to/template.html', {
pagename: 'awesome people',
authors: ['Paul', 'Jim', 'Jane']
});</code></pre>
<h3>The End Result</h3>
<pre><code data-language="html"><h1>Awesome People</h1>
<ul>
<li class="first">Paul</li>
<li>Jim</li>
<li>Jane</li>
</ul></code></pre>
</section>
<section class="span6">
<h2>Features</h2>
<ul>
<li>Available for node.js <em>and</em> major web browsers!</li>
<li>Uses similar methodologies as Django, Jinja2, and Twig template engines.</li>
<li><a href="http://expressjs.com/">Express</a> compatible.</li>
<li>Object-Oriented template inheritance.</li>
<li>Apply filters and transformations to output in your templates.</li>
<li>Automatically escapes all output for safe HTML rendering.</li>
<li>Lots of iteration and conditionals supported.</li>
<li>Robust without the bloat.</li>
<li>Extendable and customizable.</li>
<li>Great <a href="{{ baseurl }}/coverage.html">code coverage</a>.</li>
</ul>
<hr class="small">
<h2>Download For the Browser</h2>
<p>Swig also works in all major browsers. Just download the following file and follow the <a href="{{ baseurl }}/docs/#browser">Documentation</a>.</p>
<p class="download">
<a href="{{ baseurl }}/js/swig.min.js" class="btn">Download {{ version }}</a><br><br>
<a href="{{ baseurl }}/js/swig.js">Development</a> | <a href="{{ baseurl }}/js/swig.min.js">Production</a> (<a href="{{ baseurl }}/js/swig.js.map">source map</a>)
</p>
<hr class="small">
<h2>Resources</h2>
<ul>
<li><a href="https://groups.google.com/forum/#!forum/swig-templates">Mailing List</a></li>
<li><a href="https://travis-ci.org/paularmstrong/swig/builds">Travis CI Build History</a></li>
<li><a href="https://github.com/paularmstrong/swig/issues">Bug Reports</a></li>
<li><a href="http://stackoverflow.com/questions/tagged/swig-template">Stack Overflow Questions</a></li>
<li><a href="https://github.com/jonschlinkert/sublime-swig">Syntax Highlighting for Sublime Text</a></li>
</ul>
</section>
</div>
</section>
{% endblock %}