Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map JSON aliases #50

Open
kylemac opened this issue Dec 9, 2015 · 1 comment
Open

map JSON aliases #50

kylemac opened this issue Dec 9, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@kylemac
Copy link
Contributor

kylemac commented Dec 9, 2015

i'd like to develop an interface to allow us to map new keys for the json responses we get from contentful.

for example, given this json:

# content-type: post
{
  "headline": "This is the title to my article",
  "byline": "with a really cool byline"
}

I'd like to be able to map the data so that in my views i can reference contentful.posts.title and contentful.posts.description - by doing something like:

contentful = require 'roots-contentful'

module.exports =
  mapping:
    posts:
      headline: 'title'
      byline: 'description'

  extensions: [
    contentful(map: mapping)
  ]
@kylemac kylemac added the v.0.10 label Dec 9, 2015
@kylemac kylemac added this to the v0.0.10 milestone Dec 9, 2015
@kylemac
Copy link
Contributor Author

kylemac commented Dec 9, 2015

another option is to handle this per content-type, like how path and template are done. let's discuss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants