https://github.com/cran/pkgdown
Revision 651be9df176377fc2008a1e0990db54e7e2f0daf authored by Hadley Wickham on 14 September 2019, 23:10:08 UTC, committed by cran-robot on 14 September 2019, 23:10:08 UTC
1 parent 6522ead
Raw File
Tip revision: 651be9df176377fc2008a1e0990db54e7e2f0daf authored by Hadley Wickham on 14 September 2019, 23:10:08 UTC
version 1.4.1
Tip revision: 651be9d
build-404.R
build_404 <- function(pkg = ".") {
  pkg <- as_pkgdown(pkg)

  # if this file exists, it will be handled by build_home_md()
  page_md <- path(pkg$src_path, ".github", "404.md")

  if (!file_exists(page_md)) {
    render_page(
      pkg, "title-body",
      data = list(
        pagetitle = "Page not found (404)",
        body = c("Content not found. Please use links in the navbar.")
      ),
      path = "404.html"
    )
  }

  invisible()
}
back to top