{"id":21216938,"url":"https://github.com/i7eo/egg-view-liquid","last_synced_at":"2025-07-10T11:33:07.411Z","repository":{"id":57220856,"uuid":"294282693","full_name":"i7eo/egg-view-liquid","owner":"i7eo","description":"egg view plugin for liquidJs","archived":false,"fork":false,"pushed_at":"2023-12-15T05:29:29.000Z","size":92,"stargazers_count":53,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-15T08:47:30.531Z","etag":null,"topics":["egg","egg-plugin","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i7eo.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-10T02:34:58.000Z","updated_at":"2023-10-01T06:11:20.000Z","dependencies_parsed_at":"2023-01-31T10:31:00.477Z","dependency_job_id":null,"html_url":"https://github.com/i7eo/egg-view-liquid","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i7eo%2Fegg-view-liquid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i7eo%2Fegg-view-liquid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i7eo%2Fegg-view-liquid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i7eo%2Fegg-view-liquid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i7eo","download_url":"https://codeload.github.com/i7eo/egg-view-liquid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225637182,"owners_count":17500360,"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":["egg","egg-plugin","nodejs"],"created_at":"2024-11-20T21:56:25.649Z","updated_at":"2024-11-20T21:56:26.271Z","avatar_url":"https://github.com/i7eo.png","language":"JavaScript","readme":"# egg-view-liquid\n\n[![NPM version][npm-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-view-liquid.svg\n[npm-url]: https://npmjs.org/package/egg-view-liquid\n\negg view plugin for [liquid].\n\n## :large_blue_circle: Internationalization\n\nEnglish | [中文文档](README_zh.md)\n\n## Install\n\n```bash\n$ npm i egg-view-liquid --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.liquid = {\n  enable: true,\n  package: 'egg-view-liquid',\n};\n\n// {app_root}/config/config.default.js\nexports.view = {\n  mapping: {\n    '.liquid': 'liquid',\n  },\n};\n\n// liquid config\nexports.liquid = {};\n```\n\nCreate a liquid file\n\n```js\n// app/view/hello.liquid\nhello {{ data }}\n```\n\nRender it\n\n```js\n// app/controller/render.js\nexports.liquid = async ctx =\u003e {\n  await ctx.render('hello.liquid', {\n    data: 'world',\n  });\n};\n```\n\nThe file will be compiled and cached, you can change `config.liquid.cache = false` to disable cache, it's disable in local env by default.\n\n### Include\n\nYou can include both relative and absolute file.\n\nRelative file is resolve from current file path.\n\n```html\n// app/view/a.liquid include app/view/b.liquid\n{% render 'view/b' %}\n```\n\nAbsolute file is resolve from `app/view`.\n\n```html\n// app/view/home.liquid include app/view/partial/menu.liquid\n{% render 'partial/menu' %}\n```\n\n## Tips:\n\n  1. Use when you need to import files: `partial/xxx` not `/partial/xxx`\n\n  2. LiquidJs currently does not support direct use of method calls in files: `Hello {{helper.data()}}` can be replaced with tags or plugins if needed.\n\n  3. Now, if you want to use LiquidJs for like express-ejs-Layout's `contentfor`, just use LiquidJs's `block` instead.\n\n## Configuration\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n\n## :stuck_out_tongue_winking_eye: Authors\n\n[i7eo](https://i7eo.com/about/)\n\n## :copyright: License\n\n[License MIT](LICENSE)\n\n[liquid]: https://github.com/harttle/liquidjs\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi7eo%2Fegg-view-liquid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi7eo%2Fegg-view-liquid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi7eo%2Fegg-view-liquid/lists"}