Skip to content

Commit

Permalink
update meta files docs and usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Jun 6, 2024
1 parent 9e27b88 commit 69aafde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions www/pages/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export default {
```
### Workspace
Path to where all your project files will be located. Using an absolute path is recommended.
Path to where all your project files will be located. Using an absolute path is recommended. Default is _src/_.
#### Example
Expand All @@ -251,4 +251,4 @@ export default {
};
```
> Please note the trailing `/` here as for ESM, a path must end in a `/` for directories.
> Please note the trailing `/` here as for ESM, as paths must end in a `/` for directories.
23 changes: 13 additions & 10 deletions www/pages/docs/css-and-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,21 @@ customElements.define('x-header', HeaderComponent);
> ```
### Meta files
### Meta Files
The build includes a few [default copy plugins](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/cli/src/plugins/copy) for common meta files. Typically, they support copying the files from the source directory to the build directory.
By default, Greenwood will automatically detect these "meta" files from the top-level of your [workspace directory](docs/configuration/#workspace) and automatically copy them over to the root of the build output directory.
* `plugin-copy-favicon.js` - copies favicon.ico. NOTE: Does not support multiple favicons. For multiple support, use the manifest.json or make a custom plugin
* `plugin-copy-manifest-json.js` - copies manifest.json
* `plugin-copy-robots.js` - copies robots.txt
* `plugin-copy-sitemap.js` - copies sitemap.xml
- _favicon.ico_
- _robots.txt_
- _sitemap.xml_
If you need to generate these files dynamically, build a custom copy plugin. The [build.default.meta-files.spec.js](https://github.com/ProjectEvergreen/greenwood/blob/master/packages/cli/test/cases/build.default.meta-files/build.default.meta-files.spec.js) is a good example of how to test. The test lifecycle is:
Example:
* Read config
* Build site using fixtures (fake files) in the test directory
* Assert the copy executed properly
```shell
src/
favicon.ico
robots.txt
sitemap.xml
```
> If you need support for more custom copying of static files like this, please check out our docs on creating your own [copy plugin](plugins/copy/).

0 comments on commit 69aafde

Please sign in to comment.