Add production var

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

View File

@ -9,6 +9,9 @@
[context.next]
environment = { BASE_URL = "https://next.esphome.io" }
[context.production]
environment = { BASE_URL = "https://esphome.io", PRODUCTION = "YES" }
# A basic redirect rule
[[redirects]]
from = "/esphomeyaml/*"

View File

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