惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
D
Docker
The Cloudflare Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
月光博客
月光博客
B
Blog RSS Feed
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
B
Blog
IT之家
IT之家
美团技术团队
Engineering at Meta
Engineering at Meta
C
Check Point Blog
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
H
Help Net Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
PCI Perspectives
PCI Perspectives
J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
腾讯CDC
A
Arctic Wolf
C
CERT Recently Published Vulnerability Notes
量子位
C
CXSECURITY Database RSS Feed - CXSecurity.com
Latest news
Latest news
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

Sanity.io

A Board Game agent built using Sanity Context and Vercel's AI SDK | Sanity Build a prototype with Claude Code that your whole team can edit | Sanity What’s New - May 2026 | Sanity I built a London pub guide with v0 and the Sanity MCP in six hours. Here's what I learned. | Sanity Build a conference concierge with Agent Context and Anthropic | Sanity Build a content-aware Telegram agent with Vercel AI SDK and Chat SDK | Sanity How I used Agent API to generate photos for my family’s recipes | Sanity What’s New April - 2026 | Sanity Better context, better matches: An AI love story (for dogs) | Sanity How to write for an agent | Sanity Content Agent, meet Slack: AI content operations in your workflow | Sanity Structure powers intelligence | Sanity Your agent needs better content. Here's how to give it. | Sanity How to serve content to agents (a field guide) | Sanity Sanity TypeGen GA: Automatic TypeScript types for content and GROQ | Sanity Sanity is now available on the Vercel Marketplace | Sanity The logo soup problem (and how to solve it) | Sanity Content Releases: From scattered updates to coordinated publishing | Sanity What's New - February 2026 | Sanity How we solved the agent memory problem | Sanity v0 Builder Challenge: The winners | Sanity Introducing: Sanity Agent Skills | Sanity Content Agent: Days of work in one conversation | Sanity Our Sanity Values | Sanity Open Source Pledge 2025: Stepping up when it matters | Sanity v0 builder challenge: $3000 in prizes | Sanity Why AI Breaks Without Structured Content Operations | Sanity What’s New January - 2026 | Sanity BFCM 2025: What teams built when infrastructure stopped being the problem | Sanity How AI shaped holiday shopping and what it means for content in 2026 | Sanity Sanity Studio v5: Embracing React 19 | Sanity You’ll need a CMS eventually. Let your agent set it up. | Sanity “You should never build a CMS” | Sanity AI Content Operations: A 30-Day Implementation Guide | Sanity What’s New December - 2025 | Sanity Scheduled Drafts: Stop manually publishing content at midnight | Sanity What’s New November - 2025 | Sanity Everything *[NYC] 2025 recap: A day of AI, Content Operations, and Culture | Sanity Clankers and content operations | Sanity Content Agent: AI that understands your structured content is here | Sanity Why design-driven content modeling creates technical debt, not velocity | Sanity What's New October - 2025 | Sanity From studio to inbox: How Kevin Green eliminated email campaign friction | Sanity The content editor's guide to content operations [E-commerce edition] | Sanity styled-components maintenance mode: A 40% faster fork | Sanity From zero code to a live website in 7 hours (thanks, Cursor!) | Sanity First attempt will be 95% garbage: A staff engineer's 6-week journey with Claude Code | Sanity Internationalization is more than translating words | Sanity What's New - September 2025 | Sanity We just deleted our 35k-member community Slack | Sanity What's New - August 2025 | Sanity The engineer's guide to content operations [E-commerce edition] | Sanity SEO for AI: Evolving from Web Pages to the Content Lake | Sanity What's New - July 2025 | Sanity Sanity Studio v4: A major version bump for a minor reason | Sanity What's New - June 2025 | Sanity Dashboard and Insights: Your New Content HQ | Sanity Canvas: AI-accelerated, context-aware, freeform authoring | Sanity Agent Actions: AI building blocks for structured content | Sanity Functions: Life beyond pressing publish | Sanity A new era for content applications with Sanity App SDK | Sanity The end of CMS era and our $85M Series C. | Sanity What's New – May 2025 | Sanity Introducing the Sanity Model Context Protocol (MCP) server | Sanity What's New – April 2025 | Sanity Pushing all the envelopes with ambitious content | Sanity Self-hosting is only free if your time is worth nothing | Sanity Content that lasts: Scaling beyond your frontend | Sanity The Live Content API is now Generally Available | Sanity The future beyond AI chat bots | Sanity Learning the new skill of working with AI | Sanity What's New - March 2025 | Sanity Give it in plain text: Making your content AI-Ready | Sanity No More 'DO NOT PUBLISH': Introducing Content Releases | Sanity React in 2025, what's next? | Sanity The final boss of front-end: block editors | Sanity Introducing Sanity for Startups | Sanity A block content editor that loves you back | Sanity A Black Friday Snooze Fest: Massive Traffic, No Drama | Sanity How to make a recipe site that scales well | Sanity The Sanity Winter Release 2024 | Sanity AVIF Arrives, Sanity’s Promise Fulfilled | Sanity Sanity joins the Open Source Pledge | Sanity Your content is now Live by default | Sanity Begin Team to Join Sanity | Sanity Sanity Digest - September '24 Edition | Sanity Sanity partners with Google. Now live on the Google Cloud Marketplace. | Sanity Sanity Digest - August ‘24 Edition | Sanity Now playing: the latest Mux Video Input plugin for Sanity | Sanity Community Digest - June ‘24 Edition | Sanity Community Digest - May ‘24 Edition | Sanity Guide to Sanity's newest product announcements | Sanity AI and Content Creation: A Leader's Guide | Sanity Of course, you should be able to type your content quickly! | Sanity New to AI Assist: translation, reference suggestions, image generation | Sanity Speak the language of your editors: Sanity Studio UI localization | Sanity Introducing the new Sanity Growth plan to serve collaborative teams | Sanity Presentation: Work faster than ever with structured content | Sanity Goodbye Feedback Frenzy, Hello Sanity Studio Comments! | Sanity Easing into the App Router with the Sanity Toolkit for Next.js | Sanity
Why Portable Text is awesome and you totally want it in your CMS | Sanity
Knut Melvær · 2026-03-11 · via Sanity.io

