{"id":16326679,"url":"https://github.com/chrisyip/egg-view-pug","last_synced_at":"2025-03-20T22:31:48.463Z","repository":{"id":53598610,"uuid":"83266881","full_name":"chrisyip/egg-view-pug","owner":"chrisyip","description":"egg view plugin for pug.","archived":false,"fork":false,"pushed_at":"2021-03-22T06:56:10.000Z","size":185,"stargazers_count":23,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T02:37:33.213Z","etag":null,"topics":["egg","egg-plugin","egg-view","pug"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/chrisyip.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-02-27T04:07:58.000Z","updated_at":"2025-02-11T03:11:25.000Z","dependencies_parsed_at":"2022-09-07T13:01:40.872Z","dependency_job_id":null,"html_url":"https://github.com/chrisyip/egg-view-pug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fegg-view-pug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fegg-view-pug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fegg-view-pug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fegg-view-pug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisyip","download_url":"https://codeload.github.com/chrisyip/egg-view-pug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244703938,"owners_count":20496207,"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","egg-view","pug"],"created_at":"2024-10-10T23:09:16.774Z","updated_at":"2025-03-20T22:31:48.156Z","avatar_url":"https://github.com/chrisyip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egg-view-pug\n\n[![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Travis CI][travis-image]][travis-url] [![codecov][codecov-image]][codecov-url]\n\negg view plugin for [pug](https://pugjs.org/).\n\n**V2 supports pug v3 and therefore [requires node \u003e= 10](https://pugjs.org/api/migration-v3.html)**.\n\n## Install\n\n```\nnpm i egg-view-pug --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.pug = {\n  enable: true,\n  package: 'egg-view-pug'\n}\n\n// {app_root}/config/config.default.js\nexports.view = {\n  mapping: {\n    '.pug': 'pug',\n  }\n}\n\n// configuration\nexports.pug = {}\n```\n\nCreate a pug file\n\n```pug\n//- app/view/hello.pug\n\nextend layout/main\n\nblock header\n  include partial/header\n\nblock content\n  | hello #{data}\n```\n\nRender it\n\n```js\n// app/controller/CONTROLLER.js\nexports = {\n  async ACTION (ctx) {\n    await ctx.render('hello.pug', {\n      data: 'world'\n    })\n  }\n}\n```\n\nThe file will be compiled and cached, you can change `config.pug.cache = false` to disable cache, it's disable in local env by default.\n\n## Configuration\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n[npm-url]: https://npmjs.org/package/egg-view-pug\n[npm-image]: http://img.shields.io/npm/v/egg-view-pug.svg?style=flat-square\n[daviddm-url]: https://david-dm.org/chrisyip/egg-view-pug\n[daviddm-image]: http://img.shields.io/david/chrisyip/egg-view-pug.svg?style=flat-square\n[travis-url]: https://travis-ci.org/chrisyip/egg-view-pug\n[travis-image]: http://img.shields.io/travis/chrisyip/egg-view-pug.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/chrisyip/egg-view-pug\n[codecov-image]: https://img.shields.io/codecov/c/github/chrisyip/egg-view-pug.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fegg-view-pug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisyip%2Fegg-view-pug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fegg-view-pug/lists"}