Skip to content

jordanl17/sanity-pte-interpolation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sanity-pte-interpolation

Demo

Embed dynamic variables inside Portable Text content in Sanity Studio, then resolve them to real values at render time in React. Think mail merge for rich text - an editor writes "Hello, {firstName}!" and the frontend substitutes the actual value at runtime.

Packages

This project ships three independent, decoupled packages:

Package Purpose
sanity-plugin-pte-interpolation Sanity Studio schema helper that adds variable picker inline blocks to the Portable Text Editor
pte-interpolation-react React rendering library that resolves variable blocks to real values
pte-interpolation-core Framework-agnostic utilities for variable extraction and plain string interpolation

See each package's README for full installation, usage, and API documentation.

Development

pnpm install
pnpm dev        # starts Studio + test app in parallel

See Local Development for the full dev workflow.

Documentation

License

MIT

About

Sanity Portable Text Editor plugin for interpolating values into PTE fields

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors