bundle_site: Convert post files to leaf bundles

View source: R/hugo.R

bundle_siteR Documentation

Convert post files to leaf bundles


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’.


bundle_site(dir = site_root(), output)



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


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.


This function only moves (R) Markdown source files. If these files use resource files under the ‘static/’ folder, these resources will not be moved into the ‘content/’ folder. You need to manually move them, and adjust their paths in the (R) Markdown source files accordingly.


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


## Not run: 
blogdown::bundle_site(".", "../new-site/")
blogdown::bundle_site(".", ".")  # move files within the current working directory

## End(Not run)

blogdown documentation built on July 9, 2023, 5:28 p.m.