0

I'm creating a blog using MDX in NEXTJS. It always has a reference at the end to attach that referenced page, which seems inefficient because it repeats every time. Is there any way to reuse this code in a plugin or some other way?

<div className="post_ref">

### reference

<a
  href="blablabla"
  target="_blank"
>
  blablabla
</a>

</div>

The only reason I wrapped it in div tags is for styling purposes, and I added the classname to the The reason for the a-tag is to utilize the target attribute.

This seems really inefficient. Is there a better way? And when I attach an image, I want to leave the source of that image below, and style that a-tag. Is there any way to style it after specifying it with markdown syntax like the code below?

I am using contentlayer in next13.


![error1](/imgs/posts/15/error1.png)
[google](https://www.google.com)
pvp11
  • 204
  • 2
  • 10

0 Answers0