@@ -26,7 +26,12 @@ import warmServer from '@/frame/lib/warm-server'
2626import { renderContent } from '@/content-render/index'
2727import { allVersions , allVersionKeys } from '@/versions/lib/all-versions'
2828import languages from '@/languages/lib/languages-server'
29- import { normalizeLinkPath , checkInternalLink } from '@/links/lib/extract-links'
29+ import {
30+ normalizeLinkPath ,
31+ checkInternalLink ,
32+ checkAssetLink ,
33+ isAssetLink ,
34+ } from '@/links/lib/extract-links'
3035import {
3136 type BrokenLink ,
3237 generateInternalLinkReport ,
@@ -183,6 +188,19 @@ async function checkVersion(
183188 for ( const link of links ) {
184189 if ( isExcludedLink ( link . href ) ) continue
185190
191+ // Check if this is an asset link (images, etc.) - verify file exists on disk
192+ if ( isAssetLink ( link . href ) ) {
193+ if ( ! checkAssetLink ( link . href ) ) {
194+ brokenLinks . push ( {
195+ href : link . href ,
196+ file : page . relativePath ,
197+ lines : [ 0 ] ,
198+ text : link . text ,
199+ } )
200+ }
201+ continue
202+ }
203+
186204 const normalized = normalizeLinkPath ( link . href )
187205 const result = checkInternalLink ( normalized , pageMap , redirects )
188206
@@ -346,10 +364,14 @@ async function main() {
346364 console . log ( `Created report issue: ${ newReport . html_url } ` )
347365 }
348366
349- // Exit with error if broken links found
350- if ( result . brokenLinks . length > 0 ) {
351- process . exit ( 1 )
352- }
367+ // Don't exit with error - the issue report is the mechanism for docs-content to act on broken links
368+ // Exiting with error would trigger docs-alerts which only engineering monitors
369+ console . log ( '' )
370+ console . log (
371+ chalk . yellow (
372+ 'Note: Report generated. Broken links should be fixed via the issue created in docs-content.' ,
373+ ) ,
374+ )
353375}
354376
355377// Run if invoked directly
0 commit comments