Skip to content

Commit

Permalink
馃摉 update README
Browse files Browse the repository at this point in the history
  • Loading branch information
RohovDmytro committed May 26, 2019
1 parent ae3c359 commit db448bf
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
@@ -1,25 +1,25 @@
A plugin that let you exclide posts from production.
A plugin that lets you mark posts and drafts and automatically exclude them from production.

## How it works

This plugin add a new field called `released`. If your build happens before `date` of your post the `released` value will set to `false`.

## How to use

### 1. Add plugin to `gatsby-node.js`
### Add plugin to `gatsby-node.js`

```javascript
module.exports = {
plugins: [
/*
...
*/
'gatsby-plugin-released',
],
}
'gatsby-plugin-released'
]
};
```

### 2. Update your GraphQL queries
### Update your GraphQL queries

You may want to exclude drafts from a build step in file `gatsby-node.js` and respect the `released` value from blog pages such as `index.js.`

Expand All @@ -41,10 +41,10 @@ const query = graphql(
}
}
`
)
);
```

### 3. Update your component code
### Update your component code

This step is totally up to yours component tree. The key point is to request necessary fields via GraphQL query.

Expand Down Expand Up @@ -80,11 +80,11 @@ module.exports = {
fieldName: 'released',
fieldNameNotForced: 'releasedNotForced',
timezone: 'UTC',
force: process.env.NODE_ENV === development,
},
},
],
}
force: process.env.NODE_ENV === development
}
}
]
};
```

### `fieldName` and `fieldNameNotForced`
Expand Down

0 comments on commit db448bf

Please sign in to comment.