roots-contentful
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,4 +0,4 @@ | ||
// Generated by CoffeeScript 1.9.0 | ||
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
var RootsUtil, S, W, contentful, errors, path, pluralize, querystring, _; | ||
var RootsUtil, S, W, _, contentful, errors, path, pluralize, querystring; | ||
@@ -39,11 +39,11 @@ _ = require('lodash'); | ||
function RootsContentful(_at_roots) { | ||
var _base, _base1; | ||
this.roots = _at_roots; | ||
function RootsContentful(roots) { | ||
var base, base1; | ||
this.roots = roots; | ||
this.util = new RootsUtil(this.roots); | ||
if ((_base = this.roots.config).locals == null) { | ||
_base.locals = {}; | ||
if ((base = this.roots.config).locals == null) { | ||
base.locals = {}; | ||
} | ||
if ((_base1 = this.roots.config.locals).contentful == null) { | ||
_base1.contentful = {}; | ||
if ((base1 = this.roots.config.locals).contentful == null) { | ||
base1.contentful = {}; | ||
} | ||
@@ -137,3 +137,4 @@ this.roots.config.locals.asset = asset_view_helper; | ||
return W(client.entries(_.merge(type.filters, { | ||
content_type: type.id | ||
content_type: type.id, | ||
include: 10 | ||
}))); | ||
@@ -237,3 +238,3 @@ }; | ||
asset_view_helper = function(asset, params) { | ||
var url, _base; | ||
var base, url; | ||
if (asset == null) { | ||
@@ -245,4 +246,4 @@ asset = {}; | ||
} | ||
if ((_base = asset.fields).file == null) { | ||
_base.file = {}; | ||
if ((base = asset.fields).file == null) { | ||
base.file = {}; | ||
} | ||
@@ -249,0 +250,0 @@ url = asset.fields.file.url; |
{ | ||
"name": "roots-contentful", | ||
"version": "0.0.7", | ||
"description": "An extension for using roots with the API-driven Contentful CMS", | ||
"main": "lib", | ||
"directories": { | ||
"test": "test" | ||
"version": "0.0.8", | ||
"author": "joshrowley", | ||
"bugs": { | ||
"url": "https://github.com/carrot/roots-contentful/issues" | ||
}, | ||
"dependencies": { | ||
"lodash": "3.6.x", | ||
"contentful": "^1.1.5", | ||
"lodash": "^3.10.1", | ||
"pluralize": "^1.2.1", | ||
"roots-util": "0.1.x", | ||
"contentful": "1.1.x", | ||
"when": "3.7.x", | ||
"string": "3.1.x", | ||
"pluralize": "1.1.x" | ||
"string": "^3.1.3", | ||
"when": "3.7.x" | ||
}, | ||
"devDependencies": { | ||
"chai": "2.x", | ||
"chai-as-promised": "4.x", | ||
"coffee-script": "1.7.x", | ||
"chai-as-promised": "5.0.x", | ||
"coffee-script": "1.9.x", | ||
"coveralls": "2.x", | ||
"istanbul": "0.3.x", | ||
"mocha": "1.x", | ||
"roots": "3.0.x", | ||
"mockery": "1.4.x" | ||
"mocha": "2.2.x", | ||
"mockery": "1.4.x", | ||
"roots": "3.0.x" | ||
}, | ||
"scripts": { | ||
"test": "mocha", | ||
"coverage": "make build; NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha; make unbuild; open coverage/lcov-report/index.html;", | ||
"coveralls": "make build; make coveralls; make unbuild;" | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/carrot/roots-contentful.git" | ||
}, | ||
"homepage": "https://github.com/carrot/roots-contentful", | ||
"keywords": [ | ||
"roots-extension" | ||
], | ||
"author": "joshrowley", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/carrot/roots-contentful/issues" | ||
"main": "lib", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/carrot/roots-contentful.git" | ||
}, | ||
"homepage": "https://github.com/carrot/roots-contentful" | ||
"scripts": { | ||
"coverage": "make build; NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha; make unbuild; open coverage/lcov-report/index.html;", | ||
"coveralls": "make build; make coveralls; make unbuild;", | ||
"test": "mocha" | ||
} | ||
} |
@@ -1,5 +0,6 @@ | ||
Roots Contentful | ||
================ | ||
# Roots Contentful | ||
[![npm](https://badge.fury.io/js/roots-contentful.png)](http://badge.fury.io/js/roots-contentful) [![tests](https://travis-ci.org/carrot/roots-contentful.png?branch=master)](https://travis-ci.org/carrot/roots-contentful) [![dependencies](https://david-dm.org/carrot/roots-contentful.png?theme=shields.io)](https://david-dm.org/carrot/roots-contentful) [![Coverage Status](https://img.shields.io/coveralls/carrot/roots-contentful.svg)](https://coveralls.io/r/carrot/roots-contentful?branch=master) | ||
[![npm](http://img.shields.io/npm/v/roots-contentful.svg?style=flat)](https://badge.fury.io/js/roots-contentful) [![tests](http://img.shields.io/travis/carrot/roots-contentful/master.svg?style=flat)](https://travis-ci.org/carrot/roots-contentful) [![dependencies](http://img.shields.io/gemnasium/carrot/roots-contentful.svg?style=flat)](https://gemnasium.com/carrot/roots-contentful) | ||
[![devDependencies](https://img.shields.io/david/dev/carrot/roots-contentful.svg)](https://gemnasium.com/carrot/roots-contentful) | ||
[![Coverage Status](https://img.shields.io/coveralls/carrot/roots-contentful.svg)](https://coveralls.io/r/carrot/roots-contentful?branch=master) | ||
@@ -60,2 +61,4 @@ An extension for using [roots](https://github.com/jenius/roots) with the Contentful CMS API. | ||
Note: if you have [Links](https://www.contentful.com/developers/docs/concepts/links/) in your content more than 10 levels deep (the max for the `include` parameter), then unresolved links can be returned. | ||
#### Single Entry Views | ||
@@ -67,6 +70,6 @@ | ||
Contentful's [documentation](https://www.contentful.com/developers/documentation/content-delivery-api/#getting-entry) shows the API response when fetching an entry. Your content fields are nested in a `fields` key. As a convenience, the entry object roots-contentful makes available in your views will have the `fields` key's value set one level higher on the object. System metadata remains accessible on the `sys` key and roots-contentful will raise an error if you have a field named `sys`. Inside your views, the entry object will have this structure: | ||
Contentful's [documentation](https://www.contentful.com/developers/documentation/content-delivery-api/#getting-entry) shows the API response when fetching an entry. Your content fields are nested in a `fields` key on the `entry` object. As a convenience, the entry object roots-contentful makes available in your views will have the `fields` key's value set one level higher on the object. System metadata remains accessible on the `sys` key and roots-contentful will raise an error if you have a field named `sys`. Inside your views, the entry object will have this structure: | ||
```json | ||
{ | ||
"entry": { | ||
"title": "Wow. Such title. Much viral", | ||
@@ -82,3 +85,9 @@ "author": "The Doge of Venice" | ||
``` | ||
And can be accessed in your view like this: | ||
```jade | ||
h2= entry.title | ||
p= markdown(entry.body) | ||
``` | ||
### Configuration Options | ||
@@ -135,3 +144,3 @@ | ||
- Details on the license [can be found here](LICENSE.md) | ||
- Details on the license [can be found here](license.md) | ||
- Details on running tests and contributing [can be found here](contributing.md) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36975
229
143
1
+ Addedcontentful@1.2.1(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedpluralize@1.2.1(transitive)
+ Addedstring@3.3.3(transitive)
- Removedcontentful@1.1.5(transitive)
- Removedlodash@3.6.0(transitive)
- Removedpluralize@1.1.6(transitive)
- Removedstring@3.1.3(transitive)
Updatedcontentful@^1.1.5
Updatedlodash@^3.10.1
Updatedpluralize@^1.2.1
Updatedstring@^3.1.3