diff --git a/docs/src/docPages/api/commands.md b/docs/src/docPages/api/commands.md index 8a28b065..b358aeb8 100644 --- a/docs/src/docPages/api/commands.md +++ b/docs/src/docPages/api/commands.md @@ -9,7 +9,7 @@ The editor provides a ton of commands to programmtically add or change content o All available commands are accessible through an editor instance. Let’s say you want to make text bold when a user clicks on a button. That’s how that would look like: ```js -editor.commands.toggleBold() +editor.commands.addBold() ``` While that’s perfectly fine and does make the selected bold, you’d likely want to change multiple commands in one run. Let’s have a look at how that works. @@ -70,12 +70,12 @@ editor Both calls would return `true` if it’s possible to apply the commands, and `false` in case it’s not. ### Try commands -If you want to run a list of commands, but want only the first successful command to be applied, you can do this with the `.try()` method. This method runs one command after the other and stops at the first which returns `true`. +If you want to run a list of commands, but want only the first successful command to be applied, you can do this with the `.first()` method. This method runs one command after the other and stops at the first which returns `true`. For example, the backspace key tries to undo an input rule first. If that was successful, it stops there. If no input rule has been applied and thus can’t be reverted, it runs the next command and deletes the selection, if there is one. Here is the simplified example: ```js -editor.try(({ commands }) => [ +editor.first(({ commands }) => [ () => commands.undoInputRule(), () => commands.deleteSelection(), // … @@ -85,7 +85,7 @@ editor.try(({ commands }) => [ Inside of commands you can do the same thing like that: ```js -commands.try([ +commands.first([ () => commands.undoInputRule(), () => commands.deleteSelection(), // … diff --git a/docs/src/templates/DocPage/index.vue b/docs/src/templates/DocPage/index.vue index ef5b0a2f..cbcd1b05 100644 --- a/docs/src/templates/DocPage/index.vue +++ b/docs/src/templates/DocPage/index.vue @@ -29,11 +29,23 @@ export default { property: 'og:title', content: this.$page?.docPage?.title, }, + { + property: 'og:image', + content: 'https://next.tiptap.dev/og-image.png', + }, /* Twitter */ { name: 'twitter:title', content: this.$page?.docPage?.title, }, + { + name: 'twitter:card', + content: 'summary_large_image', + }, + { + name: 'twitter:image', + content: 'https://next.tiptap.dev/og-image.png', + }, { name: 'twitter:site', content: '@_ueberdosis', diff --git a/docs/src/static/_redirects b/docs/static/_redirects similarity index 100% rename from docs/src/static/_redirects rename to docs/static/_redirects diff --git a/docs/static/og-image.png b/docs/static/og-image.png new file mode 100644 index 00000000..badef8df Binary files /dev/null and b/docs/static/og-image.png differ