-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from zazuko/mc-multiple-entries
Support multiple entries
- Loading branch information
Showing
6 changed files
with
456 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
"@zazuko/trifid-markdown-content": major | ||
--- | ||
|
||
**BREAKING CHANGE:** | ||
The plugin configuration changed in order to support multiple namespaces directly. | ||
|
||
The following configuration: | ||
|
||
```yaml | ||
middlewares: | ||
# […] your other middlewares | ||
markdown-content: | ||
module: "@zazuko/trifid-markdown-content" | ||
order: 80 | ||
config: | ||
namespace: root-content | ||
directory: file:content | ||
mountPath: / | ||
``` | ||
Can be migrated in an easy way by moving all configuration entries (except the namespace) into the config.entries[namespaceValue] key, like this: | ||
```yaml | ||
middlewares: | ||
# […] your other middlewares | ||
markdown-content: | ||
module: "@zazuko/trifid-markdown-content" | ||
order: 80 | ||
config: | ||
entries: | ||
root-content: | ||
directory: file:content | ||
mountPath: / | ||
``` | ||
See more details and options in the `README.md` file of the plugin. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// @ts-check | ||
|
||
/** | ||
* Return the value for the specific key. | ||
* If the value is not present, return the default value. | ||
* | ||
* @param {string} key Key to search for | ||
* @param {Record<string, any>} values Values to search in | ||
* @param {any} defaultValue Default value to return | ||
* @returns {any} Value for the specific key or the default value | ||
*/ | ||
export const defaultValue = (key, values, defaultValue) => { | ||
if (values[key] === undefined) { | ||
return defaultValue | ||
} | ||
return values[key] | ||
} |
Oops, something went wrong.