Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/_data/certifiedNodes.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/_data/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"imageFolder": "../images/pictograms/",
"imageFile": "certified-nodes_blue.png",
"imageAlt": " certifying badge.",
"content": "Our curated collection of certified nodes, ensuring top-notch quality, security, and support. Explore our certified nodes on the <a href='/certified-nodes'>Certified Nodes Page</a> and benefit from a robust ecosystem while maintaining operational reliability."
"content": "Our curated collection of certified nodes, ensuring top-notch quality, security, and support. <a href='/integrations/?certified=1'>Explore our certified nodes</a> and benefit from a robust ecosystem while maintaining operational reliability."
}
]
29 changes: 5 additions & 24 deletions src/_data/integrations.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const EleventyFetch = require("@11ty/eleventy-fetch");
const certifiedNodes = require("./certifiedNodes");

module.exports = async () => {
console.log("Loading Integrations...");
Expand All @@ -12,44 +11,26 @@ module.exports = async () => {
type: "json"
});

// Get certified nodes first
const nodes = await certifiedNodes();
const ffNodesMap = nodes.reduce((acc, node) => {
acc[node.id] = node;
return acc;
}, {});

// Sort by weekly downloads and get top 50 nodes
const topNodes = response.catalogue
.sort((a, b) => b.downloads.week - a.downloads.week)
.slice(0, 50); // Limit to top 50 downloaded nodes

// Create a map of top nodes by ID for quick lookup
const topNodesMap = topNodes.reduce((acc, node) => {
acc[node._id] = node;
return acc;
}, {});

// Merge: ensure all certified nodes are included
// Add any certified nodes that aren't in the top 50
const certifiedNodeIds = Object.keys(ffNodesMap);
certifiedNodeIds.forEach(certifiedId => {
if (!topNodesMap[certifiedId]) {
// Find the certified node in the full catalogue
const certifiedNode = response.catalogue.find(n => n._id === certifiedId);
if (certifiedNode) {
topNodes.push(certifiedNode);
}
// Ensure all certified nodes are included even if outside the top 50.
// The ff-integrations API already marks them with ffCertified: true.
response.catalogue.forEach(node => {
if (node.ffCertified && !topNodesMap[node._id]) {
topNodes.push(node);
}
});

const data = Promise.all(
topNodes.map(async (node) => {
// Mark FlowFuse certified nodes
if (ffNodesMap[node._id]) {
node.ffCertified = true;
}

// Ensure categories exist
if (!node.categories) {
node.categories = [];
Expand Down
33 changes: 0 additions & 33 deletions src/_includes/certified/template.njk

This file was deleted.

13 changes: 0 additions & 13 deletions src/certified-nodes.njk

This file was deleted.

2 changes: 2 additions & 0 deletions src/redirects.njk
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,5 @@ eleventyExcludeFromCollections: true
/handbook/development/releases/dashboard-2/ /handbook/engineering/releases/dashboard-2/
/handbook/development/releases/process/ /handbook/engineering/releases/process/
/handbook/development/releases/digital-ocean/ /handbook/engineering/releases/digital-ocean/
/certified-nodes/ /integrations/?certified=1 301
/certified-nodes/* /integrations/?certified=1 301