DEV Community

Discussion on: Displaying Markdown/ Strapi Rich Text in the Nuxt Frontend.

Collapse
 
kwiat1990 profile image
Mateusz Kwiatkowski

My site will be as well but I think it's suboptimal to have a router links all around the place and only in content from Strapi not. Sadly the way Strapi deals with rich text is far away from what's I would call flexible and good. I would love to have something like the rich text schema from Prismic. The way it is structured let you make whole bunch of stuff before (manipulating HTML elements and its properties is easy) it will be rendered.

Thread Thread
 
cwraytech profile image
Christopher Wray

One thing that you can do is use html for internal links and write Nuxt links that way in Strapi. The markdown parser that I used in this blog lets you allow html as well.

I do agree that the rich text in Strapi is not enjoyable.

Thread Thread
 
kwiat1990 profile image
Mateusz Kwiatkowski

My stack includes Gridsome instead of Nuxt.

I have tried to take advantage of the postrender function, which markdown parser offers, but Vue can't parsed the code correctly, so a router-link will be rendered direct in DOM. Instead I need to try to build some sort of wrapper component, which use Vue render function. Then hopefully it should work.

What's bother me also is the fact, that without any structure for rich text content it is (almost I guess) impossible to build any complicated layout, which would involve some CSS usage. It seems like Strapi want to make the content so simple as possible and tend to prefer stack layout, which make sense especially on mobile.

Thread Thread
 
cwraytech profile image
Christopher Wray • Edited

Actually, you can use dynamic fields in Strapi to build pretty complex layouts! You should check out the Strapi tutorials.

Like I said though before I do agree that the Rich text is not very nice./: