{"action":"created","comment":{"url":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments/27067341","id":27067341,"diff_hunk":"@@ -14,30 +14,29 @@ var _           = require('lodash'),\n meta_title = function (options) {\n     /*jshint unused:false*/\n     var title = '',\n-        blog,\n-        page,\n-        pageString = '',\n-        pagePattern = new RegExp('\\\\/' + config.routeKeywords.page + '\\\\/(\\\\d+)');\n+        context = options.data.root.context,\n+        blog = config.theme,\n+        pagination = options.data.root.pagination,\n+        pageString = '';\n \n-    if (_.isString(this.relativeUrl)) {\n-        blog = config.theme;\n-        page = this.relativeUrl.match(pagePattern);\n-        if (page) {\n-            pageString = ' - Page ' + page[1];\n-        }\n+    if (pagination && pagination.total > 1) {\n+        pageString = ' - Page ' + pagination.page;\n+    }\n \n-        if (!this.relativeUrl || this.relativeUrl === '/' || this.relativeUrl === '') {\n-            title = blog.title;\n-        } else if (this.author) {\n-            title = this.author.name + pageString + ' - ' + blog.title;\n-        } else if (this.tag) {\n-            title = _.isEmpty(this.tag.meta_title) ? this.tag.name + pageString + ' - ' + blog.title : this.tag.meta_title;\n-        } else if (this.post) {\n-            title = _.isEmpty(this.post.meta_title) ? this.post.title : this.post.meta_title;\n-        } else {\n-            title = blog.title + pageString;\n-        }\n+    if (this.meta_title) {\n+        title = this.meta_title;  // E.g. in {{#foreach}}\n+    } else if (_.contains(context, 'home')) {\n+        title = blog.title;\n+    } else if (_.contains(context, 'author') && this.author) {\n+        title = this.author.name + pageString + ' - ' + blog.title;\n+    } else if (_.contains(context, 'tag') && this.tag) {\n+        title = this.tag.meta_title || this.tag.name + pageString + ' - ' + blog.title;\n+    } else if (_.contains(context, 'post') && this.post) {\n+        title = this.post.meta_title || this.post.title;\n+    } else {\n+        title = title = blog.title + pageString;","path":"core/server/helpers/meta_title.js","position":45,"original_position":45,"commit_id":"c8a2bc2ee1ba1ad8d17d609c3235508021f2ec2f","original_commit_id":"c8a2bc2ee1ba1ad8d17d609c3235508021f2ec2f","user":{"login":"ErisDS","id":101513,"avatar_url":"https://avatars.githubusercontent.com/u/101513?v=3","gravatar_id":"","url":"https://api.github.com/users/ErisDS","html_url":"https://github.com/ErisDS","followers_url":"https://api.github.com/users/ErisDS/followers","following_url":"https://api.github.com/users/ErisDS/following{/other_user}","gists_url":"https://api.github.com/users/ErisDS/gists{/gist_id}","starred_url":"https://api.github.com/users/ErisDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErisDS/subscriptions","organizations_url":"https://api.github.com/users/ErisDS/orgs","repos_url":"https://api.github.com/users/ErisDS/repos","events_url":"https://api.github.com/users/ErisDS/events{/privacy}","received_events_url":"https://api.github.com/users/ErisDS/received_events","type":"User","site_admin":false},"body":"Ickle typo :space_invader: ","created_at":"2015-03-24T20:05:54Z","updated_at":"2015-03-24T20:05:54Z","html_url":"https://github.com/TryGhost/Ghost/pull/5068#discussion_r27067341","pull_request_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068","_links":{"self":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments/27067341"},"html":{"href":"https://github.com/TryGhost/Ghost/pull/5068#discussion_r27067341"},"pull_request":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068"}}},"pull_request":{"url":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068","id":31827750,"html_url":"https://github.com/TryGhost/Ghost/pull/5068","diff_url":"https://github.com/TryGhost/Ghost/pull/5068.diff","patch_url":"https://github.com/TryGhost/Ghost/pull/5068.patch","issue_url":"https://api.github.com/repos/TryGhost/Ghost/issues/5068","number":5068,"state":"open","locked":false,"title":"Rewrite meta_description and meta_title to depend upon the current context","user":{"login":"msiemens","id":1873922,"avatar_url":"https://avatars.githubusercontent.com/u/1873922?v=3","gravatar_id":"","url":"https://api.github.com/users/msiemens","html_url":"https://github.com/msiemens","followers_url":"https://api.github.com/users/msiemens/followers","following_url":"https://api.github.com/users/msiemens/following{/other_user}","gists_url":"https://api.github.com/users/msiemens/gists{/gist_id}","starred_url":"https://api.github.com/users/msiemens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msiemens/subscriptions","organizations_url":"https://api.github.com/users/msiemens/orgs","repos_url":"https://api.github.com/users/msiemens/repos","events_url":"https://api.github.com/users/msiemens/events{/privacy}","received_events_url":"https://api.github.com/users/msiemens/received_events","type":"User","site_admin":false},"body":"closes #4850\r\n\r\n- fixed `meta_description` and `meta_title` when used within a `{{#foreach}}`\r\n- `meta_description` and `meta_title` now depend upon the current context\r\n  to get the right string (author bio, tag description, ...).\r\n  Note: `ghost_head.js` and `ghost_head_spec.js` have been touched to add\r\n  the required context information when calling the helpers.","created_at":"2015-03-24T13:52:45Z","updated_at":"2015-03-24T20:05:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e624b225a1e1a753339e35296168d0bcefebfea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068/commits","review_comments_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068/comments","review_comment_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/issues/5068/comments","statuses_url":"https://api.github.com/repos/TryGhost/Ghost/statuses/c8a2bc2ee1ba1ad8d17d609c3235508021f2ec2f","head":{"label":"msiemens:meta_description_v2","ref":"meta_description_v2","sha":"c8a2bc2ee1ba1ad8d17d609c3235508021f2ec2f","user":{"login":"msiemens","id":1873922,"avatar_url":"https://avatars.githubusercontent.com/u/1873922?v=3","gravatar_id":"","url":"https://api.github.com/users/msiemens","html_url":"https://github.com/msiemens","followers_url":"https://api.github.com/users/msiemens/followers","following_url":"https://api.github.com/users/msiemens/following{/other_user}","gists_url":"https://api.github.com/users/msiemens/gists{/gist_id}","starred_url":"https://api.github.com/users/msiemens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msiemens/subscriptions","organizations_url":"https://api.github.com/users/msiemens/orgs","repos_url":"https://api.github.com/users/msiemens/repos","events_url":"https://api.github.com/users/msiemens/events{/privacy}","received_events_url":"https://api.github.com/users/msiemens/received_events","type":"User","site_admin":false},"repo":{"id":29781103,"name":"Ghost","full_name":"msiemens/Ghost","owner":{"login":"msiemens","id":1873922,"avatar_url":"https://avatars.githubusercontent.com/u/1873922?v=3","gravatar_id":"","url":"https://api.github.com/users/msiemens","html_url":"https://github.com/msiemens","followers_url":"https://api.github.com/users/msiemens/followers","following_url":"https://api.github.com/users/msiemens/following{/other_user}","gists_url":"https://api.github.com/users/msiemens/gists{/gist_id}","starred_url":"https://api.github.com/users/msiemens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msiemens/subscriptions","organizations_url":"https://api.github.com/users/msiemens/orgs","repos_url":"https://api.github.com/users/msiemens/repos","events_url":"https://api.github.com/users/msiemens/events{/privacy}","received_events_url":"https://api.github.com/users/msiemens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/msiemens/Ghost","description":"Just a blogging platform","fork":true,"url":"https://api.github.com/repos/msiemens/Ghost","forks_url":"https://api.github.com/repos/msiemens/Ghost/forks","keys_url":"https://api.github.com/repos/msiemens/Ghost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/msiemens/Ghost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/msiemens/Ghost/teams","hooks_url":"https://api.github.com/repos/msiemens/Ghost/hooks","issue_events_url":"https://api.github.com/repos/msiemens/Ghost/issues/events{/number}","events_url":"https://api.github.com/repos/msiemens/Ghost/events","assignees_url":"https://api.github.com/repos/msiemens/Ghost/assignees{/user}","branches_url":"https://api.github.com/repos/msiemens/Ghost/branches{/branch}","tags_url":"https://api.github.com/repos/msiemens/Ghost/tags","blobs_url":"https://api.github.com/repos/msiemens/Ghost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/msiemens/Ghost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/msiemens/Ghost/git/refs{/sha}","trees_url":"https://api.github.com/repos/msiemens/Ghost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/msiemens/Ghost/statuses/{sha}","languages_url":"https://api.github.com/repos/msiemens/Ghost/languages","stargazers_url":"https://api.github.com/repos/msiemens/Ghost/stargazers","contributors_url":"https://api.github.com/repos/msiemens/Ghost/contributors","subscribers_url":"https://api.github.com/repos/msiemens/Ghost/subscribers","subscription_url":"https://api.github.com/repos/msiemens/Ghost/subscription","commits_url":"https://api.github.com/repos/msiemens/Ghost/commits{/sha}","git_commits_url":"https://api.github.com/repos/msiemens/Ghost/git/commits{/sha}","comments_url":"https://api.github.com/repos/msiemens/Ghost/comments{/number}","issue_comment_url":"https://api.github.com/repos/msiemens/Ghost/issues/comments{/number}","contents_url":"https://api.github.com/repos/msiemens/Ghost/contents/{+path}","compare_url":"https://api.github.com/repos/msiemens/Ghost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/msiemens/Ghost/merges","archive_url":"https://api.github.com/repos/msiemens/Ghost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/msiemens/Ghost/downloads","issues_url":"https://api.github.com/repos/msiemens/Ghost/issues{/number}","pulls_url":"https://api.github.com/repos/msiemens/Ghost/pulls{/number}","milestones_url":"https://api.github.com/repos/msiemens/Ghost/milestones{/number}","notifications_url":"https://api.github.com/repos/msiemens/Ghost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/msiemens/Ghost/labels{/name}","releases_url":"https://api.github.com/repos/msiemens/Ghost/releases{/id}","created_at":"2015-01-24T15:33:31Z","updated_at":"2015-01-24T15:33:34Z","pushed_at":"2015-03-24T13:48:48Z","git_url":"git://github.com/msiemens/Ghost.git","ssh_url":"git@github.com:msiemens/Ghost.git","clone_url":"https://github.com/msiemens/Ghost.git","svn_url":"https://github.com/msiemens/Ghost","homepage":"https://ghost.org","size":15297,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TryGhost:master","ref":"master","sha":"7ad47e92401b2e35bb80dcfe135c576858a1eb02","user":{"login":"TryGhost","id":2178663,"avatar_url":"https://avatars.githubusercontent.com/u/2178663?v=3","gravatar_id":"","url":"https://api.github.com/users/TryGhost","html_url":"https://github.com/TryGhost","followers_url":"https://api.github.com/users/TryGhost/followers","following_url":"https://api.github.com/users/TryGhost/following{/other_user}","gists_url":"https://api.github.com/users/TryGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/TryGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TryGhost/subscriptions","organizations_url":"https://api.github.com/users/TryGhost/orgs","repos_url":"https://api.github.com/users/TryGhost/repos","events_url":"https://api.github.com/users/TryGhost/events{/privacy}","received_events_url":"https://api.github.com/users/TryGhost/received_events","type":"Organization","site_admin":false},"repo":{"id":9852918,"name":"Ghost","full_name":"TryGhost/Ghost","owner":{"login":"TryGhost","id":2178663,"avatar_url":"https://avatars.githubusercontent.com/u/2178663?v=3","gravatar_id":"","url":"https://api.github.com/users/TryGhost","html_url":"https://github.com/TryGhost","followers_url":"https://api.github.com/users/TryGhost/followers","following_url":"https://api.github.com/users/TryGhost/following{/other_user}","gists_url":"https://api.github.com/users/TryGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/TryGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TryGhost/subscriptions","organizations_url":"https://api.github.com/users/TryGhost/orgs","repos_url":"https://api.github.com/users/TryGhost/repos","events_url":"https://api.github.com/users/TryGhost/events{/privacy}","received_events_url":"https://api.github.com/users/TryGhost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TryGhost/Ghost","description":"Just a blogging platform","fork":false,"url":"https://api.github.com/repos/TryGhost/Ghost","forks_url":"https://api.github.com/repos/TryGhost/Ghost/forks","keys_url":"https://api.github.com/repos/TryGhost/Ghost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TryGhost/Ghost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TryGhost/Ghost/teams","hooks_url":"https://api.github.com/repos/TryGhost/Ghost/hooks","issue_events_url":"https://api.github.com/repos/TryGhost/Ghost/issues/events{/number}","events_url":"https://api.github.com/repos/TryGhost/Ghost/events","assignees_url":"https://api.github.com/repos/TryGhost/Ghost/assignees{/user}","branches_url":"https://api.github.com/repos/TryGhost/Ghost/branches{/branch}","tags_url":"https://api.github.com/repos/TryGhost/Ghost/tags","blobs_url":"https://api.github.com/repos/TryGhost/Ghost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TryGhost/Ghost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TryGhost/Ghost/git/refs{/sha}","trees_url":"https://api.github.com/repos/TryGhost/Ghost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TryGhost/Ghost/statuses/{sha}","languages_url":"https://api.github.com/repos/TryGhost/Ghost/languages","stargazers_url":"https://api.github.com/repos/TryGhost/Ghost/stargazers","contributors_url":"https://api.github.com/repos/TryGhost/Ghost/contributors","subscribers_url":"https://api.github.com/repos/TryGhost/Ghost/subscribers","subscription_url":"https://api.github.com/repos/TryGhost/Ghost/subscription","commits_url":"https://api.github.com/repos/TryGhost/Ghost/commits{/sha}","git_commits_url":"https://api.github.com/repos/TryGhost/Ghost/git/commits{/sha}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/comments{/number}","issue_comment_url":"https://api.github.com/repos/TryGhost/Ghost/issues/comments{/number}","contents_url":"https://api.github.com/repos/TryGhost/Ghost/contents/{+path}","compare_url":"https://api.github.com/repos/TryGhost/Ghost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TryGhost/Ghost/merges","archive_url":"https://api.github.com/repos/TryGhost/Ghost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TryGhost/Ghost/downloads","issues_url":"https://api.github.com/repos/TryGhost/Ghost/issues{/number}","pulls_url":"https://api.github.com/repos/TryGhost/Ghost/pulls{/number}","milestones_url":"https://api.github.com/repos/TryGhost/Ghost/milestones{/number}","notifications_url":"https://api.github.com/repos/TryGhost/Ghost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TryGhost/Ghost/labels{/name}","releases_url":"https://api.github.com/repos/TryGhost/Ghost/releases{/id}","created_at":"2013-05-04T11:09:13Z","updated_at":"2015-03-24T19:54:37Z","pushed_at":"2015-03-24T17:33:46Z","git_url":"git://github.com/TryGhost/Ghost.git","ssh_url":"git@github.com:TryGhost/Ghost.git","clone_url":"https://github.com/TryGhost/Ghost.git","svn_url":"https://github.com/TryGhost/Ghost","homepage":"https://ghost.org","size":61636,"stargazers_count":14508,"watchers_count":14508,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3383,"mirror_url":null,"open_issues_count":203,"forks":3383,"open_issues":203,"watchers":14508,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068"},"html":{"href":"https://github.com/TryGhost/Ghost/pull/5068"},"issue":{"href":"https://api.github.com/repos/TryGhost/Ghost/issues/5068"},"comments":{"href":"https://api.github.com/repos/TryGhost/Ghost/issues/5068/comments"},"review_comments":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068/comments"},"review_comment":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/5068/commits"},"statuses":{"href":"https://api.github.com/repos/TryGhost/Ghost/statuses/c8a2bc2ee1ba1ad8d17d609c3235508021f2ec2f"}}}}