Skip to content

Instantly share code, notes, and snippets.

@stephentcannon
Created February 17, 2014 00:55
Show Gist options
  • Save stephentcannon/9042903 to your computer and use it in GitHub Desktop.
Save stephentcannon/9042903 to your computer and use it in GitHub Desktop.
meteor content router
Router.map(function() {
this.route('blog', {
path: '/blog/:slug',
template: 'blog'
});
});
Template.blog.content = function() {
var slug = Router.current().params.slug;
var templateFunc = Template[slug];
if(typeof templateFunc == 'function') {
return templateFunc();
} else {
return "404";
}
};
// go fully static with no DDP with this
export DDP_DEFAULT_CONNECTION_URL=http://non-existing-url.com
// https://github.com/arunoda/meteor-static-blog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment