/** * Configure accounts-ui. */ Accounts.ui.config({ passwordSignupFields: "USERNAME_ONLY" }); // Routing. Router.configure({ layoutTemplate: "layout" }); Router.route("/", function () { this.render("page_home", { to: "contents" }); }); Router.route("/search/:search", function () { const search = this.params.search; this.render("page_search", { to: "contents", data: { search, result: Websites.find({ words: { $regex: new RegExp(search) } }).fetch() } }); }); Router.route("/site/:id", function () { const id = this.params.id; const doc = _.extend({ onPage: true }, Websites.findOne({ _id: id })); this.render("page_site", { to: "contents", data: function () { return doc; } }); });