
gatsby-plugin-scheduled-publishing
Gatsby Plugin for auto-publishing content by committing publish dates to your repo.
About this Project
The purpose of gatsby-plugin-scheduled-publishing
is to simplify the process of publishing content to your Gatsby
site.
It works by making some simple GraphQL changes:
- Adds an
isPublished
field to your content nodes - Adds
Published
andUnpublished
data types so you can make queries likeallPublished
andallUnpublished
Example plugin config:
const config = {
plugins: [
{
resolve: `gatsby-plugin-scheduled-publishing`,
options: {
publishDate: (node) => node.frontmatter?.myPublishDate, // Required
group: "BlogPosts", // Optional
timezone: "America/New_York", // Optional
delayInMinutes: 60 * 6, // Optional
dateFormat: "yyyy-MM-dd", // Optional
},
},
],
};
Example GQL query:
export const query = graphql`
query published {
blogPosts: allPublished(filter: { publishGroup: { eq: "BlogPosts" } }) {
publishGroup
frontmatter {
myPublishDate
title
}
}
}
`;
Tech Stack
- Gatsby - A React-based framework designed for speed and performance.
- NPM - A package manager for Node.js.
- NodeJS - A JavaScript runtime for use-cases outside of a browser environment.
- TypeScript - A strongly typed programming language that builds on JavaScript.
- Jest - A JavaScript testing framework.