0.1.1 • Published 9 years ago

grunt-luggage v0.1.1

Weekly downloads
1
License
-
Repository
github
Last release
9 years ago

grunt-luggage

this can help you wrap your tpl section into a global template.
depends on handlebars

for example

tpl section:(test/a.html)

<div id="test">
    <img src="{{static}}/images/1.png" alt=""/>
</div>

global tpl:(template.hbs)

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Test</title>
    <link rel="stylesheet" href="{{cdn}}/common.css"/>
</head>
<body>
{{{body}}}
<script src="{{cdn}}/common.js"></script>
</body>
</html>

you can get:(dest/a.html)

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Test</title>
    <link rel="stylesheet" href="{{cdn}}/common.css"/>
</head>
<body>
<div id="test">
    <img src="{{static}}/images/1.png" alt=""/>
</div>
<script src="{{cdn}}/common.js"></script>
</body>
</html>

After doing this, you can transfer the final template to the server, eg. a server side handlebars engine. Use origin templates to render in the browser, render final templates in server side. We call it hybrid render :p

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago