datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

Create nodes for string fields too #130

Closed lunelson closed 1 year ago

lunelson commented 3 years ago

This is a Feature Request in the form of a PR: I've tweaked this plugin in two spots to allow simple string fields to be Nodes in Gatsby, so they are open to processing. My use-case is an inline-tags-only version of gatsby-transformer-remark, which effectively treats the source code as a single paragraph, and returns only the innerHTML. This allows my content editors to use inline markdown tags (bold, emphasis, anchor) in simple string fields as well as multi-paragraph markdown fields.

Thoughts?

stefanoverna commented 2 years ago

@lunelson thanks and so sorry for the delay, I totally missed this one :(

We can definitely merge this, but only if you can add a configuration option to only enable this behavior if the developer explicitly asks so.

Creating/managing nodes in Gatsby is a very intensive operation, and creating nodes for each string field present in a project could add quite a lot of build time to bigger sites.

matjack1 commented 1 year ago

I'm closing as I think there's no more interest on this