Learn R Programming

blogdown (version 1.19)

bundle_site: Convert post files to leaf bundles

Description

For a post with the path content/path/to/my-post.md, it will be moved to content/path/to/my-post/index.md, so it becomes the index file of a leaf bundle of Hugo. This also applies to files with extensions .Rmd and .Rmarkdown.

Usage

bundle_site(dir = site_root(), output)

Arguments

dir

The root directory of the website project (should contain a content/ folder).

output

The output directory. If not provided, a suffix -bundle is added to the website root directory name. For example, the default output directory for the site under ~/Documents/test is ~/Documents/test-bundle. You can specify the output directory to be identical to the website root directory, so files will be moved within the same directory, but please remember that you will not be able to undo bundle_site(). You should modify the website in place only if you have a backup for this directory or it is under version control.

References

Learn more about Hugo's leaf bundles at https://gohugo.io/content-management/page-bundles/.

Examples

Run this code
if (FALSE) {
blogdown::bundle_site(".", "../new-site/")
blogdown::bundle_site(".", ".")  # move files within the current working directory
}

Run the code above in your browser using DataLab