Skip to content

Commit dfab762

Browse files
Copilothotlong
andcommitted
Add lychee.toml config for internal link checking with path remapping
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 022196d commit dfab762

File tree

2 files changed

+65
-4
lines changed

2 files changed

+65
-4
lines changed

.github/workflows/check-links.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ jobs:
2323
- name: Check links with lychee
2424
uses: lycheeverse/lychee-action@v2
2525
with:
26-
# Scan all markdown and MDX files in content directory, plus root README
26+
# Use configuration file for path remapping and settings
2727
args: >-
28-
--verbose
29-
--no-progress
30-
--exclude-file .lycheeignore
28+
--config lychee.toml
3129
'content/**/*.md'
3230
'content/**/*.mdx'
3331
'README.md'

lychee.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Lychee Link Checker Configuration
2+
# This configuration enables checking of internal Fumadocs links by remapping
3+
# Next.js routes to actual file system paths
4+
5+
# Maximum number of concurrent requests
6+
max_concurrency = 10
7+
8+
# Accept status codes (2xx = success)
9+
accept = [200, 204, 206, 301, 302, 307, 308, 429]
10+
11+
# Timeout for requests (in seconds)
12+
timeout = 30
13+
14+
# Retry failed requests
15+
max_retries = 2
16+
17+
# Follow redirects
18+
follow_redirects = true
19+
20+
# Check anchors/fragments in links
21+
include_fragments = false
22+
23+
# Verbose output
24+
verbose = true
25+
26+
# Remap internal documentation links to actual file paths
27+
# Maps /docs/(.+) routes to content/docs/$1.mdx or content/docs/$1.md
28+
[[remap]]
29+
pattern = "^/docs/(.+)$"
30+
replace = "content/docs/$1.mdx"
31+
32+
# Also check for .md files if .mdx doesn't exist
33+
[[remap]]
34+
pattern = "^/docs/(.+)$"
35+
replace = "content/docs/$1.md"
36+
37+
# Exclude patterns (loaded from .lycheeignore file)
38+
exclude_path = [".lycheeignore"]
39+
40+
# Additional exclude patterns for internal paths
41+
exclude = [
42+
# Local development
43+
"http://localhost*",
44+
"http://127.0.0.1*",
45+
46+
# Example/placeholder links
47+
"https://example.com*",
48+
"http://example.com*",
49+
50+
# Social media (prevents anti-bot false positives)
51+
"https://twitter.com*",
52+
"https://x.com*",
53+
54+
# Email links
55+
"mailto:*"
56+
]
57+
58+
# Cache results to speed up subsequent runs
59+
cache = true
60+
61+
# Specify schemes to check (include file:// for local files)
62+
# Leaving this unset allows all schemes including file://
63+
# scheme = ["https", "http", "file"]

0 commit comments

Comments
 (0)