Update sitemap.py

This commit is contained in:
Otto Winter 2019-02-17 10:37:21 +01:00
parent 942615c34a
commit 837de9c131
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
1 changed files with 5 additions and 2 deletions

View File

@ -39,6 +39,9 @@ def create_sitemap(app, exception):
encoding='utf-8',
method="xml")
if os.getenv('PRODUCTION') != 'YES':
with open(os.path.join(app.builder.outdir, 'robots.txt'), 'wt') as f:
with open(os.path.join(app.builder.outdir, 'robots.txt'), 'wt') as f:
if os.getenv('PRODUCTION') != 'YES':
f.write('User-agent: *\nDisallow: /\n')
else:
f.write('User-agent: *\nDisallow: \n\n'
'Sitemap: https://esphome.io/sitemap.xml\n')