Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
shopify-liquid
Advanced tools
Liquid implementation for Node.js. All tags and filters listed in Shopify Documentation shall be implemented.
Shopify liquid is used by Jekyll and Github Pages.
Install:
npm install --save shopify-liquid
Parse and Render:
var Liquid = require('shopify-liquid');
var engine = Liquid();
engine.parseAndRender('{{name | capitalize}}', {name: 'alice'}); // Alice
Caching templates:
var tpl = engine.parse('{{name | capitalize}}');
engine.render(tpl, {name: 'alice'}); // Alice
Register Filters:
// Usage: {{ name | uppper }}
engine.registerFilter('upper', function(v){
return v.toUpperCase();
});
See existing filter implementations: https://github.com/harttle/shopify-liquid/blob/master/filters.js
Register Tags:
// Usage: {% upper name%}
engine.registerTag('upper', {
parse: function(tagToken, remainTokens) {
this.str = tagToken.args; // name
},
render: function(scope, hash) {
var str = Liquid.evalValue(this.str, scope); // 'alice'
return str.toUpperCase(); // 'Alice'
}
});
See existing tag implementations: https://github.com/harttle/shopify-liquid/blob/master/tags/
Documentation: https://shopify.github.io/liquid/basics/operators/
==
, !=
, >
, <
, >=
, <=
, or
, and
, contains
.
Documentation: https://shopify.github.io/liquid/basics/introduction/#tags
Documentation: https://shopify.github.io/liquid/basics/introduction/#filters
url_encode
is based on encodeURIComponent
,
will be converted to %20
.harttle/shopify-liquid do NOT support async rendering, this is by design.
The primary principle of harttle/shopify-liquid is EASY TO EXTEND. Async rendering introduces extra complexity in both implementation and extension.
For template-driven projects, checkout these Liquid-like engines:
FAQs
A feature-rich Liquid template engine for Node.js and browsers, with compliance with the Ruby version.
The npm package shopify-liquid receives a total of 14 weekly downloads. As such, shopify-liquid popularity was classified as not popular.
We found that shopify-liquid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.