1.0.1 • Published 3 years ago

@matixinc/gatsby-plugin-azure-external-image v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

The first approch was to use the extract-image-paths plugin that parses an MDX node and add extra fields on the node itself that are resolved at runtime. The problem with this approach comes when we try to synchronize images to azure using the newly added fields. They are not available in createNodes since they have to be resolved first and to be resolved, we need to be able to query the node but this is not possible in createNode extension point.

Next approach.

Create a new type of Node - MatixNode and make a 1-1 relationship between Mdx and Matix

  1. The new node will be created using a plugin that will parse mdx and output the content in the MatixNode
  2. A source plugin will be created as well in order to synchronize the content to azure, it will create a MatixAzureNode which will create a reference to a FileNode
  3. A relationship will be made between MatixNode, MatixAzureNode and Mdx
  4. A resolver will be made to expose the resulting FileNode in the Mdx schema to facilita querying this data.