Skip to content

Commit

Permalink
Add production var
Browse files Browse the repository at this point in the history
  • Loading branch information
OttoWinter committed Feb 17, 2019
1 parent d0b408a commit 942615c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"
Expand Down
2 changes: 1 addition & 1 deletion sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit 942615c

Please sign in to comment.