Skip to content

Instantly share code, notes, and snippets.

@simonmcmanus
Last active October 18, 2016 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonmcmanus/17e23f4bb3c3cd9e0afdcf09e11b226e to your computer and use it in GitHub Desktop.
Save simonmcmanus/17e23f4bb3c3cd9e0afdcf09e11b226e to your computer and use it in GitHub Desktop.
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js');
} else {
appCacheNanny.start()
}
appCacheNanny.on('updateready', function () {
location.reload()
})
var output = sizlate.render($('div#example'), { ‘h1’: ‘Goodbye’});
<div>
<h1>Goodbye</h1>
</div>
var sizlate = require('sizlate');
var html = '<div id="example"><h1>hello</h1></div>';
var output = sizlate.render(html, { ‘h1’: ‘Goodbye’});
// output = <div id="example"><h1>Goodbye</h1></div>
module.exports = {
'/': {
page: 'home'
},
'/contact': {
page: 'contact'
}
};
module.exports = {
'/': {
page: 'home',
selectors: {
title: 'Welcome Home!',
h1:'HOME'
}
},
'/contact': {
page: 'contact',
selectors: {
title: 'contact page',
h1:'Contact'
},
spec: {
'#details': {
component: 'contact',
data: [
{ li: '0207-000-000' },
{ li: 'company@name.com' }
]
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment