diff --git a/README.md b/README.md index dcfff14..ae10a5f 100755 --- a/README.md +++ b/README.md @@ -271,6 +271,95 @@ Which is the short-hand equivalent to using `useStoryblokApi` inside `useState` ## Rendering Rich Text +You can render rich text fields by using the `StoryblokRichText` component: + +```html + +``` + +Or you can have more control by using the `useStoryblokRichText` composable: + +```html + + + +``` + +For more incredible options you can pass to the `useStoryblokRichText`, please consult the [Full options](https://github.com/storyblok/richtext?tab=readme-ov-file#options) documentation. + + +#### Overriding the default resolvers + +You can override the default resolvers by passing a `resolver` prop to the `StoryblokRichText` component, for example, to use vue-router links or add a custom codeblok component: : + +```html + + + +``` + +If you want to use the `useStoryblokRichText` composable, you can pass the `resolvers` via the options object: + +```html + +``` + +### Legacy Rendering Rich Text + +> [!WARNING] +> The legacy `richTextResolver` is soon to be deprecated. We recommend migrating to the new approach described above instead. + You can easily render rich text by using the `renderRichText` function that comes with `@storyblok/nuxt` and a Vue computed property: ```html diff --git a/playground/pages/richtext.vue b/playground/pages/richtext.vue new file mode 100644 index 0000000..9dfd7a9 --- /dev/null +++ b/playground/pages/richtext.vue @@ -0,0 +1,42 @@ + + + diff --git a/playground/storyblok/iframe-embed/index.vue b/playground/storyblok/iframe-embed/index.vue new file mode 100644 index 0000000..a68d559 --- /dev/null +++ b/playground/storyblok/iframe-embed/index.vue @@ -0,0 +1,11 @@ + +