mirror of
https://github.com/altstackHQ/altstack-data.git
synced 2026-04-18 00:53:14 +02:00
Initialize public data and docs repository
This commit is contained in:
34
data/seo.ts
Normal file
34
data/seo.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Tool } from '../app/types';
|
||||
import toolsData from './tools.json';
|
||||
|
||||
const tools = toolsData as Tool[];
|
||||
|
||||
export interface VsPair {
|
||||
slug: string; // "slack-vs-mattermost"
|
||||
proprietaryTool: Tool;
|
||||
opensourceTool: Tool;
|
||||
}
|
||||
|
||||
export function generateVsPairs(): VsPair[] {
|
||||
const pairs: VsPair[] = [];
|
||||
|
||||
// Find all proprietary tools
|
||||
const proprietaryTools = tools.filter(t => !t.is_open_source);
|
||||
|
||||
proprietaryTools.forEach(propTool => {
|
||||
if (!propTool.alternatives) return;
|
||||
|
||||
propTool.alternatives.forEach(altSlug => {
|
||||
const altTool = tools.find(t => t.slug === altSlug);
|
||||
if (altTool) {
|
||||
pairs.push({
|
||||
slug: `${propTool.slug}-vs-${altTool.slug}`,
|
||||
proprietaryTool: propTool,
|
||||
opensourceTool: altTool
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return pairs;
|
||||
}
|
||||
Reference in New Issue
Block a user