Skip to content

Commit

Permalink
Revert "Fix issue w/ duplicate includes within website articles"
Browse files Browse the repository at this point in the history
This reverts commit 0f03ee6.
  • Loading branch information
jjallaire committed Jan 3, 2021
1 parent 0f03ee6 commit e53e8ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- Enhance `create_article()` function to create articles from alternate formats.
- Fix issue w/ broken images in search results for pages with no preview image.
- Fix issue w/ attempting to add non-site Rmds (e.g. README.Rmd) to search index.
- Fix issue w/ duplicate `includes` within website articles
- Suppress citation for individual articles/posts via `citation: false` metadata.

## distill v1.1 (CRAN)
Expand Down
13 changes: 3 additions & 10 deletions R/distill_article.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ distill_article <- function(toc = FALSE,
site_config <- NULL
encoding <- NULL

# metadata_includes are includes derived from this file's metadata
# (as opposed to site level includes which we already process)
metadata_includes <- list()

# post-knit
post_knit <- function(metadata, input_file, runtime, encoding, ...) {

Expand All @@ -127,9 +123,6 @@ distill_article <- function(toc = FALSE,
# run R code in metadata
metadata <- eval_metadata(metadata)

# determine metadata_includes
metadata_includes <<- metadata[["output"]][["distill::distill_article"]][["includes"]]

# pandoc args
args <- c()

Expand Down Expand Up @@ -246,11 +239,11 @@ distill_article <- function(toc = FALSE,
before_body <- c(front_matter_before_body(metadata),
navigation_before_body_file(dirname(input_file), site_config),
site_before_body_file(site_config),
metadata_includes$before_body,
includes$before_body,
listing$html)

# after body includes: user then distill
after_body <- c(metadata_includes$after_body,
after_body <- c(includes$after_body,
site_after_body_file(site_config),
appendices_after_body_file(input_file, site_config, metadata),
navigation_after_body_file(dirname(input_file), site_config))
Expand All @@ -270,7 +263,7 @@ distill_article <- function(toc = FALSE,
pre_processor <- function(yaml_front_matter, utf8_input, runtime, knit_meta,
files_dir, output_dir, ...) {
pandoc_include_args(in_header = c(site_in_header_file(site_config),
metadata_includes$in_header))
includes$in_header))
}

on_exit <- function() {
Expand Down

0 comments on commit e53e8ff

Please sign in to comment.