code: 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")
docs: As each page is built, collect page names for the sitemap