gatsby-source-contentful-locales
Advanced tools
Comparing version
{ | ||
"name": "gatsby-source-contentful-locales", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
@@ -13,3 +13,4 @@ "description": "Get the list of locales from a given space", | ||
"scripts": { | ||
"commit": "npx git-cz" | ||
"commit": "npx git-cz", | ||
"semantic-release": "semantic-release" | ||
}, | ||
@@ -24,3 +25,5 @@ "husky": { | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"husky": "^4.2.5" | ||
"husky": "^4.2.5", | ||
"semantic-release": "^17.1.1", | ||
"semantic-release-slack-bot": "^1.6.2" | ||
}, | ||
@@ -27,0 +30,0 @@ "dependencies": { |
# gatsby-source-contentful-locales | ||
Source plugin for pulling locales from contentful spaces. | ||
It creates a list with all the locales available and exposes information like default locale and fallback locale. | ||
### Install | ||
```bash | ||
# npm | ||
npm install --save gatsby-source-contentful-locales | ||
# yarn | ||
yarn add gatsby-source-contentful-locales | ||
``` | ||
### Usage | ||
```js | ||
// In your gatsby-config.js | ||
// Learn about environment variables on Gatsby: https://gatsby.dev/env-vars | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-source-contentful-locales`, | ||
options: { | ||
spaceId: process.env.CONTENTFUL_SPACE_ID, | ||
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN, | ||
}, | ||
}, | ||
], | ||
} | ||
``` | ||
### Configuration options | ||
**spaceId** [string][required] | ||
Contentful spaceId | ||
**accessToken** [string][required] | ||
Contentful delivery api key | ||
### How to query | ||
```graphql | ||
{ | ||
allContentfulLocale { | ||
totalCount | ||
edges { | ||
node { | ||
id | ||
code | ||
name | ||
default | ||
fallbackCode | ||
} | ||
} | ||
} | ||
} | ||
``` |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4950
55.86%6
20%1
-50%59
1866.67%5
66.67%