{"id":18539068,"url":"https://github.com/simov/hapi-hogan","last_synced_at":"2025-05-15T02:13:46.615Z","repository":{"id":27640762,"uuid":"31125491","full_name":"simov/hapi-hogan","owner":"simov","description":"Hogan.js templating in Hapi.js","archived":false,"fork":false,"pushed_at":"2015-08-28T06:37:49.000Z","size":136,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T10:41:34.612Z","etag":null,"topics":[],"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/simov.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":"2015-02-21T12:51:16.000Z","updated_at":"2018-03-02T20:36:02.000Z","dependencies_parsed_at":"2022-09-20T08:36:12.300Z","dependency_job_id":null,"html_url":"https://github.com/simov/hapi-hogan","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/simov%2Fhapi-hogan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fhapi-hogan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fhapi-hogan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simov%2Fhapi-hogan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simov","download_url":"https://codeload.github.com/simov/hapi-hogan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259444,"owners_count":22040822,"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":[],"created_at":"2024-11-06T19:46:07.058Z","updated_at":"2025-05-15T02:13:46.597Z","avatar_url":"https://github.com/simov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# hapi-hogan\n\n```js\nvar Hapi = require('hapi')\n  , hogan = require('hapi-hogan')\n\nserver = new Hapi.Server()\nserver.connection({host:'localhost', port:3000})\n\nserver.route({method:'GET', path:'/', handler:function (req, res) {\n    res.view('layout', {name:'simo', partials: {header:'header'}})\n  }\n})\nserver.views({\n  relativeTo:__dirname,\n  path:'./views',\n  engines: {\n    html:{\n      module: hogan,\n      compileMode: 'sync',\n      compileOptions: {\n        partialsPath: path.join(__dirname, 'partials'),\n        isCached: true\n      }\n    }\n  }\n})\nserver.start()\n```\n\nJust like in [consolidate][consolidate] pass your partials using the `partials` key\n\n```js\nserver.route({method:'GET', path:'/', handler:function (req, res) {\n    res.view('layout', {name:'simo', partials: {header:'header'}})\n  }\n})\n```\n\nHere `header` is the name of your `{{\u003eheader}}` partial and the 'header' string is the relative path to it. In the above example thats the `header.html` file located in the `partials` folder\n\n```js\nserver.views({\n  relativeTo:__dirname,\n  path:'./views',\n  engines: {\n    html:{\n      module: hogan,\n      compileMode: 'sync',\n      compileOptions: {\n        partialsPath: path.join(__dirname, 'partials'),\n        isCached: true\n      }\n    }\n  }\n})\n```\n\n`partialsPath` is the absolute path to your partials folder. The partials are cached by default, to disable it set `isCached` to `false`. Both of these two options should be placed inside the `compileOptions` key\n\n\n  [consolidate]: https://github.com/tj/consolidate.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimov%2Fhapi-hogan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimov%2Fhapi-hogan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimov%2Fhapi-hogan/lists"}