{"action":"closed","issue":{"url":"https://api.github.com/repos/shannonmoeller/handlebars-layouts/issues/38","repository_url":"https://api.github.com/repos/shannonmoeller/handlebars-layouts","labels_url":"https://api.github.com/repos/shannonmoeller/handlebars-layouts/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/shannonmoeller/handlebars-layouts/issues/38/comments","events_url":"https://api.github.com/repos/shannonmoeller/handlebars-layouts/issues/38/events","html_url":"https://github.com/shannonmoeller/handlebars-layouts/issues/38","id":208940908,"number":38,"title":"Trying to get this to work with Express","user":{"login":"Jazcash","id":1434248,"avatar_url":"https://avatars.githubusercontent.com/u/1434248?v=3","gravatar_id":"","url":"https://api.github.com/users/Jazcash","html_url":"https://github.com/Jazcash","followers_url":"https://api.github.com/users/Jazcash/followers","following_url":"https://api.github.com/users/Jazcash/following{/other_user}","gists_url":"https://api.github.com/users/Jazcash/gists{/gist_id}","starred_url":"https://api.github.com/users/Jazcash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jazcash/subscriptions","organizations_url":"https://api.github.com/users/Jazcash/orgs","repos_url":"https://api.github.com/users/Jazcash/repos","events_url":"https://api.github.com/users/Jazcash/events{/privacy}","received_events_url":"https://api.github.com/users/Jazcash/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-02-20T17:21:32Z","updated_at":"2017-02-21T13:05:42Z","closed_at":"2017-02-21T13:05:42Z","body":"I saw there was another closed issue about this but it didn't really help me. I have a frontend framework that's currently using this plugin with gulp to compile my templates into HTML but now I'm looking to move to an express server and for the server to serve the templates as responses instead.\r\n\r\nHere's a simplified version of what I'm working with:\r\n\r\nDirectories:\r\n```\r\n- app.js\r\n- build\r\n- src\r\n    - layouts\r\n        - main.hbs\r\n        - generic.hbs\r\n    - partials\r\n        - header.hbs\r\n    - pages\r\n        - index.hbs\r\n    - styles\r\n    - scripts\r\n    - images\r\n```\r\n\r\napp.js\r\n```js\r\nlet express = require(\"express\");\r\nlet exphbs = require(\"express-handlebars\");\r\nlet layouts = require(\"handlebars-layouts\");\r\n\r\nlet app = express();\r\n\r\nlet hbs = exphbs.create({\r\n\textname: \".hbs\",\r\n\tlayoutsDir: \"src/layouts/\",\r\n\tdefaultLayout: \"main\",\r\n\tpartialsDir: [\"src/partials/\"]\r\n});\r\n\r\nvar handlebars = hbs.handlebars;\r\n\r\nhandlebars.registerHelper(layouts(handlebars));\r\n\r\napp.engine(\".hbs\", hbs.engine);\r\napp.set(\"view engine\", \".hbs\");\r\napp.set(\"views\", \"src/\");\r\n\r\napp.get(\"/\", function (req, res) {\r\n\tres.render(\"pages/index\");\r\n});\r\n\r\napp.listen(3000, function(){\r\n\tconsole.log(\"Now listening on port 3000\");\r\n});\r\n```\r\n\r\nindex.hbs\r\n```\r\n{{#extend \"generic\"}}\r\n\t{{#content \"content\"}}\r\n\t\tHello world\r\n\t{{/content}}\r\n{{/extend}}\r\n```\r\n\r\ngeneric.hbs\r\n```\r\n{{#extend \"main\"}}\r\n\t{{#content \"body\"}}\r\n\t\t<div class=\"padded-h-xl padded-v-md\">\r\n\t\t\t{{#block \"content\"}}{{/block}}\r\n\t\t</div>\r\n\t{{/content}}\r\n{{/extend}}\r\n```\r\n\r\nAnd the error I get:\r\n```\r\nError: Missing partial: 'generic'\r\n```\r\n\r\nNo idea if I'm going about this the right way or not. I tried searching for \"express-handlebars\" and \"handlebars-layouts\" to try and find some code examples of them both being used together but couldn't find anything useful.\r\n\r\nAny ideas?"}}
{"actor":{"display_login":"shannonmoeller"}}