Skip to content

Accessing blogs from custom page #4800

Answered by slorber
tobias-tengler asked this question in Q&A
Discussion options

You must be logged in to vote

We don't support to query plugin data with GraphQL like Gatbsy does.

It is however possible to achieve what you want in various ways:

  • create a plugin and use loadContent + contentLoaded + addRoute to create your homepage (equivalent of creating a page with Gatsby node)
  • generate a json representing the blog post with a node script as a pre-build step and require it in your index page.
    I admit it is not ideal but I don't have many other alternatives.

We also plan to allow you to "extend" an existing content plugin: for example you'll be able to add a blog index page by reusing the internal data that the blog plugin already read on the filesystem. Some discussions here: #4138

If you want t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tobias-tengler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants