Open Cdk29 opened 3 years ago
I have a similar error. I can't provide a reprex, but I took screenshots to explain the problem.
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
index.html
(for the site), instead they live in daily.html
. See the structure here:index.html
file (connected to the blog entry) gets deleted!index.Rmd
file for the entire site:And the daily.Rmd
file:
The website is here: https://m154-comp-stats.netlify.app/
@hardin47 I don't think your issue is directly related to this one. I answered to your case in https://community.rstudio.com/t/distill-build-deletes-all-posts/126669/5 I think you are just missing a
site: distill::distill_website
in the main index.Rmd
@Cdk29 is your issue still happening ?
It is not easy to reproduce using your website as the post are quite heavy to rerun.
For what it's worth, I'm experiencing this issue too. I knit the blog post, and it gets to the point where it's created the ".knit.md" file, then it starts rerunning R code in the post.
In the example below, you can see it reruns a chunk of code that downloads data here:
trying URL 'https://www.bls.gov/oes/special.requests/oesm20ma.zip'
Content type 'application/x-zip-compressed' length 36365306 bytes (34.7 MB)
==================================================
downloaded 34.7 MB
The issue is definitely somehow related to #381. This stopped happening after I changed full_content
from true
to false
in my site.yml
:
rss:
full_content: false
categories:
- R
My original problem was solved by adding a line to the YAML in index.Rmd. I had changed the index file because I was copying a different template (so had removed the distill line, and that line is vital to making the compilation work accurately). Here is the git blame:
https://github.com/hardin47/m154-comp-stats/commit/562de423d736702320b0f66c478db39cbaa6bf44
And the YAML is:
---
title: "Schedule"
description: |
Schedule for Math 154, Computational Statistics, Fall 2021
site: distill::distill_website
---
Wow. Thanks @hardin47 for the feedback. That will really help me understand this issue better. Glad it works for you now, and we have a shared workaround. I'll try to improve the behavior or at least document it better.
In any case, yes this line is important - without it, I believe when you are calling rmarkdown::render_site()
, the default R Markdown website generator will be used, instead of the distill one.
It is a strange behavior that I don't know how to reproduce exactly. Last time I opened the https://github.com/rstudio/distill/issues/384 but I was not able to reproduce the following day for some reason.
When I knit an article, it compile until the end, create an md file and then ... restart. Or rerun the content of the rmd file, but this time it does not print out in the console the name of the rmd cells such as
label: unnamed-chunk-42
. I can see it rerunning everything from the top because of keras/tensorflow printing of training of a neural net.Second point the index.xml files is updated only after the second compilation. Dunno why either.
The code of the blog is here : https://github.com/Cdk29/casualR , I will push the last article when the second training of the network will be done.
It occurs whether or not I am in a R project.