mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 04:40:39 -07:00
39c87437c5ef38ede9a208c9d55cd13231c6c023
The %s handler read LiquidDate.getTime(), which returns the displayDate deliberately shifted by the display timezone offset for wall-clock getters. With a timezone argument or timezoneOffset option set, %s produced an epoch shifted by (server offset - display offset) instead of the true Unix timestamp. Expose the unshifted time as LiquidDate.dateValue() and use it for %s. Also switch Math.round to Math.floor so fractional seconds truncate toward the epoch like Ruby strftime. Fixes #931
LiquidJS
A simple, expressive, extensible Liquid template engine for JavaScript — Shopify, Jekyll and GitHub Pages compatible, for Node.js, browsers, and the CLI, with TypeScript support.
Documentation · Playground · Setup guide · Contributing
Try the online playground.
Quick start
import { Liquid } from 'liquidjs'
const engine = new Liquid()
const html = await engine.parseAndRender(
'Hello, {{ name | capitalize }}!',
{ name: 'liquid' }
)
//=> 'Hello, Liquid!'
Installation
Node.js
npm install liquidjs
Browser (jsDelivr UMD bundle)
<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>
CLI
npx liquidjs --template 'Hello, {{ name }}!' --context '{"name": "Liquid"}'
See the setup guide for partials, layouts, caching, and other options.
Used by
Products and projects running on LiquidJS. Open a PR to add yours.
Financial Support
If you personally love LiquidJS or it's benefiting your business, please consider financially support us via GitHub Sponsors. Special thanks to our sponsors!
Contributors ✨
Want to contribute? see Contribution Guidelines. Thanks goes to these wonderful people:
License
Languages
TypeScript
94.8%
JavaScript
3.8%
Liquid
0.7%
SWIG
0.3%
Handlebars
0.3%




