Fix sitemap script
This commit is contained in:
parent
15179f6662
commit
edeaa4ff34
2
conf.py
2
conf.py
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue