GithubHelp home page GithubHelp logo

eugelogic / gatsby-press Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 333 KB

Gatsby with Headless WordPress

Home Page: https://www.gatsbypress.co.uk/

License: MIT License

JavaScript 93.23% CSS 6.77%

gatsby-press's People

Contributors

eugelogic avatar renovate-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gatsby-press's Issues

Use ENV for some configuration settings

Consider using ENV variables for some of your configuration settings. For example, the WP URL.

This allows people to switch out different settings between development, staging and production should they need to (which is quite often a yes).

It's also a good place to store API keys as the ENV variables should NOT be uploaded to the repository.

I would recommend you use the .env file for local, and your hosts ENV options on production. Ensure you do not commit .env to your repo though.

Optimise exports.createPages on gatsby-node.js

Consider using Promise.all()

exports.createPages = async ({ actions, graphql }) => {
    await Promise.all([
        createPages({ actions, graphql }),
        createPosts({ actions, graphql }),
        createCategories({ actions, graphql }),
        createTags({ actions, graphql }),
        createUsers({ actions, graphql })
    ]);
}

It might be worth seeing if there is a speed improvement in the build as well

Consider optimise gatsby-node.js

Use promise.all() or promise.allSettled() instead of individual await statements

exports.createPages = async ({ actions, graphql }) => {
    await Promise.all([
        createPages({ actions, graphql }),
        createPosts({ actions, graphql }),
        createCategories({ actions, graphql }),
        createTags({ actions, graphql }),
        createUsers({ actions, graphql })
    ]);
}

Replace `users` with `authors`

In the "createUsers.js" and where necessary
This is because when you query all the posts, you can filter only by author and not by user
Make sure to use where: {hasPublishedPosts: POST}

Consider: gatsby-plugin-robots-txt

It's good practice to have a robots.txt file, and can be useful during development to prevent additional sites being crawled. I personally prefer that my robots.txt file be control by the environment. However, controlling this via the WordPress settings may also be a good idea.

Example:

{
    resolve: `gatsby-plugin-robots-txt`,
    options: {
        policy: [{ userAgent: `*`, disallow: `/` }],
    }
},

https://www.gatsbyjs.org/packages/gatsby-plugin-robots-txt/

createLocalLink not picking the given site url

Following the issue with Transform node fields with gatsby-source-graphql I realised something else might not be right.

If I change the url in the options of the gatsby-source-graphql plugin, and use a totally different url for the createLocalLink function, the content fetched will be the right one but the function will use the url provided in the gatsby-source-graphql rather than one specified in the createLocalLink function by means of utils and config files.

Of course you would never used two different urls but I wonder why Gatsby is using the one on gatsby-config.js rather than the one in config.js

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • gatsby 2.22.9
  • dotenv 8.2.0
  • gatsby-plugin-google-analytics 2.3.2
  • gatsby-plugin-prefetch-google-fonts 1.4.3
  • gatsby-source-graphql 2.5.2
  • react 16.13.1
  • react-dom 16.13.1
  • prettier 2.0.5

  • Check this box to trigger a request for Renovate to run again on this repository

how admin can update user meta using gravity forms

Hi Guys,

I am using Gravity Formas user registration addon I can update user meta of the logged-in user only but I want also to update user meta whenever admin fills a form by entering user Email in the Email field.
Whenever Admin fills a form and enters email id which is users' email and all the populated fields should be updated to the user holding the Email.

Please give a golden or suggest a plugin
Thanks
Aman Kumar Shah

Style header

change <div> to <header> the add the following style

header {
    border-bottom: 1px solid grey;
}
header h2 a {
    text-decoration: none;
    text-transform: uppercase;
    color: black;
}

What if I want/need to filter users by role?

As things currently stand, I can only fetch all the users as long as they have a post under their name.
Subscribers will not be fetched.
But what can I do if I need a list of all the authors/editors only?
wp-graphql/wp-graphql#900
If this is not feasible I should change user to author where possible and try not to have username in the slug

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.