def create_sitemap(app, exception):
 if ((not app.config['html_theme_options'].get('base_url', '')) or (exception is not None) or (not app.sitemap_links)):
  return
 filename = (app.outdir + '/sitemap.xml')
 print ('Generating sitemap.xml in %s' % filename)
 root = ET.Element('urlset')
 root.set('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9')
 for link in app.sitemap_links:
  url = ET.SubElement(root, 'url')
  ET.SubElement(url, 'loc').text = link
 ET.ElementTree(root).write(filename)

def create_sitemap ( app , exception ) : if ( ( not app . config [ 'html_theme_options' ] . get ( 'base_url' , '' ) ) or ( exception is not None ) or ( not app . sitemap_links ) ) : return filename = ( app . outdir + '/sitemap.xml' ) print ( 'Generating sitemap.xml in %s' % filename ) root = ET . Element ( 'urlset' ) root . set ( 'xmlns' , 'http://www.sitemaps.org/schemas/sitemap/0.9' ) for link in app . sitemap_links : url = ET . SubElement ( root , 'url' ) ET . SubElement ( url , 'loc' ) . text = link ET . ElementTree ( root ) . write ( filename )
generates the sitemap .