Skip to content

Commit fdb3c68

Browse files
committed
Link check sources as well
1 parent eb44275 commit fdb3c68

File tree

3 files changed

+16
-25
lines changed

3 files changed

+16
-25
lines changed

.github/workflows/check-pr-links.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,12 @@ jobs:
99
linkChecker:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Clone repository
13-
uses: actions/checkout@v5
14-
with:
15-
fetch-depth: 0
16-
17-
- name: Setup Node.js
18-
uses: actions/setup-node@v6
19-
with:
20-
node-version: "20"
12+
- uses: actions/checkout@v5
2113

22-
- name: Setup pnpm
23-
uses: pnpm/action-setup@v4
14+
- name: Build site
15+
uses: withastro/action@v5
2416
with:
25-
version: latest
26-
27-
- name: Install dependencies for feature branch
28-
run: pnpm install --frozen-lockfile
29-
30-
- name: Build site from feature branch
31-
run: pnpm build
17+
package-manager: pnpm@latest
3218

3319
- name: Check links
3420
uses: lycheeverse/lychee-action@v2
@@ -38,7 +24,8 @@ jobs:
3824
--root-dir $PWD/dist
3925
--exclude-all-private
4026
--remap 'https://lychee\.cli\.rs/(.*)/ file://'$PWD'/dist/$1/index.html'
41-
dist
27+
dist/
28+
src/
4229
fail: true
4330

4431
- name: Suggestions

.lycheeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ https://www.nongnu.org/atool
77

88
# 404 page is directly in dist/404.html but we've remapped it to an invalid path
99
dist/404/index.html$
10+
11+
# Code examples in base-url.mdx which don't exist
12+
/docs/about.php$
13+
/docs/recipes/guide.php$

src/content/docs/recipes/base-url.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ Here's what happens to different types of links:
6666

6767
<Code
6868
code={`<!-- Original links -->
69-
<a href="./guide.html">Guide</a>
70-
<a href="../about.html">About</a>
71-
<a href="https://other.com">External</a>
69+
<a href="./guide.php">Guide</a>
70+
<a href="../about.php">About</a>
71+
<a href="https://example.com">Absolute</a>
7272
7373
<!-- After --base-url https://example.com/docs/ -->
7474
75-
<a href="https://example.com/docs/guide.html">Guide</a>
76-
<a href="https://example.com/about.html">About</a>
77-
<a href="https://other.com">External</a>`} lang={fileLang}
75+
<a href="https://example.com/docs/guide.php">Guide</a>
76+
<a href="https://example.com/about.php">About</a>
77+
<a href="https://example.com">Absolute</a>`} lang={fileLang}
7878
title="Link Resolution Example" />
7979

8080
## Common Use Cases

0 commit comments

Comments
 (0)