Skip to content

Commit

Permalink
Forgot rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Apr 15, 2018
1 parent d0bb8b0 commit 5a1ce3a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nikola/plugins/command/check.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):
self.existing_targets.add(self.site.config['SITE_URL']) self.existing_targets.add(self.site.config['SITE_URL'])
self.existing_targets.add(self.site.config['BASE_URL']) self.existing_targets.add(self.site.config['BASE_URL'])
url_type = self.site.config['URL_TYPE'] url_type = self.site.config['URL_TYPE']
feed_extension = self.site.config['FEED_EXTENSION'] atom_extension = self.site.config['ATOM_EXTENSION']


deps = {} deps = {}
if find_sources: if find_sources:
Expand Down Expand Up @@ -220,7 +220,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):
extra_objs.append(lxml.etree.Element('img', src=srcset_item.strip().split(' ')[0])) extra_objs.append(lxml.etree.Element('img', src=srcset_item.strip().split(' ')[0]))
link_elements = list(d.iterlinks()) + list(extra_objs.iterlinks()) link_elements = list(d.iterlinks()) + list(extra_objs.iterlinks())
# Extract links from XML formats to minimal HTML, allowing those to go through the link checks # Extract links from XML formats to minimal HTML, allowing those to go through the link checks
elif feed_extension == filename[-len(feed_extension):]: elif atom_extension == filename[-len(atom_extension):]:
d = lxml.etree.parse(filename) d = lxml.etree.parse(filename)
link_elements = lxml.html.fromstring('<html/>') link_elements = lxml.html.fromstring('<html/>')
for elm in d.findall('*//{http://www.w3.org/2005/Atom}link'): for elm in d.findall('*//{http://www.w3.org/2005/Atom}link'):
Expand Down Expand Up @@ -376,7 +376,7 @@ def scan_links(self, find_sources=False, check_remote=False):
self.logger.debug("===============\n") self.logger.debug("===============\n")
self.logger.debug("{0} mode".format(self.site.config['URL_TYPE'])) self.logger.debug("{0} mode".format(self.site.config['URL_TYPE']))
failure = False failure = False
feed_extension = self.site.config['FEED_EXTENSION'] atom_extension = self.site.config['ATOM_EXTENSION']
# Maybe we should just examine all HTML files # Maybe we should just examine all HTML files
output_folder = self.site.config['OUTPUT_FOLDER'] output_folder = self.site.config['OUTPUT_FOLDER']


Expand All @@ -388,7 +388,7 @@ def scan_links(self, find_sources=False, check_remote=False):
if '.html' == fname[-5:]: if '.html' == fname[-5:]:
if self.analyze(fname, find_sources, check_remote): if self.analyze(fname, find_sources, check_remote):
failure = True failure = True
if feed_extension == fname[-len(feed_extension):]: if atom_extension == fname[-len(atom_extension):]:
if self.analyze(fname, find_sources, False): if self.analyze(fname, find_sources, False):
failure = True failure = True
if fname.endswith('sitemap.xml') or fname.endswith('sitemapindex.xml'): if fname.endswith('sitemap.xml') or fname.endswith('sitemapindex.xml'):
Expand Down

0 comments on commit 5a1ce3a

Please sign in to comment.