1/8/2024 0 Comments Contentful json editor![]() ![]() #60 Element.inflateWidget package:flutter/…/widgets/framework.dart #15 MultiChildRenderObjectElement.mount package:flutter/…/widgets/framework.dart #14 Element.inflateWidget package:flutter/…/widgets/framework.dart #13 ComponentElement.mount package:flutter/…/widgets/framework.dart #12 ComponentElement._firstBuild package:flutter/…/widgets/framework.dart #11 Element.rebuild package:flutter/…/widgets/framework.dart #10 ComponentElement.performRebuild package:flutter/…/widgets/framework.dart #9 StatelessElement.build package:flutter/…/widgets/framework.dart #8 Paragraph.build package:contentful_rich_text/widgets/paragraph.dart package:contentful_rich_text/contentful_rich_text.dart #6 new om (dart:core-patch/array_patch.dart:57:19) #5 ListIterator.moveNext (dart:_internal/iterable.dart:343:26) #4 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31) #2 ContentfulRichText._processInlineNode package:contentful_rich_text/contentful_rich_text.dart #1 nvert package:html_unescape/src/base.dart #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5) When the exception was thrown, this was the stack: The method 'contains' was called on null. ![]() The following NoSuchMethodError was thrown building Paragraph(dirty): Return ContentfulRichText(document).documentToWidgetTree RenderMark : RenderMark defaultMarkRenderers = RenderMark(\r\n") getting data from Contentful, must be implemented in your project // document will be a dynamic variable JSON map matching the above JSON var document = getContentfulJson() env file in the root of your project and add your API key and space ID as shown below.Import 'package:contentful_rich_text/contentful_rich_text.dart' Since this isn't a styling tutorial, we'll create a very basic UI or if you'd like, you can use the layout from this repo, (yes, I'm shamelessly advertising my own repos), and tweak it to your liking.Ĭreate a. On the settings page, copy the API key and space ID and paste them somewhere safe, we'll add them to the sveltekit project in a moment. On the content page is where you'll add sample blog posts so that we can have data to play around with. Also, make sure the slugField is auto-generated from the title for SEO purposes. On the content model page of your dashboard, create a new content model that will host the structure of how your blog will look like and name it blog.Īdd the fields as shown below, making them mandatory and configuring the dateField to only include the date. However, I'll try my best to explain how to easily do so with screenshots. I would go into the details of how to create an account and setup your contentful API but that would be free marketing for them and we don't do that here. Any changes made to the application will be automatically rebuilt and reloaded using Vite into the running app as long as the dev server is still running. The dev server will be listening from the address. Open a new terminal and run the following command:Įnter fullscreen mode Exit fullscreen mode You could use codesandbox or svelte playground for a plain svelte application to play around with Contentful (Without routing of course) or create a local svelte kit application, for dynamic routes. Basic knowledge of svelte and svelte kit.Node.js and npm installed on your development machine.Familiarity with HTML, CSS and JavaScript(ES6+),.Text editor or JavaScript coding environment.Contentful account, API key and secret key.I went with contentful because it was the first one I could find after a few searches and seemed the simplest to use at the time. Optimizely - Not a clue what it does but the company showed up as I did my research.Wordpress - One of the most popular CMS and website builder.].Strapi - an open source Nodejs Headless CMS that provides both REST or GraphQL.If you only need to check out the code, without the hustle of reading this entire blog, you can find the live deployed site here and the repo for reference here Since there is currently no other Contentful and sveltekit tutorial out there (at time of writing of course), I am here to save the day, with my poor writing skills.Ĭontentful is an API first content platform to build digital experiences (according to their site description of course). I also needed another excuse to spread the svelte gospel to everyone out there. I know you're wondering why another "create a blog tutorial" but that's the simplest project I could come up with for this tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |