Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@gatsby-themes/drupal

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gatsby-themes/drupal

Drupal Theme for Gatsby

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
16
-5.88%
Maintainers
1
Weekly downloads
 
Created
Source

Gatsby Drupal Theme

The drupal theme sets up the configuration for drupal

  • This is also based on the Gatsby DEMO Drupal CMS site for recipes

  • It takes care of not only the drupal gatsby plugin configuration but also sets up all the queries that are needed for the building the recipe app.

  • Currently there are two template page queries available

    • Landing Page Query - List of all the recipes
    • Recipe Template Page Query - Specific Recipe details based on the id
  • As part of this we also have proptype definitions that can be imported into the template that wants to use the query. In the above mentioned GraphQL queries the prop type definition files

    import { AllRecipesPropTypes } from '@gatsby-themes/drupal';
    IndexPage.propTypes = {
    	data: AllRecipesPropTypes, // Query prop types
    	theme: PropTypes.object.isRequired
    };
    

How to use

  • Add the dependency @gatsby-themes/drupal
  • The drupal theme will warn of the peer dependencies which also must be added to the gatsby site leveraging this theme.
  • The depenendies include
    • "gatsby": "^2.13.21",
    • "gatsby-source-drupal": "^3.1.11"
yarn add `@gatsby-themes/drupal`
  • Configure the theme in the gatsby-config.js file.
const drupalConfig = require('./data/drupalConfig.js');

module.exports = {
	plugins: [
		{
			resolve: '@gatsby-themes/drupal',
			options: {
				...drupalConfig
			}
		}
	]
};
  • Add the site configuration file in the project data/drupalConfig.js
module.exports = {
	baseUrl: '<add drupal json api server url>',
	apiBase: '<api or json>'
};
  • Create implement the two template pages as shadow components (Index , Recipe as mentioned above).
    • The data queries (GraphQL queries) will be provided by theme
    • Only implement the Page rendering logic in the application (The data object from the shadows templates will be avaiable to use)
      • See the example templates in the drupal-app for more details.

Keywords

gatsby

FAQs

Package last updated on 27 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts