Skip to content

Commit

Permalink
support rendering rss on render_site()
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Oct 5, 2020
1 parent 6999f43 commit 856c9ee
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions R/sitemap.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,16 @@ write_feed_xml <- function(feed_xml, site_config, collection, articles) {
add_child(item, "link", text = article$base_url)

full_content_path <- NULL
if (identical(site_config$rss$full_content, TRUE) && is.character(article$input_file)) {
guess_rmd <- paste0(gsub("\\.utf.*\\.md|\\.md", "", article$input_file), ".Rmd")
full_content_path <- dir(getwd(), pattern = guess_rmd, full.names = TRUE, recursive = TRUE)
if (identical(site_config$rss$full_content, TRUE)) {
if (is.character(article$input_file)) {
guess_rmd <- paste0(gsub("\\.utf.*\\.md|\\.md", "", article$input_file), ".Rmd")
full_content_path <- dir(getwd(), pattern = guess_rmd, full.names = TRUE, recursive = TRUE)
}
else {
full_content_path <- Filter(
function(e) grepl(article$path, e, fixed = T),
dir(full.names = TRUE, pattern = "Rmd", recursive = TRUE))
}
}

if (length(full_content_path) > 0) {
Expand Down

0 comments on commit 856c9ee

Please sign in to comment.