Skip to content

Commit 0b0613b

Browse files
committed
SEO: ajustar sitemap y robots
1 parent 04a5511 commit 0b0613b

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

robots.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
User-agent: *
2+
Disallow: /tags/
3+
Disallow: /categories/
4+
Disallow: /page
5+
Disallow: /cdn-cgi/
6+
7+
Sitemap: https://hackingepico.com/sitemap.xml

sitemap.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: null
3+
permalink: /sitemap.xml
4+
---
5+
<?xml version="1.0" encoding="UTF-8"?>
6+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
7+
{% for post in site.posts %}
8+
<url>
9+
<loc>{{ site.url }}{{ post.url }}</loc>
10+
<lastmod>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</lastmod>
11+
</url>
12+
{% endfor %}
13+
14+
{% for page in site.pages %}
15+
{% assign url = page.url | replace: '//', '/' %}
16+
{% assign is_paginated = url | slice: 0, 5 %}
17+
{% unless page.sitemap == false %}
18+
{% unless url == "/sitemap.xml" or url == "/robots.txt" or url == "/feed.xml" or url == "/404.html" %}
19+
{% unless url contains "/tags/" or url contains "/categories/" or is_paginated == "/page" %}
20+
<url>
21+
<loc>{{ site.url }}{{ url }}</loc>
22+
{% if page.last_modified_at %}
23+
<lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
24+
{% endif %}
25+
</url>
26+
{% endunless %}
27+
{% endunless %}
28+
{% endunless %}
29+
{% endfor %}
30+
</urlset>

0 commit comments

Comments
 (0)