Skip to content

Commit

Permalink
Merge pull request #380 from rstudio/fix/rss-feed-full-content
Browse files Browse the repository at this point in the history
Fix RSS feed with full content
  • Loading branch information
jjallaire authored Jun 4, 2021
2 parents 3782a50 + bee4e62 commit cd7cf53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## distill v1.3 (Development)

- Fix issue w/ full content and categorized rss feed (\#380).
- Fix issue w/ `_footer.html` containing HTML tags using attributes with no value (\#377).
- Require **lubridate** 1.7.10 to fix an issue with timezone parsing on MacOS (\#315).
- Listing pages are correctly filtered when using categories with special characters, encoded in URI (\#332).
Expand Down
4 changes: 2 additions & 2 deletions R/sitemap.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ write_feed_xml_html_content <- function(input_path, article, site_config) {
))

# read contents
html_contents <- paste(readLines(html_file), collapse = "\n")
html_contents <- paste(xfun::read_utf8(html_file), collapse = "\n")

# fix image paths
html_contents <- gsub(paste0(basename(dirname(rmd_file)), "/"),
Expand Down Expand Up @@ -245,7 +245,7 @@ write_feed_xml <- function(feed_xml, site_config, collection, articles) {

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")
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)
}

Expand Down

0 comments on commit cd7cf53

Please sign in to comment.