Created
February 17, 2014 00:55
-
-
Save stephentcannon/9042903 to your computer and use it in GitHub Desktop.
meteor content router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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