{"action":"closed","issue":{"url":"https://api.github.com/repos/spf13/hugo/issues/2135","repository_url":"https://api.github.com/repos/spf13/hugo","labels_url":"https://api.github.com/repos/spf13/hugo/issues/2135/labels{/name}","comments_url":"https://api.github.com/repos/spf13/hugo/issues/2135/comments","events_url":"https://api.github.com/repos/spf13/hugo/issues/2135/events","html_url":"https://github.com/spf13/hugo/issues/2135","id":153659768,"number":2135,"title":"Feature request: extend post frontmatter with data files","user":{"login":"fj","id":57813,"avatar_url":"https://avatars1.githubusercontent.com/u/57813?v=3","gravatar_id":"","url":"https://api.github.com/users/fj","html_url":"https://github.com/fj","followers_url":"https://api.github.com/users/fj/followers","following_url":"https://api.github.com/users/fj/following{/other_user}","gists_url":"https://api.github.com/users/fj/gists{/gist_id}","starred_url":"https://api.github.com/users/fj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fj/subscriptions","organizations_url":"https://api.github.com/users/fj/orgs","repos_url":"https://api.github.com/users/fj/repos","events_url":"https://api.github.com/users/fj/events{/privacy}","received_events_url":"https://api.github.com/users/fj/received_events","type":"User","site_admin":false},"labels":[{"id":508451898,"url":"https://api.github.com/repos/spf13/hugo/labels/Stale","name":"Stale","color":"c5def5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-05-08T14:52:32Z","updated_at":"2017-03-27T23:28:52Z","closed_at":"2017-03-27T23:28:52Z","body":"This is a follow-up to a support thread about [using datafiles to extend page frontmatter](https://discuss.gohugo.io/t/customizing-hugos-slug-inference-with-datafiles/3287/9):\n\n> A datafile to filename override mechanism would be easy to implement, but it sounds like a very special use case, so probably not worth it.\n\nThe primary use cases and goals include:\n- You want to extend different posts with different metadata for different environments. For example, in a staging environment, you may generate a data file in one way, but in a production environment you may use another. By providing different datafiles (rather than editing N posts each time) you can keep your post frontmatter minimal and clean.\n- You want to avoid many edits to many files to make small but sweeping changes, so that your source-control history remains an accurate reflection of the state of your project.\n\nThe desirable features are:\n- Hugo defines a mechanism whereby you can specify keys which are merged with the front-matter for a post or set of posts from `.Data`. One file might contain many such overrides. For example, a hypothetical specification could be:\n\n```\n\n---\n__content:\n  applies:\n    - posts/elephant.markdown\n    - posts/ocelot.markdown\n    - posts/zebra.asciidoc\n  frontmatter:\n    tags:\n      - animals\n      - science\n\n---\n```\n- The mechanism may also be employed to apply the same keys to many posts at once, as in the example above.\n- Data trumps frontmatter. If you define a key in both data and frontmatter, data wins.\n"}}
{"actor":{"display_login":"bep"}}