Order of operations

This is a high level description of how Lume build your site. When you run lume, the following operations are executed in this order:

  1. Dispatch the event beforeBuild.
  2. Ensure the dest folder is empty.
  3. Copy all files and folders configured with site.copy() to the dest folder.
  4. Walk the src folder recursively and load all files matching with a valid file extension, like .md, .njk, etc.
    • Skip files and folders starting with _, ., ignored with site.ignore() or previously copies with site.copy().
    • If the name of the file is _data or is inside a _data folder, is shared data.
    • Otherwise, it's a page.
  5. Group all pages by renderOrder value and sort them.
  6. For each group of pages with the same renderOrder:
  7. Dispatch the event afterRender.
  8. Run the processors registered
  9. Dispatch the event beforeSave.
  10. Save all pages to dest folder.
  11. Dispatch the event afterBuild.

Watch mode

In watch mode (with lume --serve or lume --watch), the first build is exactly the same, but the succesive changes have some differences: