Skip to content

Commit 1e0492e

Browse files
committed
Use sitemapindex instead of regular sitemap
1 parent a77e6c2 commit 1e0492e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/sitemap.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ generate_sitemap <- function(path){
2222
sites <- Filter(function(x){!(x %in% skiplist)}, sites)
2323

2424
# Generate sitemap.xml
25-
body <- sprintf(" <url>\n <loc>https://docs.ropensci.org/%s/</loc>\n </url>", sites)
25+
body <- sprintf(" <sitemap>\n <loc>https://docs.ropensci.org/%s/sitemap.xml</loc>\n </sitemap>", sites)
2626
sitemap <- paste(c('<?xml version="1.0" encoding="UTF-8"?>',
27-
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
28-
body, '</urlset>'), collapse = '\n')
27+
'<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
28+
body, '</sitemapindex>'), collapse = '\n')
2929
writeLines(sitemap, file.path(path, 'sitemap.xml'))
3030

3131
# Generate index.html

0 commit comments

Comments
 (0)