MCPcopy Create free account
hub / github.com/codename-co/stack / getStacks

Function getStacks

packages/website/src/content/collections/stacks.ts:12–39  ·  view source on GitHub ↗
(lang: string)

Source from the content-addressed store, hash-verified

10);
11
12export const getStacks = (lang: string) =>
13 _stacks
14 .sort((a, b) => {
15 // const aPromoted = promoted.some(({ data }) => data.slug === a.data.slug);
16 // const bPromoted = promoted.some(({ data }) => data.slug === b.data.slug);
17
18 // if (aPromoted && !bPromoted) {
19 // return -1;
20 // }
21 // if (!aPromoted && bPromoted) {
22 // return 1;
23 // }
24
25 const aRank = a.data.rank ?? 0;
26 const bRank = b.data.rank ?? 0;
27
28 return aRank > bRank ? -1 : aRank < bRank ? 1 : 0;
29 })
30 .map((stack) => ({
31 ...stack,
32 data: {
33 ...stack.data,
34 type: "stack",
35 description:
36 stack.data.i18n?.[lang]?.description ?? stack.data.description,
37 readme: stack.data.i18n?.[lang]?.readme ?? stack.data.readme,
38 },
39 }));

Callers 7

Logo.tsxFile · 0.90
getContentFunction · 0.90
GETFunction · 0.90
GETFunction · 0.90
getStaticPathsFunction · 0.90
GETFunction · 0.90
graph.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected