Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

egg-view-nunjucks-pagelet

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-view-nunjucks-pagelet

Egg view plugin base on nunjucks-pagelet

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
3
Weekly downloads
 
Created
Source

egg-view-nunjucks-pagelet

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Support the view rendering implementation of the nunjucks pagelet. Depends on the egg-view-nunjucks template view engine.

Pagelet: https://github.com/scrat-team/nunjucks-pagelet

DOCS: https://mozilla.github.io/nunjucks/templating.html

Install

$ npm i egg-view-nunjucks egg-view-nunjucks-pagelet --save

Usage

add plugin in {app_root}/config/plugin.js

exports.nunjucks = {
  enable: true,
  package: 'egg-view-nunjucks',
};

exports.nunjucksPagelet = {
  enable: true,
  package: 'egg-view-nunjucks-pagelet',
};

configure nunjucks in {app_root}/config/config.default.js

exports.view = {
  defaultViewEngine: 'nunjucks'
};

exports.nunjucksPagelet = {
  // default layout template relative to view base dir
  // layout: 'layout/layout.tpl',
  // default scrat resource manifest path
  // manifest: path.join(app.baseDir, 'config/manifest.json'),
  // whether using custom parser, default true
  // for more detail, see https://github.com/scrat-team/nunjucks-tag#custom-parser-rules
  // useCustomParser: true,
};

Render in controller

exports.home = function* (ctx) {
  yield ctx.render('home', { list });
};

Configuration

see config/config.default.js for more detail.

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

FAQs

Package last updated on 05 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc