{"action":"created","issue":{"url":"https://api.github.com/repos/prose/prose/issues/877","labels_url":"https://api.github.com/repos/prose/prose/issues/877/labels{/name}","comments_url":"https://api.github.com/repos/prose/prose/issues/877/comments","events_url":"https://api.github.com/repos/prose/prose/issues/877/events","html_url":"https://github.com/prose/prose/issues/877","id":103255404,"number":877,"title":"Config only allows one hidden element since `metadata.js` refactor","user":{"login":"tomsabin","id":885223,"avatar_url":"https://avatars.githubusercontent.com/u/885223?v=3","gravatar_id":"","url":"https://api.github.com/users/tomsabin","html_url":"https://github.com/tomsabin","followers_url":"https://api.github.com/users/tomsabin/followers","following_url":"https://api.github.com/users/tomsabin/following{/other_user}","gists_url":"https://api.github.com/users/tomsabin/gists{/gist_id}","starred_url":"https://api.github.com/users/tomsabin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomsabin/subscriptions","organizations_url":"https://api.github.com/users/tomsabin/orgs","repos_url":"https://api.github.com/users/tomsabin/repos","events_url":"https://api.github.com/users/tomsabin/events{/privacy}","received_events_url":"https://api.github.com/users/tomsabin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-26T12:30:25Z","updated_at":"2015-08-26T12:34:28Z","closed_at":null,"body":"With a config file that has multiple hidden fields, only the last hidden element is rendered in the front matter. From my understanding this was introduced in 0060a9fd2d85790749eb225e4d7be07b4f918c16 (10th August):\r\n\r\nin [`app/views/metadata.js:147`](https://github.com/prose/prose/blob/master/app/views/metadata.js#L147), the model's `metadata` is being rewritten multiple times (depending on how many hidden elements you have), but not actually extending the hash correctly. This is because the variable `metadata` has been assigned to `this.model.get('metadata')` before iterating over the YML config begins.\r\n\r\nChanging line 147 from:\r\n\r\n```JS\r\nthis.model.set('metadata', _.extend(newMeta, metadata));\r\n```\r\n\r\nto:\r\n\r\n```JS\r\nthis.model.set('metadata', _.extend(newMeta, this.model.get('metadata')));\r\n```\r\n\r\nensures that each time in the iteration we are always getting the latest metadata."},"comment":{"url":"https://api.github.com/repos/prose/prose/issues/comments/134985621","html_url":"https://github.com/prose/prose/issues/877#issuecomment-134985621","issue_url":"https://api.github.com/repos/prose/prose/issues/877","id":134985621,"user":{"login":"tomsabin","id":885223,"avatar_url":"https://avatars.githubusercontent.com/u/885223?v=3","gravatar_id":"","url":"https://api.github.com/users/tomsabin","html_url":"https://github.com/tomsabin","followers_url":"https://api.github.com/users/tomsabin/followers","following_url":"https://api.github.com/users/tomsabin/following{/other_user}","gists_url":"https://api.github.com/users/tomsabin/gists{/gist_id}","starred_url":"https://api.github.com/users/tomsabin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomsabin/subscriptions","organizations_url":"https://api.github.com/users/tomsabin/orgs","repos_url":"https://api.github.com/users/tomsabin/repos","events_url":"https://api.github.com/users/tomsabin/events{/privacy}","received_events_url":"https://api.github.com/users/tomsabin/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T12:34:28Z","updated_at":"2015-08-26T12:34:28Z","body":"@dereklieu, certainly - I'm working on that now"}}