Skip to content

Latest commit

 

History

History
178 lines (148 loc) · 25.6 KB

README.md

File metadata and controls

178 lines (148 loc) · 25.6 KB

liquidjs

npm version npm downloads Coverage Build Status DUB license semantic-release

A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript. The purpose of this repo is to provide a standard Liquid implementation for the JavaScript community so that Jekyll sites, Github Pages and Shopify templates can be ported to Node.js without pain.

logo

What's it like?

Basically there're two types of Liquid syntax: tags enclosed by {% %} and outputs enclosed by {{ }}. A Liquid template looks like:

{% if username %}
  {{ username | append: ", welcome to LiquidJS!" | capitalize }}
{% endif %}

A live demo is also available and here's a quick tutorial for Liquid syntax.

Installation

Install from npm in Node.js:

npm install liquidjs

Or use the UMD bundle from jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>

Or render directly from CLI using npx:

npx liquidjs --template 'Hello, {{ name }}!' --context '{"name": "Snake"}'

For more details, refer to the Setup Guide.

Related Projects

  • @11ty/eleventy: A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types) into HTML.
  • gulp-liquidjs: A shopify compatible Liquid template engine for Gulp using liquidjs.
  • grunt-liquify: A Grunt task to process Liquid using liquidjs. Use it to add Liquid magic to your scripts and css assets.
  • react-liquid: Liquid templating language component for React

Financial Support

If you love LiquidJS or your company is using LiquidJS? Please consider support us on Open Collective or Patreon.

Backers

If you personally like LiquidJS and find it useful to you, you can buy me a coffee!

Sponsors

If LiquidJS is benefiting your business/company, please sponsor us to contribute to our effort!

Contributors ✨

Want to contribute? see Contribution Guidelines. Thanks goes to these wonderful people:

Jun Yang
Jun Yang

🚧 💻
chenos
chenos

💻
Zach Leatherman
Zach Leatherman

🐛
Tim Hardy
Tim Hardy

💻
Paul Robert Lloyd
Paul Robert Lloyd

💻 🐛
Alec Larson
Alec Larson

💻
Patrick Malouin
Patrick Malouin

💻 📖
jaswrks
jaswrks

💻
三三
三三

💻 🤔
ssendev
ssendev

💻 📖
wojtask9
wojtask9

💻
Andrew Barclay
Andrew Barclay

💻
Cory Mawhorter
Cory Mawhorter

💻
Mehdi Jaffery
Mehdi Jaffery

💻
Robin Bijlani
Robin Bijlani

💻 🐛
Ryan Kennedy
Ryan Kennedy

💻
Sami Kukkonen
Sami Kukkonen

💻
Scott Santucci
Scott Santucci

💻
Steven
Steven

💡 💻
azu
azu

📖
Joonas
Joonas

💻
Jamel A.
Jamel A.

💻
Brandon Pittman
Brandon Pittman

💻
tgrandgent
tgrandgent

💻
Martin Schuster
Martin Schuster

💻
Ray
Ray

⚠️ 💻
Cristofer Gonzales
Cristofer Gonzales

💻
Raymond Camden
Raymond Camden

📖
Steve Stedman
Steve Stedman

📖
Anthony Ciccarello
Anthony Ciccarello

📖
Bogdan Chadkin
Bogdan Chadkin

💻
Tejas Manohar
Tejas Manohar

💻
Peter deHaan
Peter deHaan

📖
amit777
amit777

💻 💵
Steffen Schuldenzucker
Steffen Schuldenzucker

💻
Pixcell
Pixcell

💻
Jason Etcovitch
Jason Etcovitch

💻
ZC
ZC

📖
Memmie Lenglet
Memmie Lenglet

💻
ilhamdev0
ilhamdev0

📖
一饮一啄皆是人生
一饮一啄皆是人生

📖
Amit Agarwal
Amit Agarwal

📖
Laurin Quast
Laurin Quast

💻
Matt Vague
Matt Vague

💻
Liam Bigelow
Liam Bigelow

💻
Jason Kurian
Jason Kurian

📖
d pham (they/them)
d pham (they/them)

📖
Aleksandr Hovhannisyan
Aleksandr Hovhannisyan

💻
jg-rp
jg-rp

💻
Ameya Apte
Ameya Apte

💻
tbdrz
tbdrz

📖
Santi Albo
Santi Albo

📖
Yahang Wu
Yahang Wu

📖
hongl
hongl

📖
zxx-457
zxx-457

📖
prassie
prassie

📖
Slav Ivanov
Slav Ivanov

💻
Daniel Rosenberg
Daniel Rosenberg

💻
bobgubko
bobgubko

💻
BaNgan
BaNgan

📖
Mahyar Pasarzangene
Mahyar Pasarzangene

📖