From cbde48971a9eab23fa5192e5511bf11f0fb7963a Mon Sep 17 00:00:00 2001 From: harttle Date: Mon, 17 Jul 2017 01:08:51 +0800 Subject: [PATCH] rename to liquidjs --- README.md | 47 ++++++++++++++++++++------------------- demo/express/app.js | 32 +++++++++++++------------- demo/express/package.json | 4 ++-- package.json | 10 ++++----- 4 files changed, 47 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 9ef2eed4e..de33f972e 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,35 @@ -# shopify-liquid +# liquidjs -[![npm](https://img.shields.io/npm/v/shopify-liquid.svg)](https://www.npmjs.org/package/shopify-liquid) -[![Build Status](https://travis-ci.org/harttle/shopify-liquid.svg?branch=master)](https://travis-ci.org/harttle/shopify-liquid) -[![Coveralls](https://img.shields.io/coveralls/harttle/shopify-liquid.svg)](https://coveralls.io/github/harttle/shopify-liquid?branch=master) -[![GitHub issues](https://img.shields.io/github/issues-closed/harttle/shopify-liquid.svg)](https://github.com/harttle/shopify-liquid/issues) +[![npm](https://img.shields.io/npm/v/liquidjs.svg)](https://www.npmjs.org/package/liquidjs) +[![Build Status](https://travis-ci.org/harttle/liquidjs.svg?branch=master)](https://travis-ci.org/harttle/liquidjs) +[![Coveralls](https://img.shields.io/coveralls/harttle/liquidjs.svg)](https://coveralls.io/github/harttle/liquidjs?branch=master) +[![GitHub issues](https://img.shields.io/github/issues-closed/harttle/liquidjs.svg)](https://github.com/harttle/liquidjs/issues) -A Liquid template engine with a wide range of tags and filters, -for both Node.js and browsers. -Here's a live demo: +A Liquid engine implementation for both Node.js and browsers, with all [shopify/liquid][shopify/liquid] features. +Formerly known as shopify-liquid. + +Live Demo: > The Liquid template engine is implemented in Ruby originally, > which is used by [Jekyll][jekyll] and [Github Pages][gh]. Features: -* A wide range of [filters](https://github.com/harttle/shopify-liquid/wiki/Builtin-Filters) and [tags](https://github.com/harttle/shopify-liquid/wiki/Builtin-Tags) +* A wide range of [filters](https://github.com/harttle/liquidjs/wiki/Builtin-Filters) and [tags](https://github.com/harttle/liquidjs/wiki/Builtin-Tags) * Easy tag/filter registration, allows async tags * [any-promise][any-promise] API Reference: -* Builtin Tags: -* Builtin Filters: -* Operators: -* Whitespace Control: +* Builtin Tags: +* Builtin Filters: +* Operators: +* Whitespace Control: Installation: ```bash -npm install --save shopify-liquid +npm install --save liquidjs ``` ## Render from String @@ -36,7 +37,7 @@ npm install --save shopify-liquid Parse and Render: ```javascript -var Liquid = require('shopify-liquid'); +var Liquid = require('liquidjs'); var engine = Liquid(); engine.parseAndRender('{{name | capitalize}}', {name: 'alice'}) @@ -126,11 +127,11 @@ And `window.Liquid` is what you want. There's also a [demo](demo/browser/). var engine = window.Liquid(); var src = '{{ name | capitalize}}'; var ctx = { - name: 'welcome to Shopify Liquid' + name: 'welcome to liquidjs' }; engine.parseAndRender(src, ctx) .then(function(html) { - // html === Welcome to Shopify Liquid + // html === Welcome to liquidjs }); @@ -194,7 +195,7 @@ engine.registerFilter('upper', function(v){ }); ``` -> See existing filter implementations: +> See existing filter implementations: ## Register Tags @@ -211,7 +212,7 @@ engine.registerTag('upper', { }); ``` -> See existing tag implementations: +> See existing tag implementations: ## Contribution Guide @@ -221,11 +222,11 @@ engine.registerTag('upper', { [nunjucks]: http://mozilla.github.io/nunjucks/ [liquid-node]: https://github.com/sirlantis/liquid-node -[shopify-liquid]: https://shopify.github.io/liquid/ +[shopify/liquid]: https://shopify.github.io/liquid/ [jekyll]: http://jekyllrb.com/ [gh]: https://pages.github.com/ -[releases]: https://github.com/harttle/shopify-liquid/releases +[releases]: https://github.com/harttle/liquidjs/releases [any-promise]: https://github.com/kevinbeaty/any-promise -[test]: https://github.com/harttle/shopify-liquid/tree/master/test +[test]: https://github.com/harttle/liquidjs/tree/master/test [caniuse-promises]: http://caniuse.com/#feat=promises -[whitespace control]: https://github.com/harttle/shopify-liquid/wiki/Whitespace-Control +[whitespace control]: https://github.com/harttle/liquidjs/wiki/Whitespace-Control diff --git a/demo/express/app.js b/demo/express/app.js index ffb7bff02..84bae0b06 100644 --- a/demo/express/app.js +++ b/demo/express/app.js @@ -1,22 +1,22 @@ -var express = require('express'); -var app = express(); -var Liquid = require('../..'); +var express = require('express') +var app = express() +var Liquid = require('../..') var engine = Liquid({ - root: __dirname, // for layouts and partials - extname: '.liquid' -}); + root: __dirname, // for layouts and partials + extname: '.liquid' +}) -app.engine('liquid', engine.express()); // register liquid engine -app.set('views', ['./partials', './views']); // specify the views directory -app.set('view engine', 'liquid'); // set to default +app.engine('liquid', engine.express()) // register liquid engine +app.set('views', ['./partials', './views']) // specify the views directory +app.set('view engine', 'liquid') // set to default app.get('/', function (req, res) { - var todos = ['fork and clone', 'make it better', 'make a pull request']; - res.render('todolist', { - todos: todos, - title: 'Welcome to shopify-liquid!' - }); -}); + var todos = ['fork and clone', 'make it better', 'make a pull request'] + res.render('todolist', { + todos: todos, + title: 'Welcome to liquidjs!' + }) +}) -module.exports = app; +module.exports = app diff --git a/demo/express/package.json b/demo/express/package.json index b48d0b10c..7a9ec02c7 100644 --- a/demo/express/package.json +++ b/demo/express/package.json @@ -1,14 +1,14 @@ { "name": "express-demo", "version": "1.0.0", - "description": "Express Demo Using Shopify-Liquid", + "description": "Express Demo Using liquidjs", "main": "index.js", "scripts": { "start": "node index.js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "harttle", - "license": "ISC", + "license": "MIT", "dependencies": { "express": "^4.14.0" } diff --git a/package.json b/package.json index 0cfc16683..54f7ca886 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "shopify-liquid", + "name": "liquidjs", "version": "1.9.0", - "description": "A feature-rich Liquid template engine for Node.js and browsers, with compliance with the Ruby version.", + "description": "A Liquid template engine for Node.js and browsers, with all shopify/liquid features.", "main": "index.js", "scripts": { "lint": "eslint src/ test/", @@ -13,7 +13,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/harttle/shopify-liquid.git" + "url": "git+https://github.com/harttle/liquidjs.git" }, "keywords": [ "liquid", @@ -25,9 +25,9 @@ "author": "Harttle", "license": "MIT", "bugs": { - "url": "https://github.com/harttle/shopify-liquid/issues" + "url": "https://github.com/harttle/liquidjs/issues" }, - "homepage": "https://github.com/harttle/shopify-liquid#readme", + "homepage": "https://github.com/harttle/liquidjs#readme", "dependencies": { "any-promise": "^1.3.0" },