mirror of
https://github.com/torproject/lego.git
synced 2024-11-23 01:29:45 +00:00
Add an extensible template for robots.txt
This commit is contained in:
parent
bac729086c
commit
2f5127ae74
5
content/robots.txt/contents.lr
Normal file
5
content/robots.txt/contents.lr
Normal file
@ -0,0 +1,5 @@
|
||||
_template: robots.txt
|
||||
---
|
||||
_discoverable: no
|
||||
---
|
||||
_model: none
|
19
templates/robots.txt
Normal file
19
templates/robots.txt
Normal file
@ -0,0 +1,19 @@
|
||||
{%- macro capitalize_first(text) -%}
|
||||
{{- text[0].upper() -}}{{- text[1:] -}}
|
||||
{%- endmacro -%}
|
||||
User-agent: *
|
||||
Disallow: /javascript/*
|
||||
Disallow: /scss/*
|
||||
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 -%}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user