Skip to content

Commit 5e8ed6a

Browse files
authored
feat: add PR link checking workflow, fix links and add fallback to english pages (#2192)
1 parent c262737 commit 5e8ed6a

File tree

831 files changed

+55504
-16679
lines changed

Some content is hidden

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

831 files changed

+55504
-16679
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,36 @@ jobs:
7575
- name: Build Astro site
7676
working-directory: astro
7777
run: npm run build
78+
79+
linkChecker:
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v6
83+
with:
84+
persist-credentials: false
85+
86+
# TODO: use astro action, when pnpm action is enabled in the org
87+
- name: Set up Node.js
88+
uses: actions/setup-node@v6
89+
with:
90+
# node-version-file: ".nvmrc" use when .nvmrc is on root of the repo
91+
node-version: "24.13"
92+
# cache: "npm" use when package-lock.json is on root of the repo
93+
94+
- name: Install Node.js dependencies
95+
working-directory: astro
96+
run: npm ci
97+
98+
- name: Build Astro site
99+
working-directory: astro
100+
run: npm run build
101+
102+
- name: Check links
103+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
104+
with:
105+
workingDirectory: astro # TODO: change when Astro site is moved to root
106+
args: |
107+
--root-dir $PWD/dist
108+
--remap 'https://expressjs\.com\/(.*)/ file://'$PWD'/dist/$1/index.html'
109+
dist/
110+
fail: true

astro/.lycheeignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Prevent rate limit for npmjs links
2+
3+
http://npmjs.com/.*
4+
https://npmjs.com/.*
5+
https://www.npmjs.com/.*
6+
https://npmjs.org/.*
7+
https://www.npmjs.org/.*
8+
9+
# Prevent github rate limit
10+
https://github.com/.*
11+
12+
# Exclude 404 pages
13+
dist/.*/404/index.html$
14+
dist/404/index.html$
15+
16+
# Exclude Open Collective links
17+
https://opencollective.com/.*

astro/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This is the contribution documentation for the [expressjs.com](https://github.com/expressjs/expressjs.com) website.
44

55
> [!NOTE]
6-
> This is not the repo for Express.js framework. To contribute to the _[Express.js framework](https://github.com/expressjs/express)_, check out the [GitHub repo contributing page](https://github.com/expressjs/express?tab=contributing-ov-file) or the website's [Contributing to Express](https://expressjs.com/en/resources/contributing.html) page.
6+
> This is not the repo for Express.js framework. To contribute to the _[Express.js framework](https://github.com/expressjs/express)_, check out the [GitHub repo contributing page](https://github.com/expressjs/express?tab=contributing-ov-file) or the website's [Contributing to Express](https://expressjs.com/en/resources/contributing) page.
77
88
### Common contributions
99

astro/astro.config.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ import mdx from '@astrojs/mdx';
44
import icon from 'astro-icon';
55
import expressiveCode from 'astro-expressive-code';
66

7+
/* https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables */
8+
const NETLIFY_PREVIEW_SITE = process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL;
9+
10+
const site = NETLIFY_PREVIEW_SITE || 'https://expressjs.com';
11+
12+
// TODO: add redirecto for blog posts
13+
714
// https://astro.build/config
815
export default defineConfig({
9-
site: 'https://expressjs.com',
16+
site,
1017
integrations: [
1118
expressiveCode({
1219
themes: ['github-dark'],

astro/eslint.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ import tseslint from 'typescript-eslint';
33
import eslintAstroPlugin from 'eslint-plugin-astro';
44
import jsxA11y from 'eslint-plugin-jsx-a11y';
55
import eslintConfigPrettier from 'eslint-config-prettier';
6+
import globals from 'globals';
7+
import { globalIgnores } from 'eslint/config';
68

79
export default [
810
// Global ignores
11+
globalIgnores(['dist/*', '.astro/*', 'node_modules/*', 'package-lock.json']),
912
{
10-
ignores: ['dist/', '.astro/', 'node_modules/', 'package-lock.json'],
13+
languageOptions: {
14+
globals: {
15+
...globals.browser,
16+
...globals.node,
17+
},
18+
},
1119
},
1220

1321
// Base ESLint recommended rules

0 commit comments

Comments
 (0)