Home / Companies / Sanity / Blog / Post Details
Content Deep Dive

Why portable text is awesome and you totally want it in your CMS

Blog post from Sanity

Post Details
Company
Date Published
Author
Knut Melvær
Word Count
973
Language
English
Hacker News Points
-
Summary

Sanity proposes a shift from storing rich text as HTML or Markdown in content management systems (CMS) to using the Portable Text model, which they developed in 2015. This model allows for greater flexibility and control over text content, enabling it to be easily manipulated and rendered across various interfaces, not just the web. Portable Text is represented as a structured JSON object that can be serialized into clean text, HTML, or Markdown, allowing for customizations like footnotes or links for different contexts, such as voice interfaces. It supports complex text structures and collaborative capabilities similar to Google Docs and facilitates easier integration with frameworks and testing. By adopting Portable Text, users can structure content in a way that aligns with their organizational needs, rather than adhering to the constraints of traditional markup languages, while still maintaining the ability to convert it into other formats when necessary.