def add_html_link(app, pagename, templatename, context, doctree):
 base_url = app.config['html_theme_options'].get('base_url', '')
 if base_url:
  app.sitemap_links.append(((base_url + pagename) + '.html'))

def add_html_link ( app , pagename , templatename , context , doctree ) : base_url = app . config [ 'html_theme_options' ] . get ( 'base_url' , '' ) if base_url : app . sitemap_links . append ( ( ( base_url + pagename ) + '.html' ) )
as each page is built .