Skip to content

Commit c26cb81

Browse files
Merge branch 'master' into update-kanvas-logos
2 parents 68b1aa1 + 376eedc commit c26cb81

781 files changed

Lines changed: 222 additions & 4518 deletions

File tree

Some content is hidden

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

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
GATSBY_GRAPHQL_IDE=playground
1+
# GATSBY_GRAPHQL_IDE=playground

CONTRIBUTING.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,30 @@ Make sure you have the following prerequisites installed on your operating syste
500500

501501
## Set up your Local Development Environment
502502

503+
### Make Targets
504+
505+
Layer5 uses a `Makefile` that defines a set of rules and instructions (called **targets**) for creating, updating, and running parts of the project. Each target abstracts the underlying commands and logic, allowing to execute complex workflows using a simple `make <target>` command.
506+
507+
> **Note:** While using the make command on Windows, there sometimes arises an error in identifying the command even after it is installed (unrecognized command), this is because the PATH for the binary might not be set correctly.
508+
509+
To see the complete and current list of available make targets along with a short description of what each one does, simply run the following command from the root of the project:
510+
511+
```bash
512+
make
513+
```
514+
515+
### Environment Variables
516+
517+
Environment variables are named values used to configure how an application behaves in different environments without modifying the code.
518+
519+
| Variable | Possible Values | Description |
520+
|---------|----------------|------------|
521+
| `BUILD_FULL_SITE` | `true`, `false` | When set to `true`, enables a full site build including all collections. If not explicitly set to `true`, the project defaults to a lightweight build. |
522+
| `NODE_ENV` | `development`, `production` | Determines the build and rendering mode used by Gatsby. This is automatically set by Gatsby. <br><br>• `development` - Uses **Deferred Static Generation (DSG)** i.e pages built on demand for faster startup. <br>• `production` - Uses **Server-Side Rendering (SSR)** i.e pages rendered on each request for fresh content. |
523+
| `CI` | `true`, `false` | Indicates that the build is running in a **Continuous Integration (CI)** environment (e.g., GitHub Actions). When set to `true`, special logic is applied to page paths and redirects for GitHub Pages compatibility. This is typically set automatically by the CI system and does not need to be configured manually. |
524+
525+
---
526+
503527
Follow the following instructions to start contributing.
504528

