我有来自Google的.html文件,我需要在http://www.domain.com/google1234567890123456.html
投放。我将.html文件放入pathToMeteorApp/public/
但是当我访问该URL时,Meteor为我提供了一个带有一些模板的空白页面。
我正在使用iron-router
,所以即使.html文件位于公共文件夹中,路由器仍然可以管理.html文件的URL吗?如果是这样,我们如何防止这种情况并直接在该网址上提供.html文件?
答案 0 :(得分:2)
我会尝试创建一条路线:
Router.map(function() {
this.route('google', {
path: '/google1234567890123456.html'
});
});
和模板:
<template name="google">
<!-- Your google1234567890123456.html content in <body></body> here -->
</template>
如果它包含任何脚本,您可以在渲染函数中执行它们:
//client code
Template.google.rendered = function() {
//execute google scripts
}