Skip to content

Commit f4aba29

Browse files
Merge branch 'master' into add/latest-article-2026
2 parents 770b85d + 4304b03 commit f4aba29

File tree

126 files changed

+3001
-4010
lines changed

Some content is hidden

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

126 files changed

+3001
-4010
lines changed

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npm run lint
1+
npx lint-staged

.lintstagedrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
// Lint & Prettify TS and JS files - only the staged files
3+
"**/*.(ts|tsx|js|jsx)": (filenames) => [
4+
`cross-env NODE_ENV=test npx eslint --fix --max-warnings=0 ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
5+
`npx prettier --write ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
6+
],
7+
8+
// Prettify only Markdown and JSON files
9+
"**/*.(md|json)": (filenames) =>
10+
`npx prettier --write ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
11+
};

gatsby-config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const isDevelopment = process.env.NODE_ENV === "development";
44
const isProduction = process.env.NODE_ENV === "production";
5-
const isFullSiteBuild = process.env.BUILD_FULL_SITE === "true";
5+
const isFullSiteBuild = process.env.BUILD_FULL_SITE !== "false";
66
const HEAVY_COLLECTIONS = ["members", "integrations"];
77
const collectionIgnoreGlobs = isFullSiteBuild
88
? []
@@ -14,8 +14,8 @@ const devFlags = isDevelopment
1414
}
1515
: {};
1616
console.info(`Build Environment: "${process.env.NODE_ENV}"`);
17-
collectionIgnoreGlobs == [] ?
18-
console.info(`Build Scope exludes: "${process.env.BUILD_FULL_SITE}"`)
17+
collectionIgnoreGlobs.length > 0 ?
18+
console.info(`Build Scope excludes: "${process.env.BUILD_FULL_SITE}"`)
1919
:
2020
console.info("Build Scope includes all collections");
2121
module.exports = {

gatsby-node.js

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ const slugify = require("./src/utils/slugify");
1111
const { paginate } = require("gatsby-awesome-pagination");
1212
const { createFilePath } = require("gatsby-source-filesystem");
1313
const config = require("./gatsby-config");
14-
const isDevelopment = process.env.NODE_ENV === "development";
15-
const isProduction = process.env.NODE_ENV === "production";
1614
const {
1715
componentsData,
1816
} = require("./src/sections/Projects/Sistent/components/content");
@@ -21,34 +19,6 @@ const HEAVY_COLLECTIONS = new Set(["members", "integrations"]);
2119
const isFullSiteBuild = process.env.BUILD_FULL_SITE !== "false";
2220
const shouldIncludeCollection = (collection) => isFullSiteBuild || !HEAVY_COLLECTIONS.has(collection);
2321

24-
if (process.env.CI === "true") {
25-
// All process.env.CI conditionals in this file are in place for GitHub Pages, if webhost changes in the future, code may need to be modified or removed.
26-
//Replacing '/' would result in empty string which is invalid
27-
const replacePath = (url) =>
28-
url === "/" || url.includes("/404") || url.endsWith(".html") ? url : `${url}.html`;
29-
30-
exports.onCreatePage = ({ page, actions }) => {
31-
const { createPage, deletePage, createRedirect } = actions;
32-
const oldPage = Object.assign({}, page);
33-
page.matchPath = page.path;
34-
page.path = replacePath(page.path);
35-
36-
if (page.path !== oldPage.path) {
37-
// Replace new page with old page
38-
deletePage(oldPage);
39-
createPage(page);
40-
41-
createRedirect({
42-
fromPath: `/${page.matchPath}/`,
43-
toPath: `/${page.matchPath}`,
44-
redirectInBrowser: true,
45-
isPermanent: true,
46-
});
47-
}
48-
};
49-
}
50-
51-
5222
const { loadRedirects } = require("./src/utils/redirects.js");
5323

5424
exports.createPages = async ({ actions, graphql, reporter }) => {
@@ -59,23 +29,22 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
5929
const { createPage } = actions;
6030

6131
const envCreatePage = (props) => {
32+
const pageProps = {
33+
...props,
34+
matchPath: props.matchPath || props.path,
35+
};
36+
6237
if (process.env.CI === "true") {
63-
const { path, matchPath, ...rest } = props;
64-
const isHandbookPage = path.startsWith("/community/handbook/");
38+
const { path } = pageProps;
6539
createRedirect({
6640
fromPath: `/${path}/`,
6741
toPath: `/${path}`,
6842
redirectInBrowser: true,
6943
isPermanent: true,
7044
});
71-
72-
return createPage({
73-
path: isHandbookPage ? path : `${path}.html`,
74-
matchPath: matchPath || path,
75-
...rest,
76-
});
7745
}
78-
return createPage(props);
46+
47+
return createPage(pageProps);
7948
};
8049

8150
const blogPostTemplate = path.resolve("src/templates/blog-single.js");
@@ -260,6 +229,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
260229
};
261230

262231
const blogs = filterByCollection("blog");
232+
263233
const resources = filterByCollection("resources");
264234
const news = filterByCollection("news");
265235
const books = filterByCollection("service-mesh-books");
@@ -358,9 +328,10 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
358328
programs.forEach((program) => {
359329
envCreatePage({
360330
path: program.fields.slug,
361-
component: `${ProgramPostTemplate}?__contentFilePath=${program.internal.contentFilePath}`,
331+
component: `${MultiProgramPostTemplate}?__contentFilePath=${program.internal.contentFilePath}`,
362332
context: {
363333
slug: program.fields.slug,
334+
program: program.frontmatter.program,
364335
},
365336
});
366337
});
@@ -690,11 +661,11 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
690661
case "kanvas-labs":
691662
slug = `/learn/${collection}/${slugify(node.frontmatter.title)}`;
692663
break;
693-
case "resources":
694-
if (node.frontmatter.published)
695-
slug = `/${collection}/${slugify(
696-
node.frontmatter.category
697-
)}/${slugify(node.frontmatter.title)}`;
664+
case "resources":
665+
if (node.frontmatter.published)
666+
slug = `/${collection}/${slugify(
667+
node.frontmatter.category
668+
)}/${slugify(node.frontmatter.title)}`;
698669
break;
699670
case "members":
700671
if (node.frontmatter.published)
@@ -766,7 +737,7 @@ const createCoursesListPage = ({ envCreatePage, node }) => {
766737
};
767738

768739
const createCourseOverviewPage = ({ envCreatePage, node }) => {
769-
const { learnpath, slug, course, pageType, permalink,section } = node.fields;
740+
const { learnpath, slug, course, pageType, permalink, section } = node.fields;
770741

771742
envCreatePage({
772743
path: `${slug}`,

0 commit comments

Comments
 (0)