首页 > 解决方案 > 无法为 Google 创建有效的 sitemap.xml 文件

问题描述

我正在使用 Hugo 生成我的网站,并通过将其放置在 layouts/sitemap.xml 中来手动添加 sitemap.xml 文件。

无论我尝试使用什么 sitemap.xml 文件,当我将浏览器指向站点地图 URL 时都会收到此消息,https://www.example.ca/sitemap.xml. 页面是空的。 在此处输入图像描述

sitemap.xml 生成自:https ://www.xml-sitemaps.com/

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      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">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->


<url>
  <loc>https://www.example.ca/</loc>
  <lastmod>2021-03-25T13:24:33+00:00</lastmod>
</url>


</urlset>

标签: sitemaphugoxml-sitemapsitemap.xml

解决方案


推荐阅读