contentful

Contentful api - getting images

时光怂恿深爱的人放手 提交于 2019-12-12 04:18:52
问题 I am new to contentful API but so far getting content from the API has been pretty straight forward. I have created a new space using their "blog" template and I see that in the "body" field there is an "insert media" button. I don't think I get how this is supposed to be used. When I insert an image into the "body" field, it generates a code that doesn't get rendered when I pull the content form the API. I am using a markdown parser to render the text. If you create an entry with images,

How to set contentful.js api call rateLimit

帅比萌擦擦* 提交于 2019-12-11 10:45:50
问题 I have following code: contentfulMgmt.createClient({ accessToken: sourceSpace.accessCode, rateLimit: 1, secure: true, retryOnTooManyRequests: true, maxRetries: 5 }); How to set api call rate? I have seen it in their github project but i am unable to make it work. For ref: rate-limit: https://github.com/contentful/contentful-management.js/blob/master/lib/rate-limit.js contentful-management: https://github.com/contentful/contentful-management.js They have added index.js file in the project but

GraphQL query callbacks for Gatsby.js

家住魔仙堡 提交于 2019-12-11 08:52:48
问题 In the Contentful CMS, I have two different content-types: BigCaseStudy and BigCaseStudySection . To get this content to appear in my Gatsby 2.x site, my thinking was: Do query 1, which gets all the BigCaseStudy fields I want to display, and also contains the content's ID field as metadata. Take that ID from query 1, match to a Contentful reference field (which contains an ID ) in query 2 Do query 2, return all matching BigCaseStudySection fields The end goal would be to display the original

Parse url hash fragment in express application

夙愿已清 提交于 2019-12-11 01:26:22
问题 I am writing a express application, and I have to authenticate the user using oauth 2.0 flow. I have successfully redirected the user to the oauth provider and the provider send the access token in the oauth callback. Something like http://localhost:4000/oauth/callback#access_token=<token> Now I have a express route handler like app.get('/oauth/callback', function(req, res, next) { }); I know that hash fragment is not passed to server, but this is a oauth callback. How can I get the url hash

Hiding contentful Space id and access token, client side javascript file

时光毁灭记忆、已成空白 提交于 2019-12-10 17:26:54
问题 I am new in contentful and I am trying to display content from contentful to a web page. I am displaying the content using contentful.js, I wanted to know How can i hide these information(space id and access token values) from public users when i am using it in a js file to display contents in a web page. Below is the Javascript code which i am using in main Js file to display the content in html file. var client = contentful.createClient({ accessToken: 'b4c0n73n7fu1', space: 'cfexampleapi' }

How to handle Contentful content data in Gatsby

不羁岁月 提交于 2019-12-10 04:10:32
问题 I'm interested in using Gatsby to build a Netlify static site using content from Contentful Netlify has this nice gettting started Gatsby guide: ​​https://www.netlify.com/blog/2016/02/24/a-step-by-step-guide-gatsby-on-netlify But I'm a bit unsure of how to bring Contentful into the mix. Do I need to write scripts to convert my Contentful content into Gatsby 'markdown'? Any ideas, ideas, links appreciated! 回答1: Since this question was posted, an official Contentful plugin's been added to

GraphQL queries for Gatsby - Contentful setup with a flexible content model

妖精的绣舞 提交于 2019-12-09 07:20:10
问题 I have a gatsby site with the contentful plugin and graphql queries (setup is working). [EDIT] My gatsby setup pulls data dynamically using the pageCreate feature. And populates my template component, the root graphql query of which I've shared below. I can create multiple pages using the setup if the pages on contentful follow the structure given in the below query. [/EDIT] My question is about a limitation I seemed to have come across or just don't know enough grpahql to understand this yet

Angular 6 PWA service worker not serving content offline

妖精的绣舞 提交于 2019-12-07 14:11:55
问题 I'm trying to set up a PWA with Angular 6 and having trouble to make the service worker serve content offline. I tried a lot of configurations and stuff for a couple of days now but with no success. The service worker seems to be registered and running lighthouse in audits tab in Chrome passes the pwa test. I'm using Contentful to serve texts/assets for this site. Service worker is fetching the content from dataGroups but it returns a 204 code when the service worker is doing the fetching. I

Gatsby.js: Filter GraphQL query by nested object property

梦想的初衷 提交于 2019-12-07 05:35:51
问题 I'm working on a news site which will have articles, each with one or multiple respective authors. If you click on an author's name, it will take you to a page displaying their information and a list of articles they have contributed to. So each article has an authors property, which in turn is an array of author objects with properties: full name, slug ( lowercase version of full name with spaces replaced by dashes ), etc. Is it possible to filter the articles by a particular author's slug

How do I “activate” a Contentful sidebar extension?

有些话、适合烂在心里 提交于 2019-12-06 13:55:53
问题 I have created a Contentful sidebar extension, which is intended to display other entires which are related to the entry currently loaded in the editor. I can query the space from CLI tool and my extension is returned, so it was created successfully.. sidebar is set to true and there's HTML in the srcdoc property. However, when I go to the Contentful interface, nothing has changed -- there is no record of my new extension anywhere, and I can't figure out how to get it to show up anywhere. Two