Add robots
This commit is contained in:
parent
f0ecde0932
commit
3c5e1cc3c8
10
franca.py
10
franca.py
|
@ -72,6 +72,7 @@ def crater(prod=False):
|
||||||
|
|
||||||
# Load base jinja template
|
# Load base jinja template
|
||||||
base = templates.get_template("base.j2")
|
base = templates.get_template("base.j2")
|
||||||
|
index = templates.get_template("index.j2")
|
||||||
|
|
||||||
# Load translations
|
# Load translations
|
||||||
global translations
|
global translations
|
||||||
|
@ -154,6 +155,15 @@ def crater(prod=False):
|
||||||
|
|
||||||
copy_file('static/logo.svg', 'public/')
|
copy_file('static/logo.svg', 'public/')
|
||||||
copy_file('static/favicon.ico', 'public/')
|
copy_file('static/favicon.ico', 'public/')
|
||||||
|
|
||||||
|
# Write main index.html
|
||||||
|
html = index.render(config=config)
|
||||||
|
write_file('public/index.html', html)
|
||||||
|
# Write robots.txt
|
||||||
|
robots_content = "User-agent: *\nDisallow: /"
|
||||||
|
if config.get('search_engines', None) == "allow":
|
||||||
|
robots_content = robots_content.rstrip("/")
|
||||||
|
write_file('public/robots.txt', robots_content)
|
||||||
|
|
||||||
develop(prod)
|
develop(prod)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue