Disabled fires render
This commit is contained in:
parent
cb7aeda4b8
commit
c7b2641e4f
1 changed files with 16 additions and 12 deletions
|
|
@ -4,6 +4,8 @@
|
||||||
import Fires from '/imports/api/Fires/Fires';
|
import Fires from '/imports/api/Fires/Fires';
|
||||||
// import Comments from '/imports/api/Comments/Comments';
|
// import Comments from '/imports/api/Comments/Comments';
|
||||||
|
|
||||||
|
const firesMapEnabled = false;
|
||||||
|
|
||||||
sitemaps.add('/sitemap.xml', () => {
|
sitemaps.add('/sitemap.xml', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
|
|
||||||
|
|
@ -20,21 +22,23 @@ sitemaps.add('/sitemap.xml', () => {
|
||||||
|
|
||||||
// When user has public page
|
// When user has public page
|
||||||
/* const users = Meteor.users.find().fetch();
|
/* const users = Meteor.users.find().fetch();
|
||||||
_.each(users, function(user) {
|
_.each(users, function(user) {
|
||||||
out.push({
|
out.push({
|
||||||
page: '/persona/' + user.username,
|
page: '/persona/' + user.username,
|
||||||
lastmod: user.updatedAt
|
lastmod: user.updatedAt
|
||||||
});
|
});
|
||||||
}); */
|
}); */
|
||||||
|
|
||||||
Fires.find({}, { limit: 100, sort: { createdAt: -1 } }).fetch().forEach((fire) => {
|
if (firesMapEnabled) {
|
||||||
// Search the last comment of tha fire
|
Fires.find({}, { limit: 100, sort: { createdAt: -1 } }).fetch().forEach((fire) => {
|
||||||
const lastComment = Comments.getCollection().findOne({ referenceId: `fire-${fire._id}` }, { sort: { createdAt: -1 } });
|
// Search the last comment of tha fire
|
||||||
out.push({
|
const lastComment = Comments.getCollection().findOne({ referenceId: `fire-${fire._id}` }, { sort: { createdAt: -1 } });
|
||||||
page: `/fire/archive/${fire._id._str}`,
|
out.push({
|
||||||
lastmod: lastComment ? lastComment.createdAt : fire.updatedAt
|
page: `/fire/archive/${fire._id._str}`,
|
||||||
|
lastmod: lastComment ? lastComment.createdAt : fire.updatedAt
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue