mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +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
|
abort("Generating CSS failed") unless success
|
||||||
success = system "jekyll build"
|
success = system "jekyll build"
|
||||||
abort("Generating site failed") unless success
|
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
|
end
|
||||||
|
|
||||||
desc "Watch the site and regenerate when it changes"
|
desc "Watch the site and regenerate when it changes"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user