sitemap - 无法为 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>
解决方案
推荐阅读
- c# - 使用 C# 查找具有路径和 id 属性值的单个节点
- c# - 如何使用 TPL 数据流处理完整的输入列表?
- node.js - 猫鼬连接但无法连接数据库
- java - 如何有选择地将 ArrayList 内容加载到数据库中
- java - 无法编译具有非 ASCII 字符的 Java 文件
- php - 如何在 html 选项标签中使用 php 条件
- zooming - osmdroid zoomToBoundingBox 不缩放到boundingBox坐标
- ruby-on-rails - Rails 5/JS:如何使验证错误可用于我的 create.js.erb 模板?
- msbuild - Azure DevOps 的 GUI 不再可用
- swift - 如何修复 NSTextField 的 placeholderAttributedString 中的“颠倒”/“倒置”/“翻转”文本