test_that("check images in readme", {
pkg <- local_pkgdown_site()
pkg <- pkg_add_file(pkg, "README.md", "")
suppressMessages(build_home_index(pkg))
# no image, so should warn
expect_snapshot(check_built_site(pkg))
# create and build vignette that uses image, so no warning
pkg <- pkg_add_file(pkg, "vignettes/kitten.Rmd", "")
pkg <- pkg_add_kitten(pkg, "vignettes")
suppressMessages(build_article("kitten", pkg))
suppressMessages(expect_no_warning(check_built_site(pkg)))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.