hygraph / gatsby-starter-hygraph-blog Goto Github PK
View Code? Open in Web Editor NEWGatsby starter for creating a basic blog with Hygraph
Home Page: https://blog.withheadlesscms.com
License: BSD Zero Clause License
Gatsby starter for creating a basic blog with Hygraph
Home Page: https://blog.withheadlesscms.com
License: BSD Zero Clause License
Hey everyone, does anyone know if there is a docker-compose manifest or image available for
Hygraph that I can use? Preferably a compose manifest I can spin up locally...
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@mdx-js/mdx
, @mdx-js/react
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@mdx-js/mdx
, @mdx-js/react
)gatsby-image
, gatsby-plugin-react-helmet
, gatsby-transformer-sharp
)react
, react-dom
)gatsby-image
, gatsby-plugin-postcss
, gatsby-plugin-react-helmet
, gatsby-transformer-sharp
)react
, react-dom
)package.json
@mdx-js/mdx 1.6.18
@mdx-js/react 1.6.18
classnames 2.2.6
gatsby 2.24.68
gatsby-image 2.4.21
gatsby-plugin-mdx 1.2.44
gatsby-plugin-postcss 2.3.13
gatsby-plugin-react-helmet 3.3.13
gatsby-plugin-react-svg 3.0.0
gatsby-plugin-sharp 2.6.39
gatsby-source-graphcms 2.0.0-next.11
gatsby-transformer-sharp 2.5.17
react 16.13.1
react-dom 16.13.1
react-helmet 6.1.0
react-transition-group 4.4.1
@tailwindcss/typography 0.2.0
@tailwindcss/ui 0.4.0
postcss-preset-env 6.7.0
tailwindcss 1.8.12
node ~16
Somehow previous
and next
properties from context doesn't respect the filtered posts per Category?
I have a Category page template src/templates/CategoryPage.tsx
where I have the following query to get the posts per category:
type Props = {
data: CategoryQueryQuery;
};
const CategoryPage = ({ data: { category } }: Props) => {
const { categories } = useCategories();
if (!category) return null;
const categoryName = category?.name;
const projects = category?.projects;
return (
<Layout>
<h1>{categoryName}</h1>
<CategoryList categories={categories} />
<ProjectGrid projects={projects} />
</Layout>
);
};
export default CategoryPage;
export const pageQuery = graphql`
query CategoryQuery($slug: String!) {
category: graphCmsCategory(slug: { eq: $slug }) {
name
slug
projects {
id: remoteId
name
slug
}
}
}
`;
From gatsby-node.js
I pass previous
and next
thought the context:
exports.createPages = async ({ graphql, actions: { createPage } }) => {
const { data } = await graphql(`
query Projects {
projects: allGraphCmsProject(
sort: { order: DESC, fields: createdAt }
filter: { stage: { eq: PUBLISHED } }
) {
edges {
next {
name
slug
}
previous {
name
slug
}
node {
slug
}
}
}
categories: allGraphCmsCategory {
nodes {
id: remoteId
slug
}
}
}
`);
const categories = data.categories.nodes;
if (categories) {
categories.forEach(({ id, slug }) =>
createPage({
path: `/projects/${slug}`,
component: path.resolve('./src/templates/CategoryPage.tsx'),
context: { id, slug },
}),
);
}
const projects = data.projects.edges;
if (projects) {
projects.forEach(({ node, previous, next }) => {
createPage({
path: `/projects/${node.slug}`,
component: path.resolve('./src/templates/ProjectPage.tsx'),
context: {
slug: node.slug,
previous,
next,
},
});
});
}
};
But now the previous
and next
properties doesn't respect the filtered posts array? So when there is only one post per category there should be no previous
and next
properties, but now they are..?
So the problem is that the previous
and next
properties from the pageContext
counts all posts instead of the filtered posts array.
How do I solve this issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.