First thoughts on Contentful

Posted by James on September 8, 2019

I like it that the rich text fields output as a arrays of paragraphs. That'll get me round a lot of faffing and string analysis.

It seems like the data generated by the API is quite heavily nested. I'm not sure it needs to be. For example, I'd like to be able to add classes to paragraphs conditionally. The way the attributes are held in the data objects - like the "code" attribute - makes it quite fiddly to do that. A lot of my code looks a bit like this at the moment:

style: holder['marks'].length > 0 ? holder['marks'][0]['type'] : null,

...and I'm just not sure how happy I am about that.

I'm going to have to have a look at image handling quite soon, too.