gatsby

How to properly implement a JSONP form post submission on a Gatsby site

北战南征 提交于 2020-05-28 06:56:37
问题 I've got a site, created with Gatsby. There is a form on one of the pages, and it needs to post to an endpoint that doesn't support CORS, but does support JSONP. I've written the event handler like this, using jsonp: const handleSumbit = async event => { event.preventDefault() jsonp( "https://go.pardot.com/form/id/code/", { timeout: 10000, params: { firstname: "fname", lastname: "lname", email: "an@email.com", company: "company", }, }, (err, data) => { console.log({ err }, { data }) } ) }

Gatsby - IntersectionObserver is not defined

故事扮演 提交于 2020-05-28 04:38:46
问题 I am trying to build my gatsby project but I am unable due to the IntersectionObserver not being recognised. I use the intersectionObserver inside an InView component: import React, { useRef, useState, useEffect } from 'react' const InView = ({ children }) => { const [boundingClientY, setBoundingClientY] = useState(null) const [direction, setDirection] = useState(null) const [element, setElement] = useState(null) const [inView, setInView] = useState(false) const observer = useRef(new

npm install failed gatsby dev blog

走远了吗. 提交于 2020-05-17 08:52:27
问题 I've been spending hours on this problem of my gatsby dev blog. I cloned it from my repository and ran npm install , also with sudo privilege, but it failed. Could anyone tell me what's the issue? Here's the error that I'm getting: localhost@localhost:~/Desktop/devBlog$ sudo npm install [sudo] password for hellRaiser: npm WARN tarball tarball data for typeface-montserrat@0.0.54 (sha512-Typhap0PWT299+Va0G/8ZtycHMXrH4gBWKfiW977KEBx5rXUUCa70gvqLx1fdA0WAo6bhSAQmo8uc+QFAmjPww==) seems to be

npm install failed gatsby dev blog

半腔热情 提交于 2020-05-17 08:52:05
问题 I've been spending hours on this problem of my gatsby dev blog. I cloned it from my repository and ran npm install , also with sudo privilege, but it failed. Could anyone tell me what's the issue? Here's the error that I'm getting: localhost@localhost:~/Desktop/devBlog$ sudo npm install [sudo] password for hellRaiser: npm WARN tarball tarball data for typeface-montserrat@0.0.54 (sha512-Typhap0PWT299+Va0G/8ZtycHMXrH4gBWKfiW977KEBx5rXUUCa70gvqLx1fdA0WAo6bhSAQmo8uc+QFAmjPww==) seems to be

Gatsby not generating correct static HTML files

女生的网名这么多〃 提交于 2020-05-15 18:22:29
问题 I am working on a Gatsby based website which is so far going well in development. Running into an issue though when building for production whereby we do not get any static html in the various page index files and instead it looks like Gatsby is going to attempt to inject the page from javascript which is contra to our expectation. I have seen some posts related to the Gatsby offline plugin which I have disabled but this has not resolved the issue. Our pages contain no static html output and

Gatsby not generating correct static HTML files

旧街凉风 提交于 2020-05-15 18:22:16
问题 I am working on a Gatsby based website which is so far going well in development. Running into an issue though when building for production whereby we do not get any static html in the various page index files and instead it looks like Gatsby is going to attempt to inject the page from javascript which is contra to our expectation. I have seen some posts related to the Gatsby offline plugin which I have disabled but this has not resolved the issue. Our pages contain no static html output and

Change the Theme of Antd when using GatsbyJS

被刻印的时光 ゝ 提交于 2020-05-13 14:46:49
问题 This GatsbyJS/antd plugin page (https://github.com/bskimball/gatsby-plugin-antd/issues/2) makes it seem that there is a way to edit ant.design (antd) themes when using GatsbyJS. The code that is provided is plugins: [ { resolve: 'gatsby-plugin-antd', options: { style: true } } ] But there is no additional information. Where would one make changes to things like the theme primary color (as described: https://ant.design/docs/react/customize-theme). The ant.design page (https://ant.design/docs

I want to display articles using gatsby-source-facebook

半城伤御伤魂 提交于 2020-04-30 12:20:37
问题 I want to display the data of an article using gatsby-source-facebook. But I don't know how to write a query. I can't find the best query at http://localhost:8000/___graphql I make a simple website with gatsby.js . I want to get facebook article data (posting date and text) and display it on the site. I installed gatsby-source-facebook for that. And changed gatsby-config.js . → https://www.gatsbyjs.org/packages/gatsby-source-facebook/ //`gatsby-config.js` plugins: [ { resolve: `gatsby-source

How to rebuild my Gatsby project with any changes in the api and database?

谁说我不能喝 提交于 2020-04-30 08:45:27
问题 I get the data from rest api and I want to be rebuild Automatically again with any changes in the api and database and fetch new data please help me.. 来源: https://stackoverflow.com/questions/61301840/how-to-rebuild-my-gatsby-project-with-any-changes-in-the-api-and-database

Gatsby Pagination for multiple pages [closed]

懵懂的女人 提交于 2020-04-17 14:22:49
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 days ago . Most of the Gatsby tutorials I've seen deal with one single source of pagination. For my site, I have multiple pages that use GraphQL to filter different categories of 160+ of blog posts. I need some way to paginate each category page, so users don't have to scroll down dozens of