Fix sitemap script

This commit is contained in:
Otto Winter 2019-02-07 14:19:22 +01:00
parent 15179f6662
commit edeaa4ff34
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
2 changed files with 3 additions and 5 deletions

View File

@ -112,7 +112,7 @@ html_theme = 'alabaster'
# further. For a list of options available for each theme, see the
# documentation.
#
html_baseurl = os.getenv('BASE_URL', 'https://esphomelib.com')
html_baseurl = os.getenv('BASE_URL', 'https://esphome.io/')
html_theme_options = {
# 'logo': 'logo-full.png',
'logo_name': False,

View File

@ -37,13 +37,11 @@ def create_sitemap(app, exception):
for link in app.sitemap_links:
url = ET.SubElement(root, "url")
ET.SubElement(url, "loc").text = app.builder.config.html_baseurl + '/' + link
ET.SubElement(url, "loc").text = app.builder.config.html_baseurl + link
priority = 0.5
if link.endswith('index.html'):
priority += 0.25
if 'api' in link:
priority -= 0.25
if link == 'esphomeyaml/index.html':
if link == 'index.html':
priority = 1.0
ET.SubElement(url, "priority").text = str(priority)