index.js 563 B

1234567891011121314151617181920212223
  1. var Handlebars = require("hbsfy/runtime");
  2. var template = require("./template.hbs");
  3. Handlebars.registerPartial('link', require("./partial.hbs"));
  4. Handlebars.registerHelper("capitalize", function(name) {
  5. return name[0].toUpperCase() + name.slice(1);
  6. });
  7. var data = {
  8. name: "esa",
  9. links: [
  10. { name: "Blog", url: "http://esa-matti.suuronen.org/" },
  11. { name: "Twitter", url: "https://twitter.com/esamatti" },
  12. { name: "Github", url: "https://github.com/epeli" }
  13. ]
  14. };
  15. window.onload = function() {
  16. document.body.innerHTML = template(data);
  17. };