We recently launch the site for Octahedroid, the agency I co-founded together with Omar Aguirre and Jorge Valdez. For our agency site we are using Drupal as a Decoupled CMS and Gatsby as frontend strategy.
For my personal blog I decided to simplify this and remove the Drupal backend part and use markdown files but including support for JSX components.
This is not the first time our team work in Gatsby and MDX projects. We did an implementation in the past using this technology for one of our clients Pantheon you can take a look to the following image to see this, and click to it, to visit their documentation pages.
MDX is an authorable format that lets you seamlessly write JSX in your Markdown documents.
As mentioned above we built the company site using Gatsby, but not only that we created the site using the amazing Theme-UI project and implemeting a Gatsby theme containing the React components. Therefore we decided to reuse those components in the MDX blog implementation and only extract and migrate content from Drupal to MDX files.
The main repo was done implementing a monorepo approach and it was organized in the packages and starters directories.
The packages directory contains the presentation theme with the reusable JSX components, and the data layer themes and with the Drupal and MDX implementations.
The starters are very basic gatsby projects implementing the data layer themes.
How basic it was the starter implementation?. I will list files and content to ilustrate this.
The only Drupal task here it was to enable the GraphQL module (yes the site was a few years old and it was still using JSON:API).
Since the site has been inactive more than a year ago, it was no Drupal site on production, only an instance running on my local machine. So instead of deploying a Drupal site to production, the decision we took was to install the GraphQL module and execute a GraphQL query to extract the node pages information and copy/paste to a gist file.
Migrating content and implementing the blog using MDX it was easier than we expected because of:
Yes, implementing the simplest solutions for the tasks and reusing what we have done already make us faster, efficient and productive.