distill build deletes all posts

I can't provide a reprex, but I took screenshots to explain the problem. I think maybe @cderv might have insight?

tl;dr -- the question is: why do i have to re-knit every blog post after I build the website? If I don't, the relevant index.html files get deleted, and the blog doesn't exist after I push to GitHub

  1. The important piece here is that my blog entries don't live in index.html (for the site), instead they live in daily.html . See the structure here:

  1. When I build the site, the relevant index.html file (connected to the blog entry) gets deleted!

  1. In order to obtain the necessary pieces of the website, I have to re-knit each blog entry (after every build):

  1. For reference, here is the index.Rmd file for the entire site:

And the daily.Rmd file:

The website is here: https://m154-comp-stats.netlify.app/

And the GitHub repo is: GitHub - hardin47/m154-comp-stats

Thank you!!!


This could be an odd issue. I don't recall any change in distill that could cause this. I would need to reproduce based on your site but I don't have time to look into it just now. Also because I don't know distill inside and out by heart, and I need to dig into it.

can you open an issue with the same content (or a link to this question) in the distill repo so that we can track ?

I'll try to give a look ASAP.

Also did you try with last dev version of distill ? Is it working with an older version ?

I did create an issue in the distill repo a few months ago, but I put it under an issue that already existed (and I thought was similar but maybe not??) Some blog posts require two Knit compilations · Issue #389 · rstudio/distill · GitHub. Yes, I installed the most recent recent dev version of distill, and it didn't help.

Thank you for any ideas you might have.

Oh I missed that. Sorry.

Could be related but also could not directly. Overall, it is best to open a new issue (and linked to a similar one if you found that it could be related). Commenting on an existing issue is best when this is the exact same.

Sorry for the trouble. I'll have a look this week.

So I have looked into your issue.

I believe this is because your are not defining the site generator to be the one from distill.

There should be

site: distill::distill_website

in the main index.Rmd. Without this, rmarkdown::render_site() will use the default generator which is a classic R Markdown website.
The distill::distill_website custom generator is the one dealing with the content of the _post folder which the default generator does not do.

More on those generator in 10.5 rmarkdown’s site generator | R Markdown: The Definitive Guide

In your site, it has been remove from your main index.Rmd in this commit first day · hardin47/m154-comp-stats@b143147 · GitHub

It is included in the template and you may have removed it by mistake. if you put it back, this should be ok.

I don't think there is any other issue with distill but I'll dig also in the Github issue you posted initially

1 Like

Thank you, problem fixed!!! I really appreciate the help. The reason for deleting it from the original index.Rmd is because I had re-written the entire index.Rmd (from scratch) to be a generic front page instead of the blog entry landing spot. You are the best, I'm super appreciative.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.