@@ -164,7 +164,7 @@ def _execute(self, options, args):
164
164
existing_targets = set ([])
165
165
checked_remote_targets = {}
166
166
167
- def analyze (self , task , find_sources = False , check_remote = False ):
167
+ def analyze (self , fname , find_sources = False , check_remote = False ):
168
168
rv = False
169
169
self .whitelist = [re .compile (x ) for x in self .site .config ['LINK_CHECK_WHITELIST' ]]
170
170
base_url = urlparse (self .site .config ['BASE_URL' ])
@@ -178,7 +178,7 @@ def analyze(self, task, find_sources=False, check_remote=False):
178
178
if url_type in ('absolute' , 'full_path' ):
179
179
url_netloc_to_root = urlparse (self .site .config ['BASE_URL' ]).path
180
180
try :
181
- filename = task . split ( ":" )[ - 1 ]
181
+ filename = fname
182
182
183
183
if filename .startswith (self .site .config ['CACHE_FOLDER' ]):
184
184
# Do not look at links in the cache, which are not parsed by
@@ -262,14 +262,11 @@ def scan_links(self, find_sources=False, check_remote=False):
262
262
self .logger .info ("===============\n " )
263
263
self .logger .notice ("{0} mode" .format (self .site .config ['URL_TYPE' ]))
264
264
failure = False
265
- for task in _call_nikola_list (self .site ):
266
- task = task .strip ()
267
- if task .split (':' )[0 ] in (
268
- 'render_tags' , 'render_archive' ,
269
- 'render_galleries' , 'render_indexes' ,
270
- 'render_pages' , 'render_posts' ,
271
- 'render_site' ) and '.html' in task :
272
- if self .analyze (task , find_sources , check_remote ):
265
+ # Maybe we should just examine all HTML files
266
+ output_folder = self .site .config ['OUTPUT_FOLDER' ]
267
+ for fname in _call_nikola_list (self .site ):
268
+ if output_folder in fname and '.html' in fname :
269
+ if self .analyze (fname , find_sources , check_remote ):
273
270
failure = True
274
271
if not failure :
275
272
self .logger .info ("All links checked." )
0 commit comments