# @webmaeistro/gatsby-theme-graphql-wp

> Gastby theme for wordpress in the back

Latest version **1.2.5** (published 2020-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @webmaeistro/gatsby-theme-graphql-wp
pnpm add @webmaeistro/gatsby-theme-graphql-wp
yarn add @webmaeistro/gatsby-theme-graphql-wp
bun add @webmaeistro/gatsby-theme-graphql-wp
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2020-02-13 |
| First published | 2020-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 19 |
| Unpacked size | 13.2 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | webmaeistro |
| Maintainers | webmaeistro |
| Keywords | gatsby, gatsby-plugin, gatsby-theme, wordpress, wpgraphql |

## Links

- npm: https://www.npmjs.com/package/@webmaeistro/gatsby-theme-graphql-wp
- Repository: https://github.com/webmaeistro/gatsby-theme-graphql-wp
- Homepage: https://github.com/webmaeistro/gatsby-theme-graphql-wp#readme
- Issues: https://github.com/webmaeistro/gatsby-theme-graphql-wp/issues
- npm.io page: https://npm.io/package/@webmaeistro/gatsby-theme-graphql-wp

## Dependencies (19)

- [urijs](https://npm.io/package/urijs.md) ^1.19.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.14
- [moment](https://npm.io/package/moment.md) ^2.24.0
- [theme-ui](https://npm.io/package/theme-ui.md) ^0.3.1
- [striptags](https://npm.io/package/striptags.md) ^3.1.1
- [react-helmet](https://npm.io/package/react-helmet.md) ^5.2.1
- [@emotion/core](https://npm.io/package/@emotion/core.md) ^10.0.27
- [@mdx-js/react](https://npm.io/package/@mdx-js/react.md) ^1.5.5
- [typeface-lato](https://npm.io/package/typeface-lato.md) ^0.0.75
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^10.0.27
- [gatsby-plugin-sharp](https://npm.io/package/gatsby-plugin-sharp.md) ^2.2.4
- [typeface-montserrat](https://npm.io/package/typeface-montserrat.md) ^0.0.75
- [@theme-ui/typography](https://npm.io/package/@theme-ui/typography.md) ^0.3.0
- [gatsby-source-graphql](https://npm.io/package/gatsby-source-graphql.md) ^2.1.2
- [typeface-crimson-text](https://npm.io/package/typeface-crimson-text.md) ^0.0.72
- [gatsby-plugin-theme-ui](https://npm.io/package/gatsby-plugin-theme-ui.md) ^0.3.0
- [gatsby-transformer-sharp](https://npm.io/package/gatsby-transformer-sharp.md) ^2.2.3
- [gatsby-plugin-react-helmet](https://npm.io/package/gatsby-plugin-react-helmet.md) ^3.1.22
- [gatsby-wpgraphql-inline-images](https://npm.io/package/gatsby-wpgraphql-inline-images.md) ^0.2.5

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.2.5 (latest) — 2020-02-13
- 1.2.4 — 2020-02-13
- 1.2.3 — 2020-02-13
- 1.0.7 — 2020-02-05
- 1.0.6 — 2020-02-05
- 0.1.6 — 2020-01-29
- 0.1.5 — 2020-01-29

## README

# @webmaeistro/gatsby-theme-graphql-wp

## Description

The idea behind this theme is making a one-stop solution for a WordPress blog owner who wants to switch to Gatsby powered frontend. Simple to configure that works out of the box. For a common use scenario - standard WordPress installation, basic posts and pages content - only a source url is needed.

```javascript
{
    resolve: '@webmaeistro/gatsby-theme-graphql-wp',
    options: {
        wordPressUrl: 'https://your.wordpress.site/',
    },
}
```

### Dependencies

This theme uses GraphQL API to source WordPress content. Therefore the source WordPress site must use the [wpgraphql](https://www.wpgraphql.com/) plugin.

## How to install

```bash
yarn add @webmaeistro/gatsby-theme-graphql-wp
```

```javascript
{
  resolve: '@webmaeistro/gatsby-theme-graphql-wp',
  options: {
    wordPressUrl: 'https://your.wordpress.site/',
    menuLocation: 'MENU_1',
  },
},
```

## Available options

`wordPressUrl` - source site.

`uploadsUrl` - _(optional)_ WordPress uploads folder. Uses default if this option not set.

`processPostTypes` - _(optional)_ post types to process. You can include [custom post types](https://docs.wpgraphql.com/getting-started/custom-post-types) as defined in wpgraphql however CPTs also need to have some code added to create pages on Gatsby site. And that is currently outside of this theme's scope.

`useWebp` - _(optional)_ if true uses [WebP images](https://www.gatsbyjs.org/docs/gatsby-image/#about-withwebp). Default is false.

`menuLocation` - WordPress [menu location](https://codex.wordpress.org/Function_Reference/register_nav_menus) slug. [Sanitized](https://github.com/wp-graphql/wp-graphql/blob/f92e9f4dc11db987f74ff458ab05f42a3e76b866/src/Type/WPEnumType.php#L32).

### menuLocation

A build would break if `menuLocation` was not cofigured right. The location slug comes from `register_nav_menus` function call in `functions.php` ([example](https://github.com/WordPress/twentynineteen/blob/5385371bb8a78ead93543ed2796517918b1a63bd/functions.php#L59)) of your WordPress theme.

### siteMetadata

```javascript
siteMetadata: {
    title: 'Site title',
    author: 'Author name',
    description: 'Site description',
    social: [
        {
            name: 'twitter',
            url: 'https://twitter.com/your_twitter',
        },
    ],
},
```

## Features

- Uses WordPress menu from a defined location. Only first level menu items are displayed. "Home" menu item is automatically added if there is no menu item linking to the site homepage.
- Supports post categories.
- Downloads images embedded in posts/pages/CPTs and hosted on the WordPress site. Converts `<img>` tags to Gatbsy `<Img>` component.
- Downloads featured images (post thumbnails) and makes them available as Gatsby `<Img>` component.
- Downloads all other files linked in posts/pages/CPTs and hosted on the WordPress site. Serves them from the Gatsby static folder.
- Links embedded in posts that lead to other pages are converted to `<Link>` component.

This theme utilizes the [gatsby-wpgraphql-inline-images](https://github.com/progital/gatsby-wpgraphql-inline-images) plugin for most of the content processing.

## Examples of usage

```javascript
{
    resolve: '@webmaeistro/gatsby-theme-graphql-wp',
    options: {
        wordPressUrl: 'https://examplecom',
    },
},
```



## Shout Outs

Special thanks for inspiration and some borrowed code go to:

https://github.com/jlengstorf  
<https://github.com/jasonbahl>  
https://wordpress.org/themes/juliet/  

Demo site uses images by [Unsplash](https://unsplash.com/) and text content from [Wikipedia](https://www.wikipedia.org/).

---
_Source: https://npm.io/package/@webmaeistro/gatsby-theme-graphql-wp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
