Skip to content

Commit

Permalink
Merge pull request #2464 from mainmatter/rust-workshops
Browse files Browse the repository at this point in the history
Rust workshops
  • Loading branch information
marcoow authored Jun 24, 2024
2 parents cb7e453 + ac8e4ea commit 4e67a91
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 18 deletions.
8 changes: 8 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addFilter("urlExists", (url, collection) => {
return Boolean(collection?.find(({ page }) => page.url === url));
});

eleventyConfig.addFilter("future", collection => {
return collection.filter(item => {
if (Number.isNaN(Date.parse(item.endDate))) return console.log("Workshop has invalid date!");
return Date.parse(item.endDate) > new Date();
});
});

/*
* Add Transforms
*
Expand Down
10 changes: 9 additions & 1 deletion collections/tagsPostsPaged.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
const config = require("../src/_data/config");
const sortByDate = require("../utils/sortByDate");
const livePosts = require("./posts");

module.exports = collection => {
const tagList = require("./tags")(collection);

const maxPostsPerPage = config.maxPostsPerPage;
const pagedPosts = [];

const allPosts = livePosts(collection);

Object.keys(tagList).forEach(tagName => {
const sortedPosts = [...collection.getFilteredByTag(tagName)].sort(sortByDate("desc"));
const filtered = allPosts.filter(post => {
if (post.data.tags.length > 0) {
return post?.data?.tags?.includes(tagName);
}
});
const sortedPosts = filtered.sort(sortByDate("desc"));
const numberOfPages = Math.ceil(sortedPosts.length / maxPostsPerPage);

for (let pageNum = 1; pageNum <= numberOfPages; pageNum++) {
Expand Down
10 changes: 10 additions & 0 deletions src/_data/publicRustWorkshops.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"workshops": [
{
"endDate": "2024-05-29T18:00+02:00",
"date": "May 28th + 29th, 2024, 14:00-18:00 CEST",
"text": "Remote Workshop: Telemetry for Rust APIs – you can't fix what you can't see",
"link": "https://ti.to/mainmatter/rust-telemetry-may-2024"
}
]
}
39 changes: 22 additions & 17 deletions src/services/workshops/rust.njk
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ description: "We provide a number of workshops to enable teams to succeed with R
starting from the basics of the language all the way to advanced testing techniques and comprehensive
telemetry instrumentation.', workshops)
}}
{% set public_workshops = [] %}
{{ publicWorkshops(public_workshops) }}
{% set futurePublicWorkshops = publicRustWorkshops.workshops | future %}
{{ publicWorkshops(futurePublicWorkshops) }}

<section class="my-10">
<div class="container container--lg">
Expand Down Expand Up @@ -238,19 +238,24 @@ description: "We provide a number of workshops to enable teams to succeed with R
</div>
</section>

{%
set 'content' = {
"subtitle": "Discover our other services"
}
%}
{{ featuredServices(services['rust-workshops'], content) }}
<section class="my-10 container container--lg">
<div class="split-content no-link">
<div class="split-content__wrapper">
<div class="split-content__content">
<h2 class="split-content__subheading">Your mentor</h2>
<p>
Luca Palmieri is a Principal Engineering Consultant at Mainmatter and builds technology
products for a living. His current focus is on backend development, software architecture
and the Rust programming language. He is the author of
<a href="https://zero2prod.com">"Zero to Production in Rust"</a>.
</p>
</div>
<div class="split-content__feature">
{% include 'content/secondary-feature-rust-consulting.njk' %}
</div>
</div>
</div>
</section>

{% include "global/rust-cta.njk" %}
{% include "global/rust-newsletter-cta.njk" %}
{%
set 'content' = {
"title": "Grow your business with us",
"text": "Our experts are ready to guide you through your next big move. Let us know how we can help.",
"linkUrl": "/contact",
"linkText": "Get in touch"
}
%}
{{ ctaBanner('purple', 'full', content) }}

0 comments on commit 4e67a91

Please sign in to comment.