Fix sitemap

This commit is contained in:
Nemo 2023-06-06 15:22:38 +05:30
parent cdc505e75e
commit df93553a41
3 changed files with 17 additions and 0 deletions

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<title>{{page.title}}</title>
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
{% include header.html %}
</head>
<body>

2
robots.txt Normal file
View File

@ -0,0 +1,2 @@
Sitemap: https://news.tatooine.club/sitemap.xml
User-agent: *

14
sitemap.xml Normal file
View File

@ -0,0 +1,14 @@
---
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% assign pages = site.html_pages | where_exp:'doc','doc.url != "/404.html"' %}
{% for page in pages %}
<url>
<loc>{{ page.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
{% if page.date}<lastmod>{{ page.date | date_to_xmlschema }}</lastmod>{%endif%}
</url>
{% endfor %}
</urlset>