-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to configure filter names for url plugin #149
Add option to configure filter names for url plugin #149
Conversation
- Update url plugin to accept option to configure url and htmlUrl filter names. - Implement test for default filter names and configured filter names including two test pages. - I am unsure about the name for the options as no other plugin has two filter names. Other plugins could therefore use name as the property.
Many thanks @tobiasschmidt89. I think the implementation is correct, I just have a couple of points:
const url = {
names: { url: "urlify", htmlUrl: "htmlUrlify" }
};
const site = lume(
{ location: new URL("https://example.com") },
{ url }
); See the mod.ts file. You need to include the url Options in the PluginsOptions interface and pass the values here.
|
@oscarotero understood. I will make an update to include the options in the default plug-in options in mod.ts and I will then adjust the tests to define the options in the |
- Update mod.ts with url plugin options interface. - Update mod.ts to pass default plugin options to url plugin. - Update my new tests to pass options in default plugin options to the test lume instance. - Update getSite test util function to accept and pass on default plugin options to the test lume instance. For now I used type any for the default plugin options. - To discuss if it makes sense to put the default plugin options interface inside e.g. the plugin folder and export it so that it can be used in both the mod.ts and getSite test function (similar to the site options) or if we can export plugin options interface from mod.ts (which I think is not nice as it might indicate that it is ok to use it by users).
I pushed a new commit addressing the issues: Update tests to use default plugin options in mod.ts.
|
Thanks! |
url
andhtmlUrl
filter names.name
as the property. I propose to useoptions.names.filterDefaultName
as the pattern in this case. e.g.options.names.url