knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
pkgdown.offline supports offline builds of pkgdown websites. It implements identically named functions to mask the original site initialization and site building functions for convenient drop-in replacements in your environment-constrained development or CI/CD workflows that cannot access the internet.
To test the offline build workflow, first clear the pkgdown external frontend dependencies cache that might exist in your environment:
pkgdown.offline::clear_cache()
Create a new package. For example:
usethis::create_package(file.path(tempdir(), "pkg"))
Switch off internet connection. In the new project, run:
usethis::use_pkgdown() pkgdown.offline::build_site()
In practice, you can replace pkgdown::build_site()
calls with
pkgdown.offline::build_site()
in your wrapper function or CI/CD workflow
to achieve offline builds. Similarly, you can use pkgdown.offline::init_site()
if a pkgdown::init_site()
step was involved in your workflow.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.