-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathrobots.txt.twig
More file actions
27 lines (25 loc) · 774 Bytes
/
Copy pathrobots.txt.twig
File metadata and controls
27 lines (25 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# all user agents
User-agent: *
# allow all pages
Allow: /
# disallow redirects pages
{% for redirect in site.allpages|filter(p => p.redirect is defined and p.type == 'page') %}
Disallow: {{ url(redirect, {canonical: false}) }}
{% endfor %}
{% if site.pages.404 is defined %}
# disallow 404 page
Disallow: {{ url(site.pages.404, {canonical: false}) }}
{%- if site.pages.404.translations|default({})|length > 0 ~%}
{%- for translation in site.pages.404.translations ~%}
Disallow: {{ url(translation, {canonical: false}) }}
{%- endfor ~%}
{%- endif ~%}
{% endif %}
{% if page.body %}
# custom rules from robots.md page
{{ page.body|raw }}
{% endif %}
{% if site.pages.sitemap is defined %}
# sitemap
Sitemap: {{ url('sitemap', {canonical: true}) }}
{%- endif -%}