Skip to content

Commit

Permalink
Change mustache js template engine by Twitter Hogan
Browse files Browse the repository at this point in the history
  • Loading branch information
heldr committed Oct 4, 2012
1 parent f33db7a commit 21386f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -37,7 +37,7 @@ <h2><a href="{{html_url}}">{{name}}</a></h2>
</footer>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.cdnjs.com/ajax/libs/mustache.js/0.4.2/mustache.min.js"></script>
<script src="http://twitter.github.com/hogan.js/builds/2.0.0/hogan-2.0.0.min.js"></script>
<script src="scripts/css3-mediaqueries.js"></script>
<script src="scripts/hub.me.js"></script>

Expand Down
12 changes: 6 additions & 6 deletions scripts/hub.me.js
Expand Up @@ -8,7 +8,7 @@

// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function ( $, window, document, undefined ) {
;(function ( $, Hogan, window, document, undefined ) {

// undefined is used here as the undefined global variable in ECMAScript 3 is
// mutable (ie. it can be changed by someone else). undefined isn't really being
Expand Down Expand Up @@ -94,9 +94,9 @@

Plugin.prototype.createCategory = function(catName) {

var tmpl = $('#category-item').html(),
var tmpl = Hogan.compile( $('#category-item').html() ),
params = {category_name:catName},
cat = Mustache.to_html(tmpl, params);
cat = tmpl.render(params);

this.element.append(cat);

Expand All @@ -106,8 +106,8 @@
// test if homepage begins with http or https
repo.homepage = ( repo.homepage && !( /^(http|https):\/\//.test( repo.homepage ) ) ) ? "http://" + repo.homepage : repo.homepage;

var tmpl = $('#repository-item').html(),
repository = Mustache.to_html(tmpl, repo);
var tmpl = Hogan.compile( $('#repository-item').html() ),
repository = tmpl.render(repo);

this.element.append(repository);

Expand Down Expand Up @@ -138,4 +138,4 @@
});
}

})(jQuery, window, document);
})(jQuery, Hogan, window, document);

0 comments on commit 21386f0

Please sign in to comment.