project_graphql_blog
project_graphql_blog copied to clipboard
include external links within the content
I want to embed some links in my posts. Graphcms allows me to include links, but they do not display on my website. I appreciate any suggestions you may have.
I used rich text renderer. Just follow their doc.
I'm having trouble with this too. I've tried the rich-text-renderer but can't get it to work with the existing code. Feel like it should be rather simple. I think JSM mentioned it in the video, like something you could do swiftly, if you felt like it.
Tried building something referencing this code, but can't get it to work:
[REPLY] Ícaro Teles youtube.com/channel/UCSQET804y4VUVqMmk2FpS9A
youtube.com/watch?v=HYv55DhgTuA&lc=Ugx7_LaGcjQAIEQEGCp4AaABAg.9dOrmIWz2M09eEAuJF_V3e for 3 måneder siden | like: 1
If I may, you should modify the "getContentFragment" function of the "PostDetail" component to encompass more cases, in addition to the ones it has already placed. For example, in the video he considers cases with "bold", "italic", "underline", "h4", "h3", "p" and "image". You should extend it, depending on your need.
For an example, I added a case for "block-quote", like this:
case "block-quote":
return(
<blockquote key={index} className="text-md mb-4">
{modifiedText.map((item, i) => (
<React.Fragment key={i}>"{item}"</React.Fragment>
))}
</blockquote>
);