
**Update 2026: This is no longer needed, Framer supports code blocks in the CMS nowadays!**
I never really had a case for a blog so far, but as part of joining Framer I was given the task to create an actual site. And, just as that was ongoing Framer started to roll out Sites into public beta, and shortly thereafter the content management features.
Perfect storm … Make a site, and keep my onboarding learnings as "blog posts" in it.
And then the usual happened: In my first note I wanted to document how I used a piece of code to achieve a functionality that should be possible to without code, and I learned that the CMS editor doesn't yet support any code blocks :(
This note then is about how to make these appear, and to start off with the result: Here's a code block, showing the code needed to inject it. :)
$${0}$$
Mission Statement
1. Be able to paste a block of code from my code editor into the CMS content editor
2. Get this block of code rendered into the regular text at a specified position
3. Bonus: Get the code syntax-highlighted
1. Copying and pasting code
[TBD: Drops newlines etc, so one would need to reformat]
2. Getting the code rendered
[TBD: Explain the approach]
3. Syntax Highlighting
[TBD: Using a different renderer]
[TBD: Link to the next article re markdown rendering, which is basically the same thing but then skipping the richtext editor and instead just using a markdown text area.]