framer-cms-markdown
v0.0.5
Published
Sync's Framer CMS content from/to markdown
Readme
framer-cms-markdown
Sync's Framer CMS content from/to markdown
Export
Install dependencies, build, then run:
npm install
npm run build
npx framer-to-markdown --token <framer-token> --config config/use-cases.ymlEach export case lives in its own config file under config/.
For the included use-cases config, files are written to:
content/use-cases/
The config controls:
site: Framer project URL or IDcollection: CMS collection name or IDcontent: export directorymarkdown: either a single body field name or the special valuesectionsmetadata: list of collection field names to copy into frontmatter verbatim
It also strips HTML comments from the markdown body before writing the file, so Framer-exported metadata comments do not end up in the final markdown.
When markdown: sections is used, the exporter reads every field matching Section NN HTML, sorts them numerically, converts each HTML fragment to markdown, and concatenates them into the final body.
After assembly, the complete markdown document is normalized with Prettier before it is written to disk.
Import
Push local markdown content back to Framer with the same config:
npm run markdown-to-framer -- --token <framer-token> --config config/use-cases.ymlThe importer:
- reads every
.mdfile undercontent - parses YAML frontmatter
- maps
metadatafields by name into Framer fields - converts the markdown body back to Framer content
- when
markdown: sectionsis set, splits the document into sections, writes them to orderedSection NN HTMLfields, and populates matchingSection NN Titlefields from each section's first heading - creates new items or updates existing ones by matching
slug