Let us get this out of the way first: We love HTML. We love Markdown. We use both every day for writing on the web. Even this text began its life in Markdown. And with this rather uncontroversial opening, you can probably see what's coming. We'll argue why you don't want Markdown or HTML stored in your CMS (except as code examples).

Almost everyone does it though, even the new kids on the block. We went through all the vendors on headlesscms.org and browsed through the documentation, and also signed up for those who didn't mention it: with two exceptions they all stored rich text either as HTML or Markdown. Fine if all you do is use Jekyll to render a website, or if you enjoy using dangerouslySetInnerHTML in React.

But if you want to reuse your content in interfaces that aren't on the web. Or if you want more control and functionality in your rich text editor. Or you just want it to be easier to render your rich text in one of the popular frontend frameworks and have your components take care of different parts of your rich text content — you'll either have to find a smart way to parse that Markdown or HTML into what you need, or, more conveniently, just have it stored more sensibly in the first place.

This is why Sanity adopted and developed the Portable Text model for how we store rich text. And now other CMS vendors have started experimenting with it. We're glad it's catching on. Text that is portable is good for everyone.

What does Portable Text actually look like?

Let's get down to business. How does "That was bold of you. Amazing, actually" look in Portable Text?

"Are you out of your mind?" you might say. How is this array of complex objects better than a simple That was **bold** of you. Amazing, actually?

Portable Text isn't meant for humans to read — it's meant for your software to process. If you read it slowly, you can get a feel for what this structure allows you to do. Properties like style, markDefs, and marks let us describe text blocks and inline text in any way we want, for any context we want.

This block of JSON can be serialized into clean text, HTML, or even Markdown. Or if you're writing for voice interfaces, you could easily make an editor for Speech Synthesis Markup Language (SSML).

The real power: marks and annotations

The real power comes with what you can do with markDefs and marks. A straightforward example is links:

But what if you wanted to print this and have that link also be a footnote? Portable Text handles that too:

If you step back and look at this object as a whole, you'll see that the rich text pattern is recurring inside the mark for the footnote. It's Portable Text all the way down. This approach opens up a lot of possibilities for how and where you want to use your text content.

Want to A/B-test on a product term? Add a mark for the term variation. Want to write unit tests for components with user-generated rich text data? It's much easier with this pattern compared to parsing HTML, which can come with all kinds of surprises and invalid syntax. Want to build a custom editorial comment system that only makes sense in your organization? Portable Text lets you do that without having to invent new markup inside an existing markup language.

Portable Text and AI agents

There's a more recent reason to care about Portable Text: AI agents need structure too.

When an AI agent reads or writes content, unstructured HTML or Markdown is genuinely harder to reason about. Portable Text's JSON structure gives agents something they can work with precisely — the semantic intent of each block is explicit, not implied by markup conventions. That makes it easier to extract meaning, generate context, and write content that fits predictably into your existing schema.

Sanity's Agent API and Agent Context are built on this foundation. Structured content isn't just good for your frontend — it's good infrastructure for agents that need to read and modify your content reliably.

Portable Text in Sanity Studio

Portable Text is also a significant part of how Sanity can offer real-time collaborative editing that works like Google Docs. It also gives you a way to customize how text you paste from other sources — like a webpage or a Word document — should be structured. Perhaps you want to store code snippets in a custom code block, or have your links output as footnotes because you use Sanity to make books.

The Portable Text Editor (PTE) in Sanity Studio is fully customizable. You can add custom block types, inline blocks, annotations, and validation rules that enforce things like heading order, prohibited characters, or your organization's specific style guide.

Rendering Portable Text

Adopting Portable Text for your CMS isn't giving up on HTML. It's accepting that you should be able to structure your content in a way that makes sense for your editors and organizational reality — not by the many specifications that come with markup languages. Then you serialize it into whatever output you need.

The @portabletext/react package makes this straightforward:

Libraries are available for React, HTML, and other targets. The spec itself lives at portabletext.org.

If you want to go deeper — data structure, serializers, custom blocks, and validation strategies — check out the beginner's guide to Portable Text in the docs.

Join us in the Sanity community on Discord or subscribe to our newsletter.