1.0.40 • Published 4 years ago

@draftbox-co/gatsby-wordpress-balsa-theme v1.0.40

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Draftbox

gatsby-wordpress-balsa-theme

A Gatsby theme plugin for creating blogs from headless WordPress CMS.

Turn your WordPress blog into a lightning fast static website. This Gatsby theme is a frontend replacement of the WordPress engine featuring the standard Balsa theme skin and functionality. All content is sourced from a headless WordPress CMS.

This theme is being used at Draftbox. Get lightning fast, secure front-end for your WordPress or Ghost blog, in 5 minutes or less, without coding. For our fellow devs, we also provide code export feature.

Demo

Play with the Demo to get a first impression.

Features

  • Balsa theme by Draftbox
  • SEO optimized
  • Fully responsive
  • Gatsby images
  • Styled 404 page
  • RSS Feed
  • AMP Pages
  • Sitemap
  • Contact Form
  • Subscribe Form
  • Social Sharing
  • Composable and extensible

Installation

Head over to the starter repo to get up and running quickly!

If you want to add this blog theme to an existing site, follow these instructions:

  1. Install the blog theme

    yarn add @draftbox-co/gatsby-wordpress-balsa-theme
    # or
    npm install @draftbox-co/gatsby-wordpress-balsa-theme --save
  2. Create following files in your root directory with your desired config.

    • Create siteConfig.js in root directory and configure it as shown below.
//siteConfig.js
module.exports = {
  siteUrl: "https://wp-balsa-preview.draftbox.com", // Site domain. Do not include a trailing slash!

  postsPerPage: 10, // Number of posts shown on paginated pages (changes this requires sometimes to delete the cache)

  siteTitleMeta: "Built with Draftbox", // This allows an alternative site title for meta data for pages.
  siteDescriptionMeta:
    "Lightning fast, secure front-end for your WordPress or Ghost blog, without coding", // This allows an alternative site description for meta data for pages.

  shareImageWidth: 1000, // Change to the width of your default share image
  shareImageHeight: 523, // Change to the height of your default share image

  shortTitle: "Built with Draftbox", // Used for App manifest e.g. Mobile Home Screen
  siteIcon: "favicon.png", // Logo in /static dir used for SEO, RSS, and App manifest
  backgroundColor: "#e9e9e9", // Used for Offline Manifest
  themeColor: "#15171A", // Used for Offline Manifest
  apiUrl: "https://wordpress.theasdfghjkl.com",
  subscribeWidget: {
    title: "Subscribe to Draftbox",
    helpText: "Get the latest posts delivered right to your inbox.",
    successMessage: "Thanks for subscribing to Draftbox.",
  },
  header: {
    navigation: [
      {
        label: "Home",
        url: "https://wp-balsa-preview.draftbox.com/",
      },
      {
        label: "Contact",
        url: "https://wp-balsa-preview.draftbox.com/contact",
      },
    ],
  },
  footer: {
    copyright: "Built with Draftbox",
    navigation: [
      {
        label: "Home",
        url: "https://wp-balsa-preview.draftbox.com/",
      },
      {
        label: "Sitemap",
        url: "https://wp-balsa-preview.draftbox.com/sitemap.xml",
      },
      {
        label: "RSS",
        url: "https://wp-balsa-preview.draftbox.com/rss.xml",
      },
      {
        label: "Contact",
        url: "https://wp-balsa-preview.draftbox.com/contact",
      },
      {
        label: "External Link",
        url: "https://spectrum.chat/gatsby-js/themes?tab=posts",
      },
    ],
  },
  socialLinks: {
    twitter: "https://twitter.com/draftboxhq",
    facebook: "https://facebook.com/",
    instagram: "https://www.instagram.com/",
    linkedin: "https://linkedin.com/",
    github: "https://github.com/draftbox-co",
  },
  contactWidget: {
    title: "Contact Built with Draftbox",
    successMessage: "We’ll get in touch with you soon.",
  },
};

In the configuration shown above, the most important fields to be changed are siteUrl, siteTitleMeta and siteDescriptionMeta. Update at least those to fit your needs.

- Create .wordpress-config.json in root directory and configure it as shown below.
    {
        "baseUrl": "yourwordpressblog.com",
        "protocol": "https",
        "hostingWPCOM": false,
        "useACF": true,
        "includedRoutes": [
            "**/categories",
            "**/posts",
            "**/pages",
            "**/media",
            "**/tags",
            "**/taxonomies",
            "**/users"
        ]
    }

In the configuration shown above, the most important fields to be changed are baseUrl and hostingWPCOM . Update those with your configuration. example shown above works great for self hosted wordpress.

If your blog is hosted on wordpress.com you will have to add few extra keys for reference check out wordpress-source-docs.

  1. Add the following configuration to your gatsby-config.js file

    // gatsby-config.js
    
    let siteConfig;
    let wordpressConfig;
    
    try {
      siteConfig = require(`./siteConfig`);
      wordpressConfig = require(`./.wordpress-config`);
    
      console.log(wordpressConfig);
    } catch (e) {
      console.log(e);
    }
    
    module.exports = {
      plugins: [
        {
          resolve: `@draftbox-co/gatsby-wordpress-balsa-theme`,
          options: {
            wordpressConfig,
            siteConfig: siteConfig,
          },
        },
      ],
    };

Authors

Contributions

PRs are welcome! Consider contributing to this project if you are missing feature that is also useful for others.

Copyright & License

Copyright (c) 2020 Draftbox - Released under the MIT license.

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago