Skip to content

Commit

Permalink
Fix events
Browse files Browse the repository at this point in the history
  • Loading branch information
hjonin committed Feb 14, 2024
1 parent d9c63c8 commit bd6ca42
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
13 changes: 12 additions & 1 deletion content/fr/bluehats/ateliers/ateliers.11tydata.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require("path");

module.exports = {
tags: [
"bluehats_posts", "atelier", "event"
"bluehats_posts", "atelier", "events"
],
layout: "layouts/bluehats-post.njk",
permalink: function (data) {
Expand All @@ -24,7 +24,18 @@ module.exports = {
const currentTime = new Date().getTime();
if (postTime > currentTime) {
return ["à venir"];
} else {
return ["passé"]
}
},
start: data => {
const postTime = new Date(data.page.date);
postTime.setUTCHours(11);
return postTime;
},
duration: {
hours: 1,
minutes: 30
}
}
};
14 changes: 12 additions & 2 deletions content/fr/bluehats/rencontres/rencontres.11tydata.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require("path");

module.exports = {
tags: [
"bluehats_posts", "rencontre", "event"
"bluehats_posts", "rencontre", "events"
],
layout: "layouts/bluehats-post.njk",
permalink: function (data) {
Expand All @@ -18,6 +18,16 @@ module.exports = {
} else {
return data.image;
}
}
},
badges: data => {
const postTime = new Date(data.page.date).getTime();
const currentTime = new Date().getTime();
if (postTime > currentTime) {
return ["à venir"];
} else {
return ["passé"]
}
},
start: data => data.page.date
}
};
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ module.exports = function (eleventyConfig) {
});

eleventyConfig.addFilter("filterTagList", function filterTagList(tags, addTags = []) {
return (tags || []).filter(tag => ["all", "nav", "post", "posts", "bluehats_post", "bluehats_posts", "event"]
return (tags || []).filter(tag => ["all", "nav", "post", "posts", "bluehats_post", "bluehats_posts", "events"]
.concat(addTags)
.indexOf(tag) === -1);
});
Expand Down

0 comments on commit bd6ca42

Please sign in to comment.