- .husky
- .vscode
- Annual-Reports
- Security-Reports
- content
- src
-
static
-
data
-
fonts
-
images
- 2020-02-10-cilium-17-demo-preview.png
- 2020-06-02-cilium-18-kube-proxy.svg
- 2020-06-02-cilium-18-xdp-arch.png
- 2020-06-02-cilium-18-xdp-bench.png
- 2020-06-02-cilium-18-xdp-bench2.png
- 2020-06-02-cilium-18-xdp-test.png
- 2020-06-02-cilium-18-xdp.svg
- 2020-10-cilium-19-edt.png
- 2020-10-cilium-19-tcp-combined.png
- 2020-10-cilium-19-tcp-rr-bench.png
- 2020-10-cilium-19-tcp-stream-bench.png
- 2020-10-cilium-19-vm.png
- 2020-10-cilium-anywhere.png
- 2020-11-cilium-19-maglev.gif
- 2020-11-cilium-19-random.gif
- 2021-05-cilium-110-perf1.png
- 2021-05-cilium-110-perf2.png
- 2021-05-cilium-110-perf3.png
- 2021-05-cilium-110-xdp-lb-dsr.png
- 2021-05-cilium-110-xdp-lb-health.png
- 2021-05-cilium-110-xdp-lb.png
- _redirects
-
data
- .commitlintrc.json
- .drone.yml
- .env.example
- .eslintrc.js
- .gitignore
- .lintstagedrc
- .markdownlint.json
- .nvmrc
- .prettierignore
- .prettierrc
- CONTRIBUTING.md
- DEPENDENCY_UPDATES.md
- Events-Guidelines.md
- LICENSE
- README.md
- architecture.png
- gatsby-browser.js
- gatsby-config.js
- gatsby-node.js
- gatsby-ssr.js
- jsconfig.json
- netlify.toml
- package-lock.json
- package.json
- postcss.config.js
- tailwind.config.js
- testing.png
Explanation
This code defines a React component GetInvolved
that renders a page for encouraging user engagement with the Cilium project.
Component Breakdown:
- Imports: Imports necessary components and resources:
React
: The core React library.Guidelines
,ReportBugs
,Subscribe
: Components for different sections of the “Get Involved” page.Cards
,HandsOn
,HeroWithImage
,SEO
: Shared components used across the website.decor1
,decor2
: SVG images for decorative elements.MainLayout
: Layout component for the website.seo
: Metadata for the page fromutils/seo-metadata
.
- Data Structures: Defines two sets of data:
cardItems1
: An array of objects containing information for four “cards” (Slack, X, Newsletter, YouTube) - each with an icon, title, description, button text, button link, and target.cardItems2
: An object containing data for “develop and contribute” cards:title
: A title for this section.items
: An array of objects for each card (GitHub, Devstats, Code of Conduct) - each with an icon, title, description, button text (optional), button link (optional), and target (optional).
GetInvolved
Component: The main component responsible for rendering the “Get Involved” page.
useStaticQuery
: Fetches data from Gatsby’s GraphQL query to retrieve the hero image.hero
object: Defines the hero image, title, description, and decorative elements.- JSX structure: Renders the page using the imported components:
MainLayout
: Wraps the entire page with a gray theme and page metadata.HeroWithImage
: Displays the hero image, title, and description with decorative elements.Cards
(used twice): Renders the card components with the defined data.Guidelines
,ReportBugs
,HandsOn
,Subscribe
: Renders specific sections with their respective components.
Head
Component: A component used to define the page’s SEO metadata:
- Takes
pathname
from the URL as a prop. - Uses
seo
data to create anSEO
component instance with updated slug information.
Key Points:
- This code leverages Gatsby’s features for data fetching (
useStaticQuery
) and SEO (SEO
component). - The component is structured to be modular and reusable, with components for individual sections.
- The data structures define the content of the page in a clear and organized manner.
- It utilizes a
MainLayout
component, ensuring consistent styling and navigation across the site. - The
Head
component handles SEO metadata dynamically, making the page easily discoverable by search engines.
This code effectively renders a visually appealing and informative page for encouraging user engagement with the Cilium project.
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph