Add note about custom working directory in Leaf's configure section

This commit is contained in:
Tim Condon 2020-12-12 17:45:57 +00:00 committed by GitHub
parent 1f0256447e
commit f4bb9b96ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -43,6 +43,8 @@ This tells Vapor to use the `LeafRenderer` when you call `req.view` in your code
> **Note:** Leaf has an internal cache for renderering pages. When the `Application`'s environment is set to `.development`, this cache is disabled, so that changes to templates take effect immediately. In `.production` and all other environments, the cache is enabled by default; any changes made to templates will not take effect until the application is restarted.
!!!warning For Leaf to be able to find the templates when running from Xcode, you must set the [custom working directory](https://docs.vapor.codes/4.0/xcode/#custom-working-directory) for you Xcode workspace.
## Folder Structure
Once you have configured Leaf, you will need to ensure you have a `Views` folder to store your `.leaf` files in. By default, Leaf expects the views folder to be a `./Resources/Views` relative to your project's root.