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

add locale(s) support #39

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
🚧 scaffolding
hhsnopek committed Oct 28, 2015
commit 22e9ab0a1a6814256670b5165158d19dca403fa3
8 changes: 6 additions & 2 deletions lib/index.coffee
Original file line number Diff line number Diff line change
@@ -104,8 +104,12 @@ module.exports = (opts) ->

fetch_content = (type) ->
W(
client.entries(
_.merge(type.filters, content_type: type.id, include: 10)
client.entries(_.merge(
type.filters,
content_type: type.id,
include: 10,
locale: type.locale
)
)
)

1 change: 1 addition & 0 deletions test/fixtures/basic/app.coffee
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ module.exports =
content_types: [
{
id: '6BYT1gNiIEyIw8Og8aQAO6'
locale: 'en-ES'
}
{
id: '7CDlVsacqQc88cmIEGYWMa'
1 change: 1 addition & 0 deletions test/fixtures/locale/about.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h1 wow
20 changes: 20 additions & 0 deletions test/fixtures/locale/app.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
contentful = require '../../..'

module.exports =
ignores: ["**/_*", "**/.DS_Store"]
extensions: [
contentful(
access_token: 'YOUR_ACCESS_TOKEN'
space_id: 'aqzq2qya2jm4'
content_types: [
{
id: '6BYT1gNiIEyIw8Og8aQAO6'
locale: 'en-ES'
}
{
id: '7CDlVsacqQc88cmIEGYWMa'
locale: 'en-ES'
}
]
)
]
5 changes: 5 additions & 0 deletions test/fixtures/locale/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ul
- for p in contentful.blog_posts
li
h1= p.title
p= p.body
6 changes: 6 additions & 0 deletions test/fixtures/locale/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "test",
"dependencies": {
"jade": "*"
}
}