The default template renderer for Bloggify.
# Using npm
npm install --save bloggify-template-renderer
# Using yarn
yarn add bloggify-template-renderer
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. π
BloggifyTemplate
Creates a new instance of BloggifyTemplate
.
- String
name
: The name of the template. - String
tmplPath
: The template path.
BloggifyTemplateRenderer
Creates a new instance of BloggifyTemplateRenderer
.
- Object
bloggify
: The bloggify instance.
Fetch a template by its name.
- String
name
: The template name. - Function
cb
: The callback function.
Use this method to register templates.
Usages:
registerTemplate(name, path)
registerTemplate(path)
registerTemplate(index, path)
- String
name
: The template name. - String
tmplPath
: The template path. - Boolean
usePathName
: Wether to use the pathname (in the template cache) or not. - Boolean
reregister
: Wether to enforce the template reregistering.
- BloggifyTemplate The template object.
Gets the template renderer for that extension.
- String
ext
: The renderer extension.
- Function The renderer function.
Creates a new renderer.
- String
ext
: The renderer extension. - Function
func
: The renderer handler.
Renders the 500 server error and logs the error.
- Context
ctx
: The context. - Object
data
: The template data. - Error
err
: The error to render. - Function
cb
: The callback function.
Appends a hook that is executed before rendering the template.
- String
url
: The render url. - String
method
: The methods of the renderer. - Function
cb
: The callback function. - Object
transType
: The transform type.
- Hook The new hook will be returned.
Renders a template for a given context.
- Context
ctx
: The context. - String
tmplName
: The template name. - Object
data
: The template data. - Function
cb
: The callback function.
Have an idea? Found a bug? See how to contribute.
If you are using this library in one of your projects, add it in this list. β¨
bloggify