Skip to content

Commit

Permalink
docs: correct typo's & omissions in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Jan 3, 2023
1 parent e1a9fe6 commit 94816a2
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ To automatially add `-1`, `-2`, etc. to the end of the URI to make it unique:
metalsmith.use(
permalinks({
unique: true
}
);
})
)
```
Provide your own function to create a unique URI:
Expand All @@ -281,8 +281,8 @@ Provide your own function to create a unique URI:
metalsmith.use(
permalinks({
unique: uniqueFunction
}
);
})
)
```
Where `uniqueFunction` takes the form:
Expand All @@ -295,33 +295,27 @@ const uniqueFunction = (path, files, filename, options) => {
### Error when there's a URI conflict
When URI when clashes occur, the build will halt with an error stating the target file conflict.
When URI clashes occur, the build will halt with an error stating the target file conflict.
```js
metalsmith.use(
permalinks({
duplicatesFail: true
}
);
})
)
```
_Note_: This will not work if you've provided your own `unique` function.
### Debug
To log debug output, set the `DEBUG` environment variable to `@metalsmith/permalinks`:
To enable debug logs, set the `DEBUG` environment variable to `@metalsmith/permalinks`:
Linux/Mac:
```bash
DEBUG=@metalsmith/permalinks
```js
metalsmith.env('DEBUG', '@metalsmith/permalinks*')
```
Windows:
```batch
set "DEBUG=@metalsmith/permalinks"
```
Alternatively you can set `DEBUG` to `@metalsmith/*` to debug all Metalsmith core plugins.
### CLI usage
Expand Down

0 comments on commit 94816a2

Please sign in to comment.