Search code examples
vue.jsnuxt.jsstoryblok

Iterate over headings in rich text component in Storyblok


I'm using storyblok-nuxt module. I have a storyblok component with rich text. I'd like to create a sidebar with list of heading that appears in this rich text for navigation purposes. Is there a way to extract those headings from rich text using storyapi, or do I need to do this manually?


Solution

  • I ended up creating "Article" component in Storyblok with title and body properties, where body is my rich text field. Iterating through titles is not a problem and in this case I make sure that every Article has a title.