Skip to content

Commit c85eddb

Browse files
committedMay 27, 2015
and this makes check -l work
1 parent 63e1c5e commit c85eddb

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed
 

Diff for: ‎nikola/plugins/command/check.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def _execute(self, options, args):
164164
existing_targets = set([])
165165
checked_remote_targets = {}
166166

167-
def analyze(self, task, find_sources=False, check_remote=False):
167+
def analyze(self, fname, find_sources=False, check_remote=False):
168168
rv = False
169169
self.whitelist = [re.compile(x) for x in self.site.config['LINK_CHECK_WHITELIST']]
170170
base_url = urlparse(self.site.config['BASE_URL'])
@@ -178,7 +178,7 @@ def analyze(self, task, find_sources=False, check_remote=False):
178178
if url_type in ('absolute', 'full_path'):
179179
url_netloc_to_root = urlparse(self.site.config['BASE_URL']).path
180180
try:
181-
filename = task.split(":")[-1]
181+
filename = fname
182182

183183
if filename.startswith(self.site.config['CACHE_FOLDER']):
184184
# 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):
262262
self.logger.info("===============\n")
263263
self.logger.notice("{0} mode".format(self.site.config['URL_TYPE']))
264264
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):
273270
failure = True
274271
if not failure:
275272
self.logger.info("All links checked.")

0 commit comments

Comments
 (0)
Please sign in to comment.