Skip to content

Commit

Permalink
support for runtime handlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed May 7, 2013
1 parent b9e4d73 commit 1c4f3b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/snippet/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<script src="{{config.assets_host}}/seajs/seajs/2.0.0/??sea.js,plugin-combo.js,plugin-style.js"></script>
{%- endif %}

{%- if pkg|is_runtime_handlebars %}
<script src="{{config.assets_host}}/seajs/plugin-handlebars/0.1.0/plugin-handlebars.js"></script>
{%- endif %}

{%- endif %}

{%- set src = src_files %}
Expand All @@ -58,6 +62,7 @@
mocha: "gallery/mocha/1.9.0/mocha",
expect: "gallery/expect/0.2.0/expect",
puerh: "popomore/puerh/0.1.0/puerh",
'gallery/handlebars': 'gallery/handlebars/1.0.1/handlebars',
sinon: "gallery/sinon/1.6.0/sinon"
},
map: [function(uri) {
Expand Down
6 changes: 6 additions & 0 deletions theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ exports.filters = {
var base = path.relative(path.dirname(writer.filepath), '');
var ret = findSrc(base);
return JSON.stringify(ret);
},
is_runtime_handlebars: function(pkg) {
if (!(pkg.spm && pkg.spm.alias && pkg.spm.alias.handlebars)) {
return false;
}
return pkg.spm.alias.handlebars.indexOf('runtime') !== -1;
}
}

Expand Down

0 comments on commit 1c4f3b0

Please sign in to comment.