I am creating a custom template for rmd using https://github.com/dr-harper/example-rmd-templates. There is a method for adding a footer to the template without needing to create a directory when the template is used. It does that by calling the footer in an r code as such:
#' Custom HTML template
#'
#' Loads additional style and template file
#'
#' @param toc table of contents
#' @param toc_float floating of toc
#' @param toc_depth how many subsections are in toc
#' @param number_sections whether display section number
#' @param ... additional arguments provided to \@code{html_document}
#' @export
#'
html_report_format <- function(toc = TRUE,
toc_float = TRUE,
toc_depth = 2,
number_sections = TRUE,
...) {
# locations of resource files in the package
pkg_resource = function(...) {
system.file(..., package = "a")
}
footer = pkg_resource("rmarkdown/resources/footer.html")
css = pkg_resource("rmarkdown/resources/dsaa_style.css")
# call the base html_document function
rmarkdown::html_document(
toc = toc,
toc_float = toc_float,
toc_depth = toc_depth,
number_sections = number_sections,
css = css,
includes = rmarkdown::includes(after_body = footer),
...
)
}
I also have an image logo that I would like to be placed in the header but when I try to create a header.html that uses the image file placed in its folder, it can't access it. I saw a latex solution here: Include Image in R Markdown Template Without Having to Create a New Directory for Template
Any tips on how to do the same for html