lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
199 stars 98 forks source link

HTML code in .md file is ignored #108

Closed JonAugust closed 1 year ago

JonAugust commented 1 year ago

I'm trying to include links with a target to _blank. I don't think markdown allows for that and I've read the solution is to just use real html:

<a href="https://ASiteWithArticles.com/" target="_blank">Articles!</a>

But, my Hugo/Poison environment seems to strip these completely. Is there a solution to this issue?

Thank you for your help!

lukeorth commented 1 year ago

Hi, @JonAugust -- thank you for the issue.

After some research, I was able to override how Hugo renders links within the theme. Now, all links in markdown will automatically have target="_blank", so you don't need to add the HTML yourself. You can also add titles to your links to give readers more context about them (see examples below).

With a title

Markdown: This is a [test link](https://google.com/ "Google") with a title.

Result: image

Without a title

This is a [test link](https://google.com/) without a title.

Result: image

I hope this helps! :slightly_smiling_face:

JonAugust commented 1 year ago

Awesome! Thank you for adding this!