You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ A Metalsmith plugin for setting default values to file metadata.
11
11
## Features
12
12
13
13
- sets default values for metadata keys and file contents on files matched by pattern
14
-
- does not overwrite or transform key values that are already defined
14
+
- does not overwrite or transform key values that are already defined, unless `strategy: 'overwrite'`.
15
15
- can set computed defaults based on other metadata
16
16
17
17
## Installation
@@ -83,6 +83,7 @@ metalsmith.use(
83
83
84
84
-`pattern` (`string|string[]`): One or more glob patterns to match file paths. Defaults to `'**'` (all).
85
85
-`defaults` (`Object<string, any>`): An object whose key-value pairs will be added to file metadata. You can also specify a function `callback(file)` to set dynamic defaults based on other, existing file metadata.
86
+
-`strategy` (`'keep'|'overwrite'`): Strategy to handle setting defaults to keys that are aleady defined.
0 commit comments