how to generate sitemap.xml when rendering site
I am using rmarkdown::render_site() to build my distill website. If I call this function with no additional arguments then no sitemap.xml is generated. It's not totally clear to me that why if I instead call render_site(encoding = 'UTF-8') then sitemap.xml is generated. Rendering the sitemap seems to part of the distill code, but it's not totally clear in the documentation how rmarkdown interfaces with distill, hence I have not sure how I was suppose figure this out. Given that sitemaps are pretty handy things to have , this seems kinda like either a bug or an omission in the documentation.
Hi,
thanks for the report.
Sitemap in distill should be written if you have a base_url setup. Otherwise, it won't.
Then:
- Sitemap should be written when you render a post for a blog.
- When
render_site()is run. I am not sure why settingencodingwould change the behavior.
I think your report could be related to https://github.com/rstudio/distill/issues/381 and it seems there is something wrong in the interaction between knitting a single post and rendering a site
However, I can't reproduce:
- I am using Distill blog template - works also with website template project
- I am adding
base_urlfield in config_site.yml - I render the website using
rmarkdown::render_site() - A
sitemap.xmlgets correctly created in the_sitefolder
distill version used is current dev version 1.2.7
Can you share steps to reproduce your issue ?
Thank you.