mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
generate a robots.txt file that blocks search engines if not prod site (#4919)
This commit is contained in:
parent
39488b0919
commit
06d3f4d0b3
7
Rakefile
7
Rakefile
@ -60,6 +60,13 @@ task :generate do
|
||||
abort("Generating CSS failed") unless success
|
||||
success = system "jekyll build"
|
||||
abort("Generating site failed") unless success
|
||||
if ENV["CONTEXT"] != 'production'
|
||||
File.open("#{public_dir}robots.txt", 'w') do |f|
|
||||
f.write "User-agent: *\n"
|
||||
f.write "Disallow: /\n"
|
||||
end
|
||||
end
|
||||
public_dir
|
||||
end
|
||||
|
||||
desc "Watch the site and regenerate when it changes"
|
||||
|
Loading…
x
Reference in New Issue
Block a user