Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scully/pluginManagement/pluginRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ export const registerPlugin = (
{replaceExistingPlugin = false} = {}
) => {
if (!['router', 'render', 'fileHandler'].includes(type)) {
throw new Error(
`Type "${yellow(type)}" is not a known plugin type for registering plugin "${yellow(name)}"`
);
throw new Error(`
--------------
Type "${yellow(type)}" is not a known plugin type for registering plugin "${yellow(name)}".
The first parameter of registerPlugin needs to be one of: 'fileHandler', 'router', 'render'
--------------
`);
}
if (replaceExistingPlugin === false && plugins[type][name]) {
throw new Error(`Plugin ${name} already exists`);
Expand Down
1 change: 1 addition & 0 deletions scully/pluginManagement/systemPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ import '../fileHanderPlugins/asciidoc';
import '../renderPlugins/contentRenderPlugin';
import '../routerPlugins/jsonRoutePlugin';
import '../routerPlugins/contentFolderPlugin';
import '../routerPlugins/ignoredRoutePlugin';
7 changes: 7 additions & 0 deletions scully/routerPlugins/ignoredRoutePlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {registerPlugin} from '../pluginManagement/pluginRepository';

/**
* The ignoredPlugin helps to take routes out.
* when you use this plugin, the route will never be rendered.
*/
registerPlugin('router', 'ignored', () => []);