@neoblog/plugin-custom-page
v0.1.1
Published
NeoBlog plugin for adding custom page under specific route
Downloads
8
Readme
neoblog-plugin-custom-page
Add custom page route to NeoBlog.
Usage
see config.js.
Plugin options
new PluginCustomPage(options: IPluginOptions);
interface IPluginOptions {
file: string,
type?: PluginCustomPage.ARTICLE | PluginCustomPage.RAW,
route: string
}
file
The file to renderer. Can be absolute or realtive path.
type
(Optional) How to renderer the file.
PluginCustomPage.ARTICLE
: (default) renderer this file as article.PluginCustomPage.RAW
: renderer this file as article.
route
Route for that file. It will be used in
const router = new KoaRouter();
router.get(option.route, async ctx => {
// ...
});