mirror of
https://github.com/torproject/lego.git
synced 2024-11-23 09:39:44 +00:00
Fix error when the robots_txt databag doesn't exist
This commit is contained in:
parent
566e15b971
commit
48ec5a58c3
@ -9,11 +9,13 @@ Disallow: /static/*
|
||||
{#- the '\n' is because we need a newline,
|
||||
but we need to strip trailing and leading whitespace as well.
|
||||
fragile, be careful #}
|
||||
{% for user_agent, directives in bag('robots_txt').items() -%}
|
||||
{{ '\n' }}User-agent: {{ user_agent }}
|
||||
{%- for directive, values in directives.items() -%}
|
||||
{%- for value in values -%}
|
||||
{{ '\n' }}{{ capitalize_first(directive) }}: {{ value -}}
|
||||
{% endfor -%}
|
||||
{% if bag('robots_txt') %}
|
||||
{%- for user_agent, directives in bag('robots_txt').items() -%}
|
||||
{{ '\n' }}User-agent: {{ user_agent }}
|
||||
{%- for directive, values in directives.items() -%}
|
||||
{%- for value in values -%}
|
||||
{{ '\n' }}{{ capitalize_first(directive) }}: {{ value -}}
|
||||
{% endfor -%}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user