diff --git a/scully/pluginManagement/pluginRepository.ts b/scully/pluginManagement/pluginRepository.ts index f7b433c3e..8183e2932 100644 --- a/scully/pluginManagement/pluginRepository.ts +++ b/scully/pluginManagement/pluginRepository.ts @@ -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`); diff --git a/scully/pluginManagement/systemPlugins.ts b/scully/pluginManagement/systemPlugins.ts index fe51c9480..c35a43ba5 100644 --- a/scully/pluginManagement/systemPlugins.ts +++ b/scully/pluginManagement/systemPlugins.ts @@ -3,3 +3,4 @@ import '../fileHanderPlugins/asciidoc'; import '../renderPlugins/contentRenderPlugin'; import '../routerPlugins/jsonRoutePlugin'; import '../routerPlugins/contentFolderPlugin'; +import '../routerPlugins/ignoredRoutePlugin'; diff --git a/scully/routerPlugins/ignoredRoutePlugin.ts b/scully/routerPlugins/ignoredRoutePlugin.ts new file mode 100644 index 000000000..a654344bf --- /dev/null +++ b/scully/routerPlugins/ignoredRoutePlugin.ts @@ -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', () => []);