{"action":"created","issue":{"url":"https://api.github.com/repos/foundersandcoders/express-handlebars-workshop/issues/17","repository_url":"https://api.github.com/repos/foundersandcoders/express-handlebars-workshop","labels_url":"https://api.github.com/repos/foundersandcoders/express-handlebars-workshop/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/foundersandcoders/express-handlebars-workshop/issues/17/comments","events_url":"https://api.github.com/repos/foundersandcoders/express-handlebars-workshop/issues/17/events","html_url":"https://github.com/foundersandcoders/express-handlebars-workshop/issues/17","id":295879463,"number":17,"title":"Script tag position needs changing? ","user":{"login":"jamiecoe","id":18463718,"avatar_url":"https://avatars3.githubusercontent.com/u/18463718?v=4","gravatar_id":"","url":"https://api.github.com/users/jamiecoe","html_url":"https://github.com/jamiecoe","followers_url":"https://api.github.com/users/jamiecoe/followers","following_url":"https://api.github.com/users/jamiecoe/following{/other_user}","gists_url":"https://api.github.com/users/jamiecoe/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiecoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiecoe/subscriptions","organizations_url":"https://api.github.com/users/jamiecoe/orgs","repos_url":"https://api.github.com/users/jamiecoe/repos","events_url":"https://api.github.com/users/jamiecoe/events{/privacy}","received_events_url":"https://api.github.com/users/jamiecoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"eliascodes","id":12719553,"avatar_url":"https://avatars3.githubusercontent.com/u/12719553?v=4","gravatar_id":"","url":"https://api.github.com/users/eliascodes","html_url":"https://github.com/eliascodes","followers_url":"https://api.github.com/users/eliascodes/followers","following_url":"https://api.github.com/users/eliascodes/following{/other_user}","gists_url":"https://api.github.com/users/eliascodes/gists{/gist_id}","starred_url":"https://api.github.com/users/eliascodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliascodes/subscriptions","organizations_url":"https://api.github.com/users/eliascodes/orgs","repos_url":"https://api.github.com/users/eliascodes/repos","events_url":"https://api.github.com/users/eliascodes/events{/privacy}","received_events_url":"https://api.github.com/users/eliascodes/received_events","type":"User","site_admin":false},"assignees":[{"login":"eliascodes","id":12719553,"avatar_url":"https://avatars3.githubusercontent.com/u/12719553?v=4","gravatar_id":"","url":"https://api.github.com/users/eliascodes","html_url":"https://github.com/eliascodes","followers_url":"https://api.github.com/users/eliascodes/followers","following_url":"https://api.github.com/users/eliascodes/following{/other_user}","gists_url":"https://api.github.com/users/eliascodes/gists{/gist_id}","starred_url":"https://api.github.com/users/eliascodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliascodes/subscriptions","organizations_url":"https://api.github.com/users/eliascodes/orgs","repos_url":"https://api.github.com/users/eliascodes/repos","events_url":"https://api.github.com/users/eliascodes/events{/privacy}","received_events_url":"https://api.github.com/users/eliascodes/received_events","type":"User","site_admin":false},{"login":"astroash","id":14337958,"avatar_url":"https://avatars3.githubusercontent.com/u/14337958?v=4","gravatar_id":"","url":"https://api.github.com/users/astroash","html_url":"https://github.com/astroash","followers_url":"https://api.github.com/users/astroash/followers","following_url":"https://api.github.com/users/astroash/following{/other_user}","gists_url":"https://api.github.com/users/astroash/gists{/gist_id}","starred_url":"https://api.github.com/users/astroash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astroash/subscriptions","organizations_url":"https://api.github.com/users/astroash/orgs","repos_url":"https://api.github.com/users/astroash/repos","events_url":"https://api.github.com/users/astroash/events{/privacy}","received_events_url":"https://api.github.com/users/astroash/received_events","type":"User","site_admin":false},{"login":"PiotrBerebecki","id":17753038,"avatar_url":"https://avatars2.githubusercontent.com/u/17753038?v=4","gravatar_id":"","url":"https://api.github.com/users/PiotrBerebecki","html_url":"https://github.com/PiotrBerebecki","followers_url":"https://api.github.com/users/PiotrBerebecki/followers","following_url":"https://api.github.com/users/PiotrBerebecki/following{/other_user}","gists_url":"https://api.github.com/users/PiotrBerebecki/gists{/gist_id}","starred_url":"https://api.github.com/users/PiotrBerebecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PiotrBerebecki/subscriptions","organizations_url":"https://api.github.com/users/PiotrBerebecki/orgs","repos_url":"https://api.github.com/users/PiotrBerebecki/repos","events_url":"https://api.github.com/users/PiotrBerebecki/events{/privacy}","received_events_url":"https://api.github.com/users/PiotrBerebecki/received_events","type":"User","site_admin":false},{"login":"m4v15","id":23310908,"avatar_url":"https://avatars0.githubusercontent.com/u/23310908?v=4","gravatar_id":"","url":"https://api.github.com/users/m4v15","html_url":"https://github.com/m4v15","followers_url":"https://api.github.com/users/m4v15/followers","following_url":"https://api.github.com/users/m4v15/following{/other_user}","gists_url":"https://api.github.com/users/m4v15/gists{/gist_id}","starred_url":"https://api.github.com/users/m4v15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m4v15/subscriptions","organizations_url":"https://api.github.com/users/m4v15/orgs","repos_url":"https://api.github.com/users/m4v15/repos","events_url":"https://api.github.com/users/m4v15/events{/privacy}","received_events_url":"https://api.github.com/users/m4v15/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-02-09T13:58:01Z","updated_at":"2018-02-09T16:18:43Z","closed_at":null,"author_association":"MEMBER","body":"In the solution folder, the suggested position for the `<script>` tag in `fruits.hbs` is here:\r\n\r\nhttps://github.com/foundersandcoders/express-handlebars-workshop/blob/7252e3c49868c30e3dc4fa5af943cb8ca816e0fe/solution/src/views/fruits.hbs#L29\r\n\r\nI would suggest that this is confusing, as the script tag then gets rendered inside the `<main>` tag.\r\n\r\n<img width=\"645\" alt=\"screen shot 2018-02-09 at 13 51 29\" src=\"https://user-images.githubusercontent.com/18463718/36031043-67cf42e8-0da1-11e8-8679-0c9ae69c2678.png\">\r\n\r\nBest practice would be for the `<script>` tag to go in the `<head>` or at the bottom of the `<body>`. Also the fruits page has both `main.js` and `fruit-fav.js` included in it, which may or may not be correct?   \r\n\r\nMy solution to this would be to make a partial for the `<script>` tag, and pass in the `src` value when you render the template. eg:\r\n\r\n```js\r\nres.render('home', {\r\n    activePage: { home: true },\r\n    script: '/js/main.js' \r\n});\r\n```\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/foundersandcoders/express-handlebars-workshop/issues/comments/364480537","html_url":"https://github.com/foundersandcoders/express-handlebars-workshop/issues/17#issuecomment-364480537","issue_url":"https://api.github.com/repos/foundersandcoders/express-handlebars-workshop/issues/17","id":364480537,"user":{"login":"jamiecoe","id":18463718,"avatar_url":"https://avatars3.githubusercontent.com/u/18463718?v=4","gravatar_id":"","url":"https://api.github.com/users/jamiecoe","html_url":"https://github.com/jamiecoe","followers_url":"https://api.github.com/users/jamiecoe/followers","following_url":"https://api.github.com/users/jamiecoe/following{/other_user}","gists_url":"https://api.github.com/users/jamiecoe/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiecoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiecoe/subscriptions","organizations_url":"https://api.github.com/users/jamiecoe/orgs","repos_url":"https://api.github.com/users/jamiecoe/repos","events_url":"https://api.github.com/users/jamiecoe/events{/privacy}","received_events_url":"https://api.github.com/users/jamiecoe/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T16:18:43Z","updated_at":"2018-02-09T16:18:43Z","author_association":"MEMBER","body":"I've just had a chat about this with @astroash, she suggests it would be better to always include `<script src=\"/js/main.js\"></script> ` on every page. However, `fruit-fav.js` should be included in an additional <script> tag in when `fruits.hbs` is rendered, although this should be positioned next to the `main.js` <script> tag at the bottom of the <body>.\r\n\r\nI suggest that this is done with a `{{#if fruitsScript}}` statement inside `main.hbs`, and we pass in an `fruitsScript: true` when we render `fruits.hbs`. I can make a PR to add this approach to the solution folder.       "}}
{"actor":{"display_login":"jamiecoe"}}