Skip to content

Commit 50d6fea

Browse files
Merge branch 'master' into handbook-migration
2 parents fc93e77 + 376eedc commit 50d6fea

741 files changed

Lines changed: 112 additions & 4489 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: 8 additions & 0 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");
@@ -92,6 +94,12 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
9294

9395
const envCreatePage = (props) => {
9496
const pageConfig = { ...props };
97+
98+
if (isDevelopment) {
99+
pageConfig.defer = true;
100+
} else if (isProduction) {
101+
pageConfig.mode = "SSR";
102+
}
95103
pageConfig.slices = { ...DEFAULT_SLICES, ...(pageConfig.slices || {}) };
96104

97105
if (process.env.CI === "true") {

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+
};

src/collections/blog/2022/2022-01-07-Recap-KubeCon-China-TAG-Network-talk/index.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import Smp from "./smp-meshery.webp";
2323
import Smi from "./smi-meshery.webp";
2424
import Patterns from "./patterns.webp";
2525
import Catalog from "./catalog.webp";
26-
import slidesTAG from "../../../events/2021/kubecon-china-2021/cncf-tag-network-and-service-mesh-working-group-kubecon-china-2021-lee-calcote-ken-owens.pdf";
2726
import { Link } from "gatsby";
2827

2928
<BlogWrapper>
@@ -94,7 +93,7 @@ The majority of the more detailed activities occur in the CNCF Service Mesh Work
9493
alt="GetNighthawk"
9594
/>
9695

97-
<strong>Calcote and Owens packed a great deal of information in this talk. If you are passionate about Cloud Native Networking and Service Meshes, then this talk is definitely worth your time. Find the recording below. The presentation slides are available <a href={slidesTAG}>here</a>. </strong>
96+
<strong>Calcote and Owens packed a great deal of information in this talk. If you are passionate about Cloud Native Networking and Service Meshes, then this talk is definitely worth your time. Find the recording below. The <a href="/static/events/2021/kubecon-china-2021/cncf-tag-network-and-service-mesh-working-group-kubecon-china-2021-lee-calcote-ken-owens.pdf">presentation slides</a> are available.</strong>
9897
<div className="iframe-container">
9998
<iframe src="https://www.youtube.com/embed/pUDm8Xx4RXg" loading="lazy" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen ></iframe>
10099
</div>

src/collections/blog/2022/2022-05-10-dockercon-22-hashicorp-talk/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ featured: true
1919

2020
import { BlogWrapper } from "../../Blog.style.js";
2121
import Blockquote from "../../../../reusecore/Blockquote";
22-
import slidesTAG from "../../../events/2021/kubecon-china-2021/cncf-tag-network-and-service-mesh-working-group-kubecon-china-2021-lee-calcote-ken-owens.pdf";
2322
import { Link } from "gatsby";
2423
import DDE from './docker-extension-meshery.webp';
2524
import developer from './developers-need.webp';

src/collections/blog/2022/2022-05-14-service-meshcon-talk-intel/index.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import { BlogWrapper } from "../../Blog.style.js";
2222
import Blockquote from "../../../../reusecore/Blockquote";
2323
import { Link } from "gatsby";
2424

25-
import slidesTAG from "../../../events/2021/kubecon-china-2021/cncf-tag-network-and-service-mesh-working-group-kubecon-china-2021-lee-calcote-ken-owens.pdf";
26-
2725
import meshmark from './meshmark-dark-text-side.svg';
2826
import performanceQuestion from './performance-question.webp';
2927
import smp from './smp.webp';
-3.04 MB
Loading

0 commit comments

Comments
 (0)