Skip to content

Commit 568d5fc

Browse files
Merge branch 'master' of https://github.com/layer5io/layer5 into bugfix/reduce-empty-space-after-integration-section
2 parents 82a1532 + 16010bb commit 568d5fc

File tree

252 files changed

+18971
-25517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+18971
-25517
lines changed

gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ module.exports = {
360360
}
361361
}
362362
allMdx(
363-
sort: {frontmatter: {date: DESC}}
363+
sort: {fields: {dateForSort: DESC}}
364364
limit: 20
365365
filter: {
366366
frontmatter: { published: { eq: true } }

gatsby-node.js

Lines changed: 85 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ const {
1515
getExcludedCollections,
1616
isFullSiteBuild,
1717
} = require("./src/utils/build-collections");
18-
const {
19-
componentsData,
20-
} = require("./src/sections/Projects/Sistent/components/content");
2118

2219
const shouldBuildFullSite = isFullSiteBuild();
2320
const excludedCollections = new Set(
@@ -261,7 +258,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
261258
}
262259
}
263260
${
264-
isFullSiteBuild
261+
shouldBuildFullSite
265262
? `memberPosts: allMdx(
266263
filter: {
267264
fields: { collection: { eq: "members" } }
@@ -358,6 +355,25 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
358355
}
359356
}
360357
}
358+
sistentComponents: allMdx(
359+
filter: {
360+
fields: { collection: { eq: "sistent" } }
361+
}
362+
) {
363+
group(field: { fields: { componentName: SELECT } }) {
364+
fieldValue
365+
nodes {
366+
fields {
367+
slug
368+
componentName
369+
pageType
370+
}
371+
internal {
372+
contentFilePath
373+
}
374+
}
375+
}
376+
}
361377
}
362378
`);
363379

@@ -497,7 +513,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
497513
});
498514
});
499515

500-
if (isFullSiteBuild) {
516+
if (shouldBuildFullSite) {
501517
members.forEach((member) => {
502518
envCreatePage({
503519
path: member.fields.slug,
@@ -510,7 +526,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
510526
}
511527

512528
const MemberBio = res.data.memberBio?.nodes || [];
513-
if (isFullSiteBuild) {
529+
if (shouldBuildFullSite) {
514530
MemberBio.forEach((memberbio) => {
515531
envCreatePage({
516532
path: `${memberbio.fields.slug}/bio`,
@@ -542,7 +558,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
542558
});
543559
});
544560

545-
if (isFullSiteBuild) {
561+
if (shouldBuildFullSite) {
546562
integrations.forEach((integration) => {
547563
envCreatePage({
548564
path: `/cloud-native-management/meshery${integration.fields.slug}`,
@@ -575,7 +591,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
575591
});
576592
});
577593

578-
if (!isFullSiteBuild) {
594+
if (!shouldBuildFullSite) {
579595
const litePlaceholderPages = [
580596
{
581597
collection: "members",
@@ -712,39 +728,29 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
712728
}
713729
});
714730

715-
const components = componentsData.map((component) =>
716-
component.src.replace("/", ""),
717-
);
718-
const createComponentPages = (createPage, components) => {
719-
const pageTypes = [
720-
{ suffix: "", file: "index.js" },
721-
{ suffix: "/guidance", file: "guidance.js" },
722-
{ suffix: "/code", file: "code.js" },
723-
];
731+
// Create Sistent component pages dynamically from MDX
732+
// Use grouping to identify which sub-pages (Tabs) exist for each component
733+
const sistentGroups = res.data.sistentComponents.group;
734+
const sistentTemplate = path.resolve("src/templates/sistent-component.js");
724735

725-
components.forEach((name) => {
726-
pageTypes.forEach(({ suffix, file }) => {
727-
const pagePath = `/projects/sistent/components/${name}${suffix}`;
728-
const componentPath = `./src/sections/Projects/Sistent/components/${name}/${file}`;
729-
if (fs.existsSync(path.resolve(componentPath))) {
730-
try {
731-
createPage({
732-
path: pagePath,
733-
component: require.resolve(componentPath),
734-
});
735-
} catch (error) {
736-
console.error(`Error creating page for "${pagePath}":`, error);
737-
}
738-
} else {
739-
console.info(
740-
`Skipping creating page "${pagePath}" - file not found: "${componentPath}"`,
741-
);
742-
}
736+
sistentGroups.forEach((group) => {
737+
const componentName = group.fieldValue;
738+
// content-learn uses different fields, sistent uses componentName.
739+
740+
const availablePages = group.nodes.map((node) => node.fields.pageType);
741+
742+
group.nodes.forEach((node) => {
743+
createPage({
744+
path: node.fields.slug,
745+
component: `${sistentTemplate}?__contentFilePath=${node.internal.contentFilePath}`,
746+
context: {
747+
slug: node.fields.slug,
748+
componentName: componentName,
749+
availablePages: availablePages,
750+
},
743751
});
744752
});
745-
};
746-
747-
createComponentPages(createPage, components);
753+
});
748754
};
749755

750756
// slug starts and ends with '/' so parts[0] and parts[-1] will be empty
@@ -831,20 +837,36 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
831837
const parent = getNode(node.parent);
832838
let collection = parent.sourceInstanceName;
833839

834-
// --- CHANGED: Consolidated Source Logic ---
835840
// If the source is "collections", we determine the actual collection
836841
// from the parent directory name (e.g., "blog", "news", etc.)
837842
if (collection === "collections") {
838843
collection = parent.relativeDirectory.split("/")[0];
839844
}
840-
// ------------------------------------------
841845

842846
createNodeField({
843847
name: "collection",
844848
node,
845849
value: collection,
846850
});
847851

852+
// Normalize blog date to ISO string for stable sort order across build environments (fixes production blog order)
853+
if (collection === "blog") {
854+
let dateForSort = "1970-01-01T00:00:00.000Z";
855+
if (node.frontmatter?.date != null) {
856+
try {
857+
const parsed = new Date(node.frontmatter.date).toISOString();
858+
if (!Number.isNaN(Date.parse(parsed))) dateForSort = parsed;
859+
} catch {
860+
// keep fallback
861+
}
862+
}
863+
createNodeField({
864+
name: "dateForSort",
865+
node,
866+
value: dateForSort,
867+
});
868+
}
869+
848870
if (collection !== "content-learn") {
849871
let slug = "";
850872
if (node.frontmatter.permalink) {
@@ -882,6 +904,29 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
882904
if (node.frontmatter.title)
883905
slug = `/community/events/${slugify(node.frontmatter.title)}`;
884906
break;
907+
case "sistent": {
908+
// For sistent components, create slug from directory structure
909+
const componentSlug = parent.relativeDirectory.split("/").pop();
910+
const fileName = parent.name;
911+
const suffix = fileName === "index" ? "" : `/${fileName}`;
912+
913+
slug = `/projects/sistent/components/${componentSlug}${suffix}`;
914+
915+
createNodeField({
916+
name: "componentName",
917+
node,
918+
value: componentSlug,
919+
});
920+
921+
// "index" -> "overview", others match filename
922+
const pageType = fileName === "index" ? "overview" : fileName;
923+
createNodeField({
924+
name: "pageType",
925+
node,
926+
value: pageType,
927+
});
928+
break;
929+
}
885930
default:
886931
slug = `/${collection}/${slugify(node.frontmatter.title)}`;
887932
}

src/collections/handbook/repository-overview/repo-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const repo_data = [
4848
project: "Meshery Documentation",
4949
image: meshery,
5050
site: "http://docs.meshery.io",
51-
language: "Jekyll",
51+
language: "Hugo",
5252
maintainers_name: ["Vacant"],
5353
link: [""],
5454
repository: "https://github.com/meshery/meshery/tree/master/docs",

src/collections/integrations/kubevault/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ components: [
188188
"colorIcon": "icons/components/issuer/icons/color/issuer-color.svg",
189189
"whiteIcon": "icons/components/issuer/icons/white/issuer-white.svg",
190190
"description": "",
191+
},
192+
{
193+
"name": "issuer",
194+
"colorIcon": "icons/components/issuer/icons/color/issuer-color.svg",
195+
"whiteIcon": "icons/components/issuer/icons/white/issuer-white.svg",
196+
"description": "",
191197
}]
192198
featureList: [
193199
"Automates Vault deployment and configuration",
Lines changed: 74 additions & 0 deletions
Loading
Lines changed: 74 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)