Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS customization conflict with rmarkdown::render_site() #381

Open
Cdk29 opened this issue Jun 4, 2021 · 7 comments
Open

RSS customization conflict with rmarkdown::render_site() #381

Cdk29 opened this issue Jun 4, 2021 · 7 comments
Labels
bug 🐛 Something isn't working
Milestone

Comments

@Cdk29
Copy link

Cdk29 commented Jun 4, 2021

As mentionned in #376, #380 solved the issue of the impossibility to custom the RSS to be a full-content RSS.

However, running :

==> rmarkdown::render_site(encoding = 'UTF-8')

To browse the website a second to check everything is okay, will revert the RSS / index.xml to its non custom version, with only the summaary of the articles.

@cderv
Copy link
Collaborator

cderv commented Jun 4, 2021

Thanks for opening a new one. I don't know perfectly the codebase on rss feed creation and I may have missed something. I'll have a look

@cderv cderv added the bug 🐛 Something isn't working label Jun 4, 2021
@cderv
Copy link
Collaborator

cderv commented Jun 4, 2021

I can reproduce. There is indeed something not right.

During site rendering we are rebuilding the post.json file that shares metadata, and then the rss xml file. In the former, input_files information is missing, which leads to the latter not including the full content. This new xml override the previous which had the information.

We have definitely a bug in this process - I need to understand more deeply how this is supposed to work.

@cderv
Copy link
Collaborator

cderv commented Jun 7, 2021

After a bit of archeology, it seems this part is a bit more complex.

#189 was supposed to offer a fix, but it was reverted (#189 (comment), 6e3da92). Then another approach in #190 was not ok with distill philosophy.

The issue we have here is that using rmarkdown::render_site() on a distill blog with RSS feed will regenerate the feed entirely but with no way to you use a full content feed because one information required is only passed during the knitting of a post (input_file.
During render_site, this does not exist so the old information in the XML file, generated during the first render are not kept.

distill/R/sitemap.R

Lines 246 to 252 in cd7cf53

full_content_path <- NULL
if (identical(site_config$rss$full_content, TRUE) && is.character(article$input_file)) {
guess_rmd <- paste0(gsub("\\.(utf|knit).*\\.md|\\.md", "", article$input_file), ".Rmd")
full_content_path <- dir(getwd(), pattern = guess_rmd, full.names = TRUE, recursive = TRUE)
}
if (length(full_content_path) > 0) {

We have this limitation because we do not want to rebuild each Rmd post when render_site() is ran, and we need to render a file for the full_content feature to work. This is done the first time when building the post and the information is lost after. We need to keep the information in the XML file that where generated in the first build even during render_site(): Either the full content information is there, and we keep it, or we ignore full content and use the short description - only a rebuild of a post would add the full content to the XML feed.

Fixing this needs more thinking to find the correct way to do this. 🤔

@Cdk29
Copy link
Author

Cdk29 commented Jun 7, 2021

Indeed. I understand for the Rmd, I don't want either to rerun a full 3 hours training of network. Actually it bothered me last time too when I had to rebuilt it again to "repair" the RSS.

What about :

rmarkdown::render_site(RSS=False)

Where RSS=TRUE is the default ?

@cderv
Copy link
Collaborator

cderv commented Jun 7, 2021

What about :
rmarkdown::render_site(RSS=False)
Where RSS=TRUE is the default ?

Sorry, I am not quite sure to understand the suggestion here; Can you clarify ?

@Cdk29
Copy link
Author

Cdk29 commented Jun 7, 2021

What about :
rmarkdown::render_site(RSS=False)
Where RSS=TRUE is the default ?

Sorry, I am not quite sure to understand the suggestion here; Can you clarify ?

Sorry. I mean, what about making the rebuild of the RSS optionnal ? (with the default set to true).

@bryanhanson
Copy link

Looks like this problem persists. Makes it impossible to have R-Bloggers accept the blog, because they require full content feed.

Pretty please can this issue get some attention? I appreciate the distill world, so much easier than alternatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants