Skip to content

Commit d6ea88c

Browse files
Reverted Gatsby-node.js and created empty code.js and guidance.js
Signed-off-by: Rajesh-Nagarajan-11 <rajeshnagarajan36@gmail.com>
1 parent db96801 commit d6ea88c

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

gatsby-node.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -802,25 +802,21 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
802802
{ suffix: "/code", file: "code.js" },
803803
];
804804

805-
// Process each component
806805
components.forEach((name) => {
807-
// First check which file types exist for this component
808-
const availableFiles = pageTypes.filter(({ file }) => {
809-
const componentPath = `./src/sections/Projects/Sistent/components/${name}/${file}`;
810-
return fs.existsSync(path.resolve(componentPath));
811-
});
812-
813-
// Only create pages for files that actually exist
814-
availableFiles.forEach(({ suffix, file }) => {
806+
pageTypes.forEach(({ suffix, file }) => {
815807
const pagePath = `/projects/sistent/components/${name}${suffix}`;
816808
const componentPath = `./src/sections/Projects/Sistent/components/${name}/${file}`;
817-
try {
818-
createPage({
819-
path: pagePath,
820-
component: require.resolve(componentPath),
821-
});
822-
} catch (error) {
823-
console.error(`Error creating page for "${pagePath}":`, error);
809+
if (fs.existsSync(path.resolve(componentPath))) {
810+
try {
811+
createPage({
812+
path: pagePath,
813+
component: require.resolve(componentPath),
814+
});
815+
} catch (error) {
816+
console.error(`Error creating page for "${pagePath}":`, error);
817+
}
818+
} else {
819+
console.info(`Skipping creating page "${pagePath}" - file not found: "${componentPath}"`);
824820
}
825821
});
826822
});

src/sections/Projects/Sistent/components/icons/code.js

Whitespace-only changes.

src/sections/Projects/Sistent/components/icons/guidance.js

Whitespace-only changes.

0 commit comments

Comments
 (0)