Giter Club home page Giter Club logo

example-gatsby-capacitor-wordpress's Introduction

example-gatsby-capacitor-wordpress

The starter theme of Gatsby site with WordPress (Using WP API).

Install this starter (assuming Gatsby is installed) by running from your CLI:

Just try the demo site

You can deploy the demo site to the following services.

amplifybutton

netlifybutton

Getting started

Create new site

$ gatsby new gatsby-wordpress https://github.com/getshifter/example-gatsby-capacitor-wordpress

or

$  npx gatsby-cli new gatsby-wordpress https://github.com/getshifter/example-gatsby-capacitor-wordpress

Set your WordPress URL

Open gatsby-config.js, and replace the following properties.

  • siteMetadata.postURLPrefix: Your WordPress Posts page URL prefix (default: news)
  • siteMetadata.pageURLPrefix: Your WordPress Pages page URL prefix (default: ``)
  • plugins[].options.baseURL: Your WordPress URL (default: central.wordcamp.org)
module.exports = {
  siteMetadata: {
    postURLPrefix: 'news',
    pageURLPrefix: '',
  },
  plugins: [
    `gatsby-plugin-typescript`,
    {
      resolve: 'gatsby-plugin-graphql-codegen',
      options: {
        fileName: `types/graphql-types.d.ts`
      }
    },
    {
      resolve: "gatsby-source-wordpress",
      options: {
        /*
         * The base URL of the WordPress site without the trailingslash and the protocol. This is required.
         * Example : 'demo.wp-api.org' or 'www.example-site.com'
         */
        baseUrl: "central.wordcamp.org",

All of options can see this page. https://www.gatsbyjs.org/packages/gatsby-source-wordpress/

Run in your Local

$ npm run develop

or

$ gatsby develop

Build static HTML

$ npm run build

or

$ gatsby build

Generated HTML will be placed in public directory.

Deploy

Deploy to Netlify

PWA

The example provides PWA by using gatsby-plugin-manifest and gatsby-plugin-offline. You can check the application icons in the static/icons directory.

% tree st   i
/icons atic/
static/icons
├── icon-128x128.png
├── icon-144x144.png
├── icon-152x152.png
├── icon-192x192.png
├── icon-384x384.png
├── icon-512x512.png
├── icon-72x72.png
└── icon-96x96.png

1 directory, 8 files

And manifest.json's content are in gatsby-config.js.

 {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `WPGatsby Example`,
        short_name: `WPGatsby`,
        start_url: `/`,
        background_color: `#ffffff`,
        theme_color: `#00bfff`,
        display: `standalone`,
      },
 },

example-gatsby-capacitor-wordpress's People

Contributors

renovate-bot avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.