distill icon indicating copy to clipboard operation
distill copied to clipboard

how to generate sitemap.xml when rendering site

Open urbanophile opened this issue 4 years ago • 1 comments

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.

urbanophile avatar Oct 06 '21 07:10 urbanophile

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 setting encoding would 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_url field in config _site.yml
  • I render the website using rmarkdown::render_site()
  • A sitemap.xml gets correctly created in the _site folder

distill version used is current dev version 1.2.7

Can you share steps to reproduce your issue ?

Thank you.

cderv avatar Oct 06 '21 09:10 cderv