I use the R Studio > Blogdown > Github > Netlify chain to publish my website https://whatbank.ca
I am trying to add a sitemap.xml file by placing it in layouts/sitemap.xml
I saved the file with Save as Encoding > UTF-8
When I point Chrome to whatbank.ca/sitemap.xml I get the error:
The rendering of the page is empty.
When I view the Page Source I see:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://whatbank.ca/</loc>
<lastmod>2005-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Yet the raw source on Github looks like:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://whatbank.ca/</loc>
<lastmod>2005-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
My thinking is that the 2nd line of whatbank.ca/sitemap.xml, <?xml version="1.0" encoding="UTF-8"?>
, is rendering the entire file invalid.
Why does the file get changed?
Is this the correct approach to add a custom sitemap.xml file?