505529
**1.** Fork [this](https://github.com/layer5io/layer5) repository.
@@ -554,7 +578,7 @@ make setup
554578
make site
555579
```
556580

557-
This will run a local webserver with "live reload" conveniently enabled. ( **NOTE**: while using the make command on Windows, there sometimes arises an error in identifying the command even after it is installed (unrecognized command), this is because the PATH for the binary might not be set correctly ).
581+
This will run a local webserver with "live reload" conveniently enabled.
558582

559583
**11.** Track your changes.
560584

content-learn/mastering-meshery/introduction-to-meshery/index.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ courseTitle: "Introduction to Meshery"
88
themeColor: "#00B39F"
99
order: 1
1010
cardImage: '../../../src/assets/images/meshery/icon-only/meshery-logo-white.svg'
11+
meshesYouLearn:
12+
[
13+
{
14+
imagepath: "../../../src/assets/images/meshery/icon-only/meshery-logo.svg",
15+
name: "Meshery",
16+
},
17+
]
1118
toc:
1219
[
1320
"meshery-concepts",

gatsby-config.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
/* eslint-env node */
22

3+
const isDevelopment = process.env.NODE_ENV === "development";
34
const isProduction = process.env.NODE_ENV === "production";
45
const isFullSiteBuild = process.env.BUILD_FULL_SITE === "true";
56
const HEAVY_COLLECTIONS = ["members", "integrations"];
67
const collectionIgnoreGlobs = isFullSiteBuild
78
? []
89
: HEAVY_COLLECTIONS.map((name) => `**/${name}/**`);
9-
// const isDevelopment = process.env.NODE_ENV === "development";
10-
10+
const devFlags = isDevelopment
11+
? {
12+
PARALLEL_SOURCING: false,
13+
PRESERVE_FILE_DOWNLOAD_CACHE: true,
14+
}
15+
: {};
16+
console.info(`Build Environment: "${process.env.NODE_ENV}"`);
17+
collectionIgnoreGlobs == [] ?
18+
console.info(`Build Scope exludes: "${process.env.BUILD_FULL_SITE}"`)
19+
:
20+
console.info("Build Scope includes all collections");
1121
module.exports = {
1222
siteMetadata: {
1323
title: "Layer5 - Expect more from your infrastructure",
@@ -20,9 +30,9 @@ module.exports = {
2030
twitterUsername: "@layer5",
2131
},
2232
flags: {
23-
FAST_DEV: true,
24-
PARALLEL_SOURCING: false, // Disable parallel sourcing to reduce memory pressure
33+
FAST_DEV: false,
2534
DEV_SSR: false,
35+
...devFlags,
2636
},
2737
trailingSlash: "never",
2838
plugins: [
@@ -518,4 +528,4 @@ module.exports = {
518528
"gatsby-plugin-meta-redirect",
519529
// make sure this is always the last one
520530
],
521-
};
531+
};

gatsby-node.js

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ 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";
1416
const {
1517
componentsData,
1618
} = require("./src/sections/Projects/Sistent/components/content");
@@ -34,6 +36,7 @@ if (process.env.CI === "true") {
3436
if (page.path !== oldPage.path) {
3537
// Replace new page with old page
3638
deletePage(oldPage);
39+
page.slices = { ...DEFAULT_SLICES, ...(page.slices || {}) };
3740
createPage(page);
3841

3942
createRedirect({
@@ -49,16 +52,58 @@ if (process.env.CI === "true") {
4952

5053
const { loadRedirects } = require("./src/utils/redirects.js");
5154

55+
const DEFAULT_SLICES = {
56+
"site-header": "site-header",
57+
"site-footer": "site-footer",
58+
"cta-bottom": "cta-bottom",
59+
"cta-fullwidth": "cta-fullwidth",
60+
"cta-imageonly": "cta-imageonly",
61+
};
62+
5263
exports.createPages = async ({ actions, graphql, reporter }) => {
53-
const { createRedirect } = actions;
64+
const { createRedirect, createSlice } = actions;
5465
const redirects = loadRedirects();
5566
redirects.forEach(redirect => createRedirect(redirect)); // Handles all hardcoded ones dynamically
5667
// Create Pages
5768
const { createPage } = actions;
5869

70+
createSlice({
71+
id: "site-header",
72+
component: path.resolve("./src/slices/site-header.js"),
73+
});
74+
75+
createSlice({
76+
id: "site-footer",
77+
component: path.resolve("./src/slices/site-footer.js"),
78+
});
79+
80+
createSlice({
81+
id: "cta-bottom",
82+
component: path.resolve("./src/slices/cta-bottom.js"),
83+
});
84+
85+
createSlice({
86+
id: "cta-fullwidth",
87+
component: path.resolve("./src/slices/cta-fullwidth.js"),
88+
});
89+
90+
createSlice({
91+
id: "cta-imageonly",
92+
component: path.resolve("./src/slices/cta-imageonly.js"),
93+
});
94+
5995
const envCreatePage = (props) => {
96+
const pageConfig = { ...props };
97+
98+
if (isDevelopment) {
99+
pageConfig.defer = true;
100+
} else if (isProduction) {
101+
pageConfig.mode = "SSR";
102+
}
103+
pageConfig.slices = { ...DEFAULT_SLICES, ...(pageConfig.slices || {}) };
104+
60105
if (process.env.CI === "true") {
61-
const { path, matchPath, ...rest } = props;
106+
const { path, matchPath, ...rest } = pageConfig;
62107

63108
createRedirect({
64109
fromPath: `/${path}/`,
@@ -73,7 +118,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
73118
...rest,
74119
});
75120
}
76-
return createPage(props);
121+
return createPage(pageConfig);
77122
};
78123

79124
const blogPostTemplate = path.resolve("src/templates/blog-single.js");
@@ -510,7 +555,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
510555
});
511556

512557
const components = componentsData.map((component) => component.src.replace("/", ""));
513-
const createComponentPages = (createPage, components) => {
558+
const createComponentPages = (envCreatePage, components) => {
514559
const pageTypes = [
515560
{ suffix: "", file: "index.js" },
516561
{ suffix: "/guidance", file: "guidance.js" },
@@ -523,7 +568,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
523568
const componentPath = `./src/sections/Projects/Sistent/components/${name}/${file}`;
524569
if (fs.existsSync(path.resolve(componentPath))) {
525570
try {
526-
createPage({
571+
envCreatePage({
527572
path: pagePath,
528573
component: require.resolve(componentPath),
529574
});
@@ -537,7 +582,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
537582
});
538583
};
539584

540-
createComponentPages(createPage, components);
585+
createComponentPages(envCreatePage, components);
541586
};
542587

543588
// slug starts and ends with '/' so parts[0] and parts[-1] will be empty

onRenderBody.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@ const themes = { light: lighttheme, dark: darktheme };
77
const MagicScriptTag = (props) => {
88
const codeToRunOnClient = `
99
(function() {
10+
// 1. Keeps SYSTEM as the priority preference
1011
const themeFromLocalStorage = localStorage.getItem('${DarkThemeKey}') || '${ThemeSetting.SYSTEM}';
11-
const systemDarkModeSetting = () => window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;
12-
const isDarkModeActive = () => {
13-
return !!systemDarkModeSetting()?.matches;
12+
13+
// 2. We change the check to look for LIGHT mode explicitly
14+
const systemLightModeSetting = () => window.matchMedia ? window.matchMedia('(prefers-color-scheme: light)') : null;
15+
16+
const isLightModeActive = () => {
17+
return !!systemLightModeSetting()?.matches;
1418
};
19+
1520
let colorMode;
1621
switch (themeFromLocalStorage) {
1722
case '${ThemeSetting.SYSTEM}':
18-
colorMode = isDarkModeActive() ? '${ThemeSetting.DARK}' : '{ThemeSetting.LIGHT}'
23+
// LOGIC CHANGE: If Light is active -> Light. Otherwise (Dark, No Preference, or Error) -> Dark.
24+
colorMode = isLightModeActive() ? '${ThemeSetting.LIGHT}' : '${ThemeSetting.DARK}'
1925
break
2026
case '${ThemeSetting.DARK}':
2127
case '${ThemeSetting.LIGHT}':
2228
colorMode = themeFromLocalStorage
2329
break
2430
default:
25-
colorMode = '${ThemeSetting.LIGHT}'
31+
// 3. Fallback to DARK in case of error
32+
colorMode = '${ThemeSetting.DARK}'
2633
}
34+
2735
const root = document.documentElement;
2836
const iterate = (obj) => {
2937
if (!obj) return;
@@ -46,4 +54,4 @@ const MagicScriptTag = (props) => {
4654

4755
export const onRenderBody = ( { setPreBodyComponents }) => {
4856
setPreBodyComponents(<MagicScriptTag key="theme-injection" theme={themes} />);
49-
};
57+
};

root-wrapper.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React from "react";
22
import { MDXProvider } from "@mdx-js/react";
33
import Code from "./src/components/CodeBlock";
4-
import CTA_ImageOnly from "./src/components/Call-To-Actions/CTA_ImageOnly";
5-
import CTA_FullWidth from "./src/components/Call-To-Actions/CTA_FullWidth";
6-
import CTA_Bottom from "./src/components/Call-To-Actions/CTA_Bottom";
4+
import { Slice } from "gatsby";
75
import { ContextWrapper } from "./context-wrapper";
86

97
// Custom image component for better CLS scores
@@ -41,9 +39,9 @@ const components = {
4139
}
4240
},
4341
img: OptimizedImage,
44-
CTA_ImageOnly,
45-
CTA_FullWidth,
46-
CTA_Bottom
42+
CTA_ImageOnly: (props) => <Slice alias="cta-imageonly" sliceContext={props} />, // slice to avoid page rebuilds on CTA tweaks
43+
CTA_FullWidth: (props) => <Slice alias="cta-fullwidth" sliceContext={props} />, // slice to avoid page rebuilds on CTA tweaks
44+
CTA_Bottom: (props) => <Slice alias="cta-bottom" sliceContext={props} />
4745
};
4846

4947
export const wrapRootElement = ({ element }) => (

src/assets/brand/bookmarks.pdf

-220 KB
Binary file not shown.

src/assets/brand/brand-guide.pdf

-6.67 MB
Binary file not shown.

src/assets/images/hosting.zip

-1.45 MB
Binary file not shown.

0 commit comments

Comments
 (0)