Skip to content

A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.

License

Notifications You must be signed in to change notification settings

joel-hamilton/liquidjs

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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.

Who's Using LiquidJS?

  • Eleventy: Eleventy, a simpler static site generator.
  • Opensense: The smarter way to send email.
  • Directus: an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database.
  • Semgrep: Lightweight static analysis for many languages.
  • Rock: An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
  • Mitosis: Write components once, run everywhere. Compiles to React, Vue, Qwik, Solid, Angular, Svelte, and more.
  • Pattern Lab: a frontend workshop environment that helps you build, view, test, and showcase your design system's UI components.
  • Builder.io: the first and only headless CMS with a visual editor that lets you drag and drop with your components, directly within your current site or app. Completely API-driven, for cleaner code and simpler workflows.
  • Microsoft Power Pages: a secure, enterprise-grade, low-code software as a service (SaaS) platform for creating, hosting, and administering modern external-facing business websites.
  • Azure API Management developer portal: an automatically generated, fully customizable website with the documentation of your APIs.

Feel free to create a PR or contact me to add your use case into this list!

Financial Support

If you love LiquidJS or your company is using LiquidJS, please consider financial support.

Backers

If you personally like LiquidJS and find it useful to you, 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

๐Ÿ“–
Tomรกลก Hรผbelbauer
Tomรกลก Hรผbelbauer

๐Ÿ’ป ๐Ÿ“–
Jason Garber
Jason Garber

๐Ÿ’ป
Checkout Blocks
Checkout Blocks

๐Ÿ’ต
Adam Darrah
Adam Darrah

๐Ÿ’ต
Eleventy
Eleventy

๐Ÿ’ต
Nick Reilingh
Nick Reilingh

๐Ÿ“–
Francisco Soto
Francisco Soto

๐Ÿ’ป
David LJ
David LJ

๐Ÿ“–
Rasmus Wriedt Larsen
Rasmus Wriedt Larsen

๐Ÿ“–
Bruno Carvalho
Bruno Carvalho

๐Ÿ’ป
ๅ‚…้น
ๅ‚…้น

๐Ÿ’ป

About

A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.8%
  • JavaScript 5.0%
  • Liquid 1.1%
  • Other 1.1%