From a31c08546db64c098cee98d14fae5883e80bf434 Mon Sep 17 00:00:00 2001
From: Claudio Wunder
Date: Fri, 12 Aug 2022 12:39:24 +0200
Subject: [PATCH 1/7] refactor(content): added displaytitles and organised
pages
---
content/about/about.en.md | 3 ++-
content/about/governance.en.md | 5 +++--
content/about/privacy.en.md | 5 +++--
content/about/releases.en.md | 5 +++--
content/about/resources.en.md | 3 ++-
content/about/security.en.md | 7 ++++---
content/about/trademark.en.md | 5 +++--
content/about/working-groups.en.md | 7 ++++---
content/community/index.md | 3 ++-
content/download/package-manager.en.md | 5 +++--
src/components/SideNavBar/index.tsx | 12 ++++++------
src/components/connectGraphQlArticle.tsx | 3 ++-
src/pages/{ => about}/governance.tsx | 8 +++++---
src/pages/{about.tsx => about/index.tsx} | 8 +++++---
src/pages/{ => about}/privacy.tsx | 8 +++++---
src/pages/{ => about}/releases.tsx | 12 +++++++-----
src/pages/{ => about}/security.tsx | 8 +++++---
src/pages/{ => about}/trademark.tsx | 8 +++++---
src/pages/{ => about}/working-groups.tsx | 8 +++++---
src/pages/community.tsx | 2 ++
src/pages/download/package-manager.tsx | 2 ++
src/pages/{resources.tsx => resources/index.tsx} | 8 +++++---
src/types/index.ts | 1 +
23 files changed, 84 insertions(+), 52 deletions(-)
rename src/pages/{ => about}/governance.tsx (76%)
rename src/pages/{about.tsx => about/index.tsx} (75%)
rename src/pages/{ => about}/privacy.tsx (76%)
rename src/pages/{ => about}/releases.tsx (77%)
rename src/pages/{ => about}/security.tsx (76%)
rename src/pages/{ => about}/trademark.tsx (77%)
rename src/pages/{ => about}/working-groups.tsx (76%)
rename src/pages/{resources.tsx => resources/index.tsx} (76%)
diff --git a/content/about/about.en.md b/content/about/about.en.md
index 36a6350bfd..a3fdcba346 100644
--- a/content/about/about.en.md
+++ b/content/about/about.en.md
@@ -1,5 +1,6 @@
---
-title: About
+title: about
+displayTitle: About
description: "About | Node.js"
authors: XhmikosR, mikeal, fhemberger, Fishrock123, yous, tomgco, tniessen, SMcCandlish, saadq, Trott, Gornstats, piperchester, naoufal, lpinca, j9t, bnoordhuis, harshadsabne, Chris911, benhalverson
category: about
diff --git a/content/about/governance.en.md b/content/about/governance.en.md
index 56adb719a9..1ecbb43100 100644
--- a/content/about/governance.en.md
+++ b/content/about/governance.en.md
@@ -1,8 +1,9 @@
---
-title: Governance
+title: governance
+displayTitle: Governance
description: 'Project Governance | Node.js'
authors: XhmikosR, fhemberger, thefourtheye, ryanmurakami, refack
-category: governance
+category: about
---
## Consensus Seeking Process
diff --git a/content/about/privacy.en.md b/content/about/privacy.en.md
index 06a0fed898..2051744c06 100644
--- a/content/about/privacy.en.md
+++ b/content/about/privacy.en.md
@@ -1,8 +1,9 @@
---
-title: Privacy Policy
+title: privacy-policy
+displayTitle: Privacy Policy
description: 'Privacy Policy | Node.js'
authors: XhmikosR, nschonni, brianwarner, hackygolucky, sindelio, sonicdoe, marsonya
-category: privacy
+category: about
---
Effective Date: November 21, 2019
diff --git a/content/about/releases.en.md b/content/about/releases.en.md
index f992ab8cc7..31012f66ff 100644
--- a/content/about/releases.en.md
+++ b/content/about/releases.en.md
@@ -1,8 +1,9 @@
---
-title: Releases
+title: releases
+displayTitle: Releases
description: "Releases | Node.js"
authors: ZYSzys, nstanard, mikeal, fhemberger, garybernhardt, piepmatz, boneskull, bjb568
-category: releases
+category: about
---
Major Node.js versions enter _Current_ release status for six months, which gives library authors time to add support for them.
diff --git a/content/about/resources.en.md b/content/about/resources.en.md
index 441765af67..f773bedade 100644
--- a/content/about/resources.en.md
+++ b/content/about/resources.en.md
@@ -1,5 +1,6 @@
---
-title: Resources
+title: resources
+displayTitle: Resources
description: 'Resources | Node.js'
authors: XhmikosR, mikeal, fhemberger, Fishrock123, yous, tomgco, tniessen, SMcCandlish, saadq, Trott, Gornstats, piperchester, naoufal, lpinca, j9t, bnoordhuis, harshadsabne, Chris911, MrJithil
category: about
diff --git a/content/about/security.en.md b/content/about/security.en.md
index 155ea3b417..cebff8598e 100644
--- a/content/about/security.en.md
+++ b/content/about/security.en.md
@@ -1,8 +1,9 @@
---
-title: Security
-description: 'This is security page'
+title: security
+displayTitle: Security
+description: "Security | Node.js"
authors: reedloden,XhmikosR,Trott,fhemberger,MaledongGit,yous,sam-github,vdeturckheim,tniessen,richardlau,nschonni,mikeal,e-jigsaw,parthlaw
-category: security
+category: about
---
## Reporting a Bug in Node.js
diff --git a/content/about/trademark.en.md b/content/about/trademark.en.md
index 2ef07379fc..726b5321ee 100644
--- a/content/about/trademark.en.md
+++ b/content/about/trademark.en.md
@@ -1,8 +1,9 @@
---
-title: Trademark Policy
+title: trademark-policy
+displayTitle: Trademark Policy
description: "Trademark Policy | Node.js"
authors: fhemberger, XhmikosR, mikeal, brianwarner, bf4
-category: trademark
+category: about
---
The Node.js trademarks, service marks, and graphics marks are symbols of the
diff --git a/content/about/working-groups.en.md b/content/about/working-groups.en.md
index 464665c8b9..54d044c196 100644
--- a/content/about/working-groups.en.md
+++ b/content/about/working-groups.en.md
@@ -1,8 +1,9 @@
---
-title: Working Groups
-description: "Working Groups| Node.js"
+title: working-groups
+displayTitle: Working Groups
+description: "Working Groups | Node.js"
authors: williamkapke,Trott,fhemberger,rxmarbles,mhdawson,XhmikosR,ryanmurakami,outsideris,MaledongGit,vsemozhetbyt,wonderdogone,sotayamashita,richardlau,pierreneter,nschonni,marocchino,stevemao,lpinca,phillipj,jasnell,sejaljain123
-category: working-groups
+category: about
---
Core Working Groups are created by the
diff --git a/content/community/index.md b/content/community/index.md
index ea84635275..e114239f1f 100644
--- a/content/community/index.md
+++ b/content/community/index.md
@@ -1,5 +1,6 @@
---
-title: Node.js Community
+title: node.js-community
+displayTitle: Node.js Community
description: "Node.js has one of the largest, most vibrant and innovative open source communities in the world. Node.js is built, used, and maintained by the community. We believe the community to be at the core of Node.js popularity. Amazing people from every part of the world, with a common interest, collaborate and shape this community."
authors: ahmadawais, maedahbatool, saqibameen, msaaddev
category: community
diff --git a/content/download/package-manager.en.md b/content/download/package-manager.en.md
index 4b7966a21c..7babcde958 100644
--- a/content/download/package-manager.en.md
+++ b/content/download/package-manager.en.md
@@ -1,6 +1,7 @@
---
-title: Installing Node.js via package manager
-description: Installing Node.js via package manager
+title: installing-node.js-via-package-manager
+displayTitle: Installing Node.js via Package Manager
+description: "Installing Node.js via Package Manager | Node.js"
authors: fhemberger, XhmikosR, shadowspawn, vsemozhetbyt, nschonni, wildcard, MrJithil, kasicka, cassidyjames, Trott, richardlau, Qantas94Heavy, pierreneter, 0mp, ThePrez, PoojaDurgad, MaledongGit, Megajin, marc-maurer, yodeyer, geek, sudowork, strawbrary, ryanmurakami, rbnswartz, arkwright, oliversalzburg, mweagle, Mohamed3on, Ginden, kapouer, jperkin, jericopulvera, jedsmith, jasonkarns, sonicdoe, mcollina, fornwall, danbev, naskapal, awochna, AdamMajer, ahmetanilgur, bnb, qbit
category: download
---
diff --git a/src/components/SideNavBar/index.tsx b/src/components/SideNavBar/index.tsx
index b58b9006ca..59c5c52c46 100644
--- a/src/components/SideNavBar/index.tsx
+++ b/src/components/SideNavBar/index.tsx
@@ -6,14 +6,14 @@ import '../../styles/about.scss';
// eslint-disable-next-line no-shadow
export enum SideNavBarKeys {
about = 'about',
- governance = 'governance',
+ governance = 'about/governance',
community = 'community',
- workingGroups = 'working-groups',
- releases = 'releases',
+ workingGroups = 'about/working-groups',
+ releases = 'about/releases',
resources = 'resources',
- trademark = 'trademark',
- privacy = 'privacy',
- security = 'security',
+ trademark = 'about/trademark',
+ privacy = 'about/privacy',
+ security = 'about/security',
packageManager = 'download/package-manager',
}
diff --git a/src/components/connectGraphQlArticle.tsx b/src/components/connectGraphQlArticle.tsx
index b029632c6e..5c729d84c8 100644
--- a/src/components/connectGraphQlArticle.tsx
+++ b/src/components/connectGraphQlArticle.tsx
@@ -79,6 +79,7 @@ const connectGraphQlArticle = (
const articleLayoutProps = {
title: article.frontmatter.title,
+ displayTitle: article.frontmatter.displayTitle,
description: article.frontmatter.description,
authors: article.fields.authors,
body: article.body,
@@ -96,7 +97,7 @@ const connectGraphQlArticle = (
return (
Date: Fri, 12 Aug 2022 12:43:37 +0200
Subject: [PATCH 2/7] refactor(contributor): move random contributor to be
optional per page
---
src/components/Footer/index.tsx | 148 +++++++++++++++-----------------
src/components/Layout/index.tsx | 8 ++
src/pages/index.tsx | 2 +-
3 files changed, 80 insertions(+), 78 deletions(-)
diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx
index 47a6be7d63..46809b3cd1 100644
--- a/src/components/Footer/index.tsx
+++ b/src/components/Footer/index.tsx
@@ -1,6 +1,5 @@
import { LocalizedLink as Link } from 'gatsby-theme-i18n';
import React from 'react';
-import RandomContributor from '../RandomContributor';
import { ReactComponent as GitHubLogo } from '../../images/logos/github-logo.svg';
import { ReactComponent as TwitterLogo } from '../../images/logos/twitter-logo.svg';
import { ReactComponent as SlackLogo } from '../../images/logos/slack-logo.svg';
@@ -14,82 +13,77 @@ export interface DropDownState {
const Footer = (): JSX.Element => {
return (
- <>
-
-
- >
+
);
};
diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx
index e971fcc273..de0c76243a 100644
--- a/src/components/Layout/index.tsx
+++ b/src/components/Layout/index.tsx
@@ -3,6 +3,7 @@ import 'prismjs/themes/prism-okaidia.css';
import React from 'react';
import { MotionConfig } from 'framer-motion';
+import RandomContributor from '../RandomContributor';
import { FeatureToggleProvider } from '../FeatureToggleProvider';
import Header from '../Header';
@@ -20,6 +21,7 @@ interface Props {
img?: string;
href?: string;
showFooter?: boolean;
+ showRandomContributor?: boolean;
}
const Layout = ({
@@ -28,6 +30,7 @@ const Layout = ({
description,
img,
showFooter = true,
+ showRandomContributor = false,
}: Props): JSX.Element => (
@@ -35,6 +38,11 @@ const Layout = ({
{children}
+ {showRandomContributor && (
+
+ )}
{showFooter && }
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 9917f8f08b..1ac3b6adb9 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -68,7 +68,7 @@ const Index = ({
banners: { bannersIndex },
},
}: HomepageProps): JSX.Element => (
-
+
Date: Fri, 12 Aug 2022 12:54:11 +0200
Subject: [PATCH 3/7] chore(tests): updated tests and added tsconfig for tests
---
.../__snapshots__/footer.test.tsx.snap | 7 -----
.../centered-layout.test.tsx.snap | 7 -----
.../__snapshots__/page-layout.test.tsx.snap | 7 -----
test/components/SideNavBar.test.tsx | 16 ++++++----
.../__snapshots__/SideNavBar.test.tsx.snap | 24 +++++++-------
test/pages/__snapshots__/404.test.tsx.snap | 7 -----
test/pages/__snapshots__/about.test.tsx.snap | 31 +++++++------------
test/pages/__snapshots__/blog.test.tsx.snap | 14 ---------
.../__snapshots__/community.test.tsx.snap | 31 +++++++------------
.../__snapshots__/governance.test.tsx.snap | 31 +++++++------------
.../pages/__snapshots__/privacy.test.tsx.snap | 31 +++++++------------
.../__snapshots__/releases.test.tsx.snap | 31 +++++++------------
.../__snapshots__/resources.test.tsx.snap | 31 +++++++------------
.../__snapshots__/security.test.tsx.snap | 31 +++++++------------
.../__snapshots__/trademark.test.tsx.snap | 31 +++++++------------
.../working-groups.test.tsx.snap | 31 +++++++------------
.../__snapshots__/index.test.tsx.snap | 14 ---------
.../package-manager.test.tsx.snap | 31 +++++++------------
test/pages/governance.test.tsx | 2 +-
test/pages/privacy.test.tsx | 2 +-
test/pages/releases.test.tsx | 4 ++-
test/pages/security.test.tsx | 2 +-
test/pages/trademark.test.tsx | 2 +-
test/pages/working-groups.test.tsx | 2 +-
.../__snapshots__/blog.test.tsx.snap | 7 -----
.../__snapshots__/learn.test.tsx.snap | 7 -----
test/tsconfig.json | 4 +++
27 files changed, 154 insertions(+), 284 deletions(-)
create mode 100644 test/tsconfig.json
diff --git a/src/components/Footer/__tests__/__snapshots__/footer.test.tsx.snap b/src/components/Footer/__tests__/__snapshots__/footer.test.tsx.snap
index 889e8cf375..4b47af343b 100644
--- a/src/components/Footer/__tests__/__snapshots__/footer.test.tsx.snap
+++ b/src/components/Footer/__tests__/__snapshots__/footer.test.tsx.snap
@@ -2,13 +2,6 @@
exports[`Tests for Footer component renders correctly 1`] = `
-
-