I know, how I can add posts ( Admin API):
const html = '<h1>Hello World</h1>';
api.posts.add({
title: 'Migrating to Ghost - HTML card',
status: "published",
mobiledoc: JSON.stringify({
version: '0.3.1',
markups: [],
atoms: [],
cards: [['html', {cardName: 'html', html: html}]],
sections: [[10, 0]]
})
})
.then(response => console.log(response))
.catch(error => console.error(error));
I know that mobiledoc
is deprecated.
How can I do the same with lexical
?
Where can I find docs about lexical
?
Or can I always use mobiledoc
because it’s automatically converted to lexical
?
Thanks
Joe