New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hexo-renderer-njucks

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-renderer-njucks

Yet another Nunjucks renderer for Hexo. Async, alive and can be actively updated.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

hexo-renderer-njucks

Yet another Nunjucks renderer for Hexo. Async, alive and can be actively updated.

WHY?

Both hexo-renderer-nunjucks and hexo-renderer-njk and hexo-renderer-njks are using Nunjucks version 2, and seems their author won't update them to Nunjucks 3. They take the best name in npm, but leave code unmaintained! So I write my own hexo renderer to render my theme ARIA.

READ HERE BEFORE USING IT OR CREATING YOUR OWN THEME WITH NUNJUCKS:

By default it set autoescape to true because Hexo renders markdown to HTML, Nunjucks just place strings.

If you want to change Nunjucks config (for doc looks here), just write them in Hexo's site config _config.yml like this:

nunjucks:
  watch: true
  # and other config...

If you write a Hexo theme with Nunjucks with me, I have some useful tips for you:

  1. Some of Hexo's varibles are not the same type as they looks like, for example, in index template, you may think page.posts is an Array, but it's an Object (read here), which you cannot iterate it with for in, I don't know why Hexo designs it so strange (more strange, some data structure of Hexo is "Array of ???", WHAT IS ????). OK, if you need an Array, use toArray() method like page.posts.toArray(), which is mentioned by @tommy351 (author of Hexo) here.

  2. hexo-renderer-Nunjucks and hexo-renderer-njk are using Nunjucks version 2, and some Nunjucks' keywords like === and !== are not supported in version 2, that's why I make this plugin.

LICENSE:

Apache-2.0

Keywords

FAQs

Package last updated on 14 Apr 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