Skip to content

Commit 2dc6293

Browse files
major: full dynamic pages and plain next.js (nodejs#5426)
* feat: introduce dynamic rendering of pages * major: full dynamic pages and plain next.js (#2) * chore: do not resort blog posts * fix: sort by post date * chore: apply code-review changes Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com> Signed-off-by: Claudio Wunder <cwunder@gnome.org> * chore: some code review changes --------- Signed-off-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>
1 parent 6e33513 commit 2dc6293

Some content is hidden

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

73 files changed

+1418
-2400
lines changed

.github/ISSUE_TEMPLATE/01-bug-report.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Report a Technical/Visual Issue on the Node.js Website
2-
description: "Is something not working as expected? Did you encounter a glitch or a bug with the Website?"
2+
description: 'Is something not working as expected? Did you encounter a glitch or a bug with the Website?'
33
labels: [bug]
44
body:
55
- type: markdown
@@ -11,36 +11,36 @@ body:
1111
for us to fix it when you attach a screenshot as well.
1212
- type: input
1313
attributes:
14-
label: "URL:"
14+
label: 'URL:'
1515
description: The URL of the page you are reporting an issue on.
1616
placeholder: https://nodejs.org/en/
1717
validations:
1818
required: true
1919
- type: input
2020
attributes:
21-
label: "Browser Name:"
21+
label: 'Browser Name:'
2222
description: What kind of browser are you using?
2323
placeholder: Chrome
2424
validations:
2525
required: true
2626
- type: input
2727
attributes:
28-
label: "Browser Version:"
28+
label: 'Browser Version:'
2929
description: What version of browser are you using?
30-
placeholder: "103.0.5060.134"
30+
placeholder: '103.0.5060.134'
3131
validations:
3232
required: true
3333
- type: input
3434
attributes:
35-
label: "Operating System:"
35+
label: 'Operating System:'
3636
description: What kind of operation system are you using
3737
(Write it in full, with version number)?
38-
placeholder: "Windows 10, 21H2, 19044.1826"
38+
placeholder: 'Windows 10, 21H2, 19044.1826'
3939
validations:
4040
required: true
4141
- type: textarea
4242
attributes:
43-
label: "How to reproduce the issue:"
43+
label: 'How to reproduce the issue:'
4444
placeholder: |
4545
1. What I did.
4646
2. What I expected to happen.

.github/ISSUE_TEMPLATE/02-feature-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Suggest a new feature or improvement for the Node.js Website
2-
description: "Do you have an idea or a suggestion and you want to share?"
2+
description: 'Do you have an idea or a suggestion and you want to share?'
33
labels: [feature request]
44
body:
55
- type: markdown

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ blank_issues_enabled: true
22
contact_links:
33
- name: Report an API Docs Issue on the Node.js Website
44
url: https://github.com/nodejs/node/issues/new?assignees=&labels=doc&template=3-api-ref-docs-problem.yml
5-
about: "Is something wrong with the API Docs? Did you face a bug with the API Docs?"
5+
about: 'Is something wrong with the API Docs? Did you face a bug with the API Docs?'
66
- name: Report a Translation Issue on the Node.js Website
77
url: https://crowdin.com/project/nodejs-website
8-
about: "Is something wrong in a specific translation? Do you believe a language can get improved? Do you have suggestions?"
8+
about: 'Is something wrong in a specific translation? Do you believe a language can get improved? Do you have suggestions?'
99
- name: Need help with Node.js?
1010
url: https://github.com/nodejs/help/issues/
1111
about: "Struggling with Node.js? You're not sure how to code?"

.github/workflows/pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
os: [ubuntu-latest, windows-latest]
6161

6262
steps:
63-
- name: "Use GNU tar instead BSD tar"
63+
- name: 'Use GNU tar instead BSD tar'
6464
if: matrix.os == 'windows-latest'
6565
shell: cmd
6666
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
@@ -122,7 +122,7 @@ jobs:
122122
os: [ubuntu-latest, windows-latest]
123123

124124
steps:
125-
- name: "Use GNU tar instead BSD tar"
125+
- name: 'Use GNU tar instead BSD tar'
126126
if: matrix.os == 'windows-latest'
127127
shell: cmd
128128
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ build
1616
public/robots.txt
1717
public/sitemap.xml
1818
public/en/feed/*.xml
19-
pages/en/blog/year-[0-9][0-9][0-9][0-9].md
2019

2120
# Jest
2221
coverage

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
DIR=$(cd `dirname $0` && pwd -P)
55

6+
# resets the node release data file
67
echo "[]" > $DIR/../public/node-releases-data.json
78

9+
# resets the blog post data file
10+
echo "{\"pagination\": [],\"categories\": [],\"posts\": []}" > $DIR/../public/blog-posts-data.json
11+
12+
# adds these changes to be part of the current commit
813
git add --sparse $DIR/../public/node-releases-data.json
14+
git add --sparse $DIR/../public/blog-posts-data.json

.storybook/preview.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type { Preview } from '@storybook/react';
22
import NextImage from 'next/image';
3-
import { ThemeProvider } from 'next-themes';
4-
import { NodeReleasesProvider } from '../providers/nodeReleasesProvider';
5-
import { LocaleProvider } from '../providers/localeProvider';
63
import { openSans } from '../util/nextFonts';
7-
import BaseApp, { setAppFont } from '../next.app';
4+
import BaseApp, { setAppFonts } from '../next.app';
85

96
import '../styles/index.scss';
107

@@ -26,20 +23,14 @@ const preview: Preview = {
2623
},
2724
};
2825

29-
setAppFont(openSans.style.fontFamily);
26+
setAppFonts([openSans.style.fontFamily]);
3027

3128
export const decorators = [
3229
Story => (
3330
<BaseApp>
34-
<ThemeProvider>
35-
<LocaleProvider>
36-
<NodeReleasesProvider>
37-
<div data-test-id="story-root">
38-
<Story />
39-
</div>
40-
</NodeReleasesProvider>
41-
</LocaleProvider>
42-
</ThemeProvider>
31+
<div data-test-id="story-root">
32+
<Story />
33+
</div>
4334
</BaseApp>
4435
),
4536
];

COLLABORATOR_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,4 @@ export default { component: NameOfComponent } as Meta;
235235
[`react-intl`]: https://formatjs.io/docs/react-intl/
236236
[Next.js]: https://nextjs.org/
237237
[MDX]: https://mdxjs.com/
238-
[SCSS]: https://sass-lang.com/
238+
[SCSS]: https://sass-lang.com/

CONTRIBUTING.md

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,22 @@ Note that regular contributors do not need to become "Collaborators". Any contri
3232
is a formality that comes with obligations.
3333

3434
If you're an active contributor seeking to become a member we recommend reaching out to one of the existing Team Members for guidance.
35-
35+
3636
<details>
3737
<summary><b>What's the process for becoming a Collaborator?</b></summary>
3838

39-
- You must be actively contributing to this repository.
40-
- Contributions must include significant code reviews or code contributions.
41-
- A nomination must be done by an existing Team Member of the Website Team with an Issue
42-
- The Issue must explain and describe why the nominated person is a good addition to the team
43-
- The Issue must contain links to relevant contributions through:
44-
- Code Reviews
45-
- Comments on Issues and PRs
46-
- Authoring of PRs or Issues
47-
- Comments or Authoring of Discussions
48-
- The nomination must have at least 3 existing members of the Website Team to be in agreement with the nomination.
49-
- This can be done through commenting with "agreement" (showing support) or reacting to the Issue with a :+1: (Thumbs-up Emoji)
50-
- The Issue must be open for at least 72 hours without an objection from an existing member of the Website Team
51-
- The nomination cannot pass until all open discordances/objections are resolved.
52-
- Objections coming from the TSC or Core Collaborators are also counted as valid objections.
39+
- You must be actively contributing to this repository.
40+
- Contributions must include significant code reviews or code contributions.
41+
- A nomination must be done by an existing Team Member of the Website Team with an Issue
42+
- The Issue must explain and describe why the nominated person is a good addition to the team
43+
- The Issue must contain links to relevant contributions through:
44+
- Code Reviews
45+
- Comments on Issues and PRs
46+
- Authoring of PRs or Issues
47+
- Comments or Authoring of Discussions
48+
- The nomination must have at least 3 existing members of the Website Team to be in agreement with the nomination.
49+
- This can be done through commenting with "agreement" (showing support) or reacting to the Issue with a :+1: (Thumbs-up Emoji)
50+
- The Issue must be open for at least 72 hours without an objection from an existing member of the Website Team - The nomination cannot pass until all open discordances/objections are resolved. - Objections coming from the TSC or Core Collaborators are also counted as valid objections.
5351
</details>
5452

5553
# Getting started
@@ -60,60 +58,60 @@ for getting things done and landing your contribution.
6058
1. Click the fork button in the top right to clone the [nodejs.org repository](https://github.com/nodejs/nodejs.org/fork)
6159
2. Clone your fork using SSH, GitHub CLI, or HTTPS.
6260

63-
```bash
64-
git clone git@github.com:<YOUR_GITHUB_USERNAME>/nodejs.org.git # SSH
65-
git clone https://github.com/<GITHUB_ID>/nodejs.org.git # HTTPS
66-
gh repo clone <GITHUB_ID>/nodejs.org # GitHub CLI
67-
```
61+
```bash
62+
git clone git@github.com:<YOUR_GITHUB_USERNAME>/nodejs.org.git # SSH
63+
git clone https://github.com/<YOUR_GITHUB_USERNAME>/nodejs.org.git # HTTPS
64+
gh repo clone <YOUR_GITHUB_USERNAME>/nodejs.org # GitHub CLI
65+
```
6866

6967
3. Change into the nodejs.org directory.
7068

71-
```bash
72-
cd nodejs.org
73-
```
69+
```bash
70+
cd nodejs.org
71+
```
7472

7573
4. Create a remote for keeping your fork as well as your local clone up-to-date.
7674

77-
```bash
78-
git remote add upstream git@github.com:nodejs/nodejs.org.git # SSH
79-
git remote add upstream https://github.com/nodejs/nodejs.org.git # HTTPS
80-
gh repo sync nodejs/nodejs.org # GitHub CLI
81-
```
75+
```bash
76+
git remote add upstream git@github.com:nodejs/nodejs.org.git # SSH
77+
git remote add upstream https://github.com/nodejs/nodejs.org.git # HTTPS
78+
gh repo sync nodejs/nodejs.org # GitHub CLI
79+
```
8280

8381
5. Create a new branch for your work.
8482

85-
```bash
86-
git checkout -b name-of-your-branch
87-
```
83+
```bash
84+
git checkout -b name-of-your-branch
85+
```
8886

8987
6. Run the following to install the dependencies and start a local preview of your work.
9088

91-
```bash
92-
npm ci # installs this project's dependencies
93-
npx turbo serve # starts a preview of your local changes
94-
```
89+
```bash
90+
npm ci # installs this project's dependencies
91+
npx turbo serve # starts a preview of your local changes
92+
```
9593

9694
7. Perform a merge to sync your current branch with the upstream branch.
9795

98-
```bash
99-
git fetch upstream
100-
git merge upstream/main
101-
```
96+
```bash
97+
git fetch upstream
98+
git merge upstream/main
99+
```
102100

103101
8. Run `npx turbo format` to confirm that linting, and formatting are passing.
104102

105-
```bash
106-
npx turbo format
107-
```
103+
```bash
104+
npx turbo format
105+
```
108106

109-
9. Once you're happy with your changes, add and commit them to your branch, then push the branch to your fork.
107+
9. Once you're happy with your changes, add and commit them to your branch, then push the branch to your fork.
110108

111-
```bash
112-
cd ~/nodejs.org
113-
git add .
114-
git commit -m "some message"
115-
git push -u origin name-of-your-branch
116-
```
109+
```bash
110+
cd ~/nodejs.org
111+
git add .
112+
git commit -m "some message"
113+
git push -u origin name-of-your-branch
114+
```
117115

118116
10. Create a Pull Request.
119117

@@ -126,12 +124,12 @@ This repository contains several scripts and commands for performing numerous ta
126124
<details>
127125
<summary>Commands for Running & Building the Website</summary>
128126

129-
- `npx turbo serve` runs Next.js's Local Development Server, listening by default on `http://localhost:3000/`.
130-
- `npx turbo build` builds the Application on Production mode. The output is by default within `.next` folder.
131-
- This is used for the Node.js Vercel Deployments (Preview & Production)
132-
- `npx turbo deploy` builds the Application on Export Production Mode. The output is by default within `build` folder.
133-
- This is used for the Node.js Legacy Website Server (DigitalOcean)
134-
- `npx turbo start` starts a web server running serving the built content from `npx turbo build`
127+
- `npx turbo serve` runs Next.js's Local Development Server, listening by default on `http://localhost:3000/`.
128+
- `npx turbo build` builds the Application on Production mode. The output is by default within `.next` folder.
129+
- This is used for the Node.js Vercel Deployments (Preview & Production)
130+
- `npx turbo deploy` builds the Application on Export Production Mode. The output is by default within `build` folder.
131+
- This is used for the Node.js Legacy Website Server (DigitalOcean)
132+
- `npx turbo start` starts a web server running serving the built content from `npx turbo build`
135133
</details>
136134

137135
<details>
@@ -186,7 +184,7 @@ We recommend a read on our [Collaborator Guide](COLLABORATOR_GUIDE.md#accepting-
186184
- The person that is fast-tracking the PR (adding the label) must also comment on the PR that they're requesting the PR to be fast-tracked
187185
- The comment must mention `@nodejs/website` and must have at least one 👍 (or any other sort of approval reaction) if the person fast-tracking the PR is the author of the PR.
188186
- Fast-tracking is only allowed for small bug fixes, small feature changes, localisation changes, or other sorts of non-critical/highly-impacting changes that are not covered by the previous rule that allows PRs to be merged immediately.
189-
- Fast-tracking cannot be used for updates on the `COLLABORATOR_GUIDE.md`, CONTRIBUTING.md` guide, `CODEOWNERS`, GitHub Actions or any security-impacting file or document that changes the governing policies of this repository.
187+
- Fast-tracking cannot be used for updates on the `COLLABORATOR_GUIDE.md`, `CONTRIBUTING.md` guide, `CODEOWNERS`, GitHub Actions, or any security-impacting file or document that changes the governing policies of this repository.
190188
- There must be no objections after a 48-hour period (Or 72 hours if the PR was authored on the weekend).
191189
- At least one approval is required for any PR to be merged.
192190
- Tests must be included in Pull Requests for new features or bug fixes. If any test(s) are failing, you are responsible for fixing them.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</p>
1010

1111
<p align="center">
12-
<a href="https://nodejs.org">nodejs.org</a> website built using Nextra (Next.js) with TypeScript, SCSS and MDXv2
12+
<a href="https://nodejs.org">nodejs.org</a> website built using Next.js with TypeScript, SCSS and MDXv2
1313
</p>
1414

1515
<p align="center">
@@ -31,7 +31,7 @@
3131

3232
## What is this repo?
3333

34-
[Nodejs.org](https://nodejs.org/) by the [OpenJS Foundation](https://openjsf.org/) is the official website for the Node.js® JavaScript runtime. This repo is the source code for the website. It is build using [Nextra](https://nextra.site), a Next.js based static site generator.
34+
[Nodejs.org](https://nodejs.org/) by the [OpenJS Foundation](https://openjsf.org/) is the official website for the Node.js® JavaScript runtime. This repo is the source code for the website. It is build using [Next.js](https://nextjs.org) a React Framework.
3535

3636
### Quick-Start Locally
3737

0 commit comments

Comments
 (0)