-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathlycheeCheck.ps1
67 lines (54 loc) · 3.23 KB
/
lycheeCheck.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$lycheeReport = normpath (New-TempDir 'lychee' -Prefix:'gdg') 'report.md'
$lychee_args = @(
# '-vv' # Verbose program output
# '--no-progress' # Don't show interactive progress bar while checking links
'-o', $lycheeReport # Path to summary output file
'-f', 'Markdown' # Format
#================================================
# Cache
'--cache' # Enable link caching. This can be helpful to avoid checking the same links on multiple runs
'--max-cache-age', '2d' # Discard all cached requests older than this duration
#================================================
# Runtime
# '--threads' , 2 # Number of threads to utilize. Defaults to number of cores available to the system if omitted
# '--max-redirects' , 10 # Maximum number of allowed redirects
'--max-retries' , 1 # Maximum number of allowed retries before a link is declared dead
'--max-concurrency' , 14 # Maximum number of concurrent link checks
#================================================
# Requests
'--timeout' , 20 # Website timeout from connect to response finished
'--retry-wait-time' , 2 # Minimum wait time in seconds between retries of failed requests
#================================================
# Exclusions
# '--skip-missing' # Skip missing input files (default is to error if they don't exist)
# '--include-verbatim' # Check links inside `<code>` and `<pre>` blocks as well as Markdown code blocks
# '--glob-ignore-case' # Ignore case of paths when matching glob patterns
# '--exclude-all-private' # Exclude all private IPs from checking. Equivalent to setting `exclude-private`, `exclude-link-local`, and `exclude-loopback` to true
# '--exclude-private' # Exclude private IP address ranges from checking
# '--exclude-link-local' # Exclude link-local IP address range from checking
# '--exclude-loopback' # Exclude loopback IP address range and localhost from checking
'--exclude-mail' # Exclude all mail addresses from checking
# '--exclude-path', (@() -join ' ') # Exclude these filesystem paths from getting checked
#================================================
# Base URL or website root directory to check relative URLs
'--base', "file:///$(normpath -TrimEndSep $PSScriptRoot 'docs')/"
# File list
'docs\blog'
'docs\design'
'docs\dev-notes'
'docs\graphics'
'docs\houdini'
'docs\math'
'docs\pkm'
# 'docs\ue4guide'
)
'================================================' | PPHeader
'Lychee Link Checker:' | PPHeader
'------------------------------------------------' | PPHeader
" lychee.exe $($lychee_args -join ' ')" | PPAction
& lychee.exe $lychee_args
'' | PPInfo
" Report: [$lycheeReport]" | PPNote
'================================================' | PPHeader
# $lychee_args -join ' ' | clip
# & lychee.exe -vv --dump $lychee_args