{"id":16440476,"url":"https://github.com/icai/gulp-liquidr","last_synced_at":"2025-06-26T07:04:00.096Z","repository":{"id":57258140,"uuid":"115249723","full_name":"icai/gulp-liquidr","owner":"icai","description":"gulp plugin for LiquidJs, parseAndRender LiquidJs templates","archived":false,"fork":false,"pushed_at":"2020-05-30T10:53:51.000Z","size":138,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T07:03:59.732Z","etag":null,"topics":["gulp","liquid","liquid-templating-engine","liquidjs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gulp-liquidr","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icai.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-24T08:24:24.000Z","updated_at":"2018-10-28T16:43:25.000Z","dependencies_parsed_at":"2022-08-25T21:23:45.371Z","dependency_job_id":null,"html_url":"https://github.com/icai/gulp-liquidr","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/icai/gulp-liquidr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fgulp-liquidr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fgulp-liquidr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fgulp-liquidr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fgulp-liquidr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icai","download_url":"https://codeload.github.com/icai/gulp-liquidr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icai%2Fgulp-liquidr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262018760,"owners_count":23245619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gulp","liquid","liquid-templating-engine","liquidjs"],"created_at":"2024-10-11T09:12:12.494Z","updated_at":"2025-06-26T07:04:00.080Z","avatar_url":"https://github.com/icai.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gulp Liquidr\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/icai/gulp-liquidr.svg)](https://greenkeeper.io/)\n\n[![npm](https://img.shields.io/npm/v/gulp-liquidr.svg)](https://www.npmjs.org/package/gulp-liquidr)\n[![npm](https://img.shields.io/npm/dm/gulp-liquidr.svg)](https://www.npmjs.org/package/gulp-liquidr)\n[![Build Status](https://travis-ci.org/icai/gulp-liquidr.svg?branch=master)](https://travis-ci.org/icai/gulp-liquidr)\n[![GitHub issues](https://img.shields.io/github/issues-closed/icai/gulp-liquidr.svg)](https://github.com/icai/gulp-liquidr/issues)\n[![GitHub contributors](https://img.shields.io/github/contributors/icai/gulp-liquidr.svg)](https://github.com/icai/gulp-liquidr/graphs/contributors)\n[![David](https://img.shields.io/david/icai/gulp-liquidr.svg)](https://david-dm.org/icai/gulp-liquidr)\n[![David Dev](https://img.shields.io/david/dev/icai/gulp-liquidr.svg)](https://david-dm.org/icai/gulp-liquidr?type=dev)\n[![DUB](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/icai/gulp-liquidr/blob/master/LICENSE)\n\n\u003c!-- [![Coveralls](https://img.shields.io/coveralls/icai/gulp-liquidr.svg)](https://coveralls.io/github/icai/gulp-liquidr?branch=master) --\u003e\n\n\u003e gulp plugin for [LiquidJs](https://github.com/harttle/liquidjs), current project  https://github.com/icai/gulp-liquidr\n\n\n## Usage\n\n\n### Install\n\n```bash\nnpm install gulp-liquidr --save\n```\n\n### Options \n\nThe full list of options for `Liquid()` is listed as following:\n\n* `root` is a directory or an array of directories to resolve layouts and includes, as well as the filename passed in when calling `.renderFile()`.\nIf an array, the files are looked up in the order they occur in the array.\nDefaults to `[\".\"]`\n\n* `extname` is used to lookup the template file when filepath doesn't include an extension name. Eg: setting to `\".html\"` will allow including file by basename. Defaults to `\"\"`.\n\n* `cache` indicates whether or not to cache resolved templates. Defaults to `false`.\n\n* `dynamicPartials`: if set, treat `\u003cfilepath\u003e` parameter in `{%include filepath %}`, `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`.\n\n* `strict_filters` is used to enable strict filter existence. If set to `false`, undefined filters will be rendered as empty string. Otherwise, undefined filters will cause an exception. Defaults to `false`.\n\n* `strict_variables` is used to enable strict variable derivation. \nIf set to `false`, undefined variables will be rendered as empty string.\nOtherwise, undefined variables will cause an exception. Defaults to `false`.\n\n* `trim_tag_right` is used to strip blank characters (including ` `, `\\t`, and `\\r`) from the right of tags (`{% %}`) until `\\n` (inclusive). Defaults to `false`.\n\n* `trim_tag_left` is similiar to `trim_tag_right`, whereas the `\\n` is exclusive. Defaults to `false`. See [Whitespace Control][whitespace control] for details.\n\n* `trim_value_right` is used to strip blank characters (including ` `, `\\t`, and `\\r`) from the right of values (`{{ }}`) until `\\n` (inclusive). Defaults to `false`.\n\n* `trim_value_left` is similiar to `trim_value_right`, whereas the `\\n` is exclusive. Defaults to `false`. See [Whitespace Control][whitespace control] for details.\n\n* `greedy` is used to specify whether `trim_left`/`trim_right` is greedy. When set to `true`, all consecutive blank characters including `\\n` will be trimed regardless of line breaks. Defaults to `true`.\n\nThe above is All [Liquidjs initilization options](https://github.com/harttle/liquidjs#options). \n\n----\n\n* `tags` is used to Liquidjs instance to call `registerTag`\n\n* `filters` is used to Liquidjs instance to call `registerFilter`\n\n* `data` is used to Liquidjs instance to call `parseAndRender` with stream\n\n\nby the way, extname default is  `extname: '.html'`.\n\n\n### Demo\n\n```javascript\ngulp.task('example', () =\u003e {\n  return gulp.src([\n    'example/views/**/*.html',  // scan\n    '!example/views/_includes/**/*.html',  // filter\n    '!example/views/_layouts/**/*.html' // filter\n  ])\n  .pipe(liquidjs({\n    root: [resolve('views/'), resolve('views/_includes/'), resolve('views/_layouts/')],\n    filters: {\n      'add': (initial, arg1, arg2) =\u003e initial + arg1 + arg2\n    },\n    tags: {\n      'upper': {\n        parse: function (tagToken/*, remainTokens*/) {\n          this.str = tagToken.args; // name\n        },\n        render: function (scope/*, hash*/) {\n          var str = Liquid.evalValue(this.str, scope); // 'alice'\n          return Promise.resolve(str.toUpperCase()); // 'Alice'\n        }\n      }\n    }\n  }))\n  .pipe(gulp.dest('.tmp'))\n})\n\n\n```\n\n\n## License\nCopyright (c) 2017 Terry Cai. Licensed under the MIT license.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficai%2Fgulp-liquidr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficai%2Fgulp-liquidr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficai%2Fgulp-liquidr/lists"}