minimal icon indicating copy to clipboard operation
minimal copied to clipboard

How to add "target=_blank" for links in a post?

Open PaulRBerg opened this issue 4 years ago • 8 comments

Is this possible without a PR or a fork?

PaulRBerg avatar May 14 '20 18:05 PaulRBerg

You can always resort to inline HTML for links in your .md files.

<a href="http://example.com/" target="_blank">Hello, world!</a>

If you are doing it this way, depending on your markdown processors, you might have to make some additional changes to your config.toml file.

aolingo avatar May 14 '20 23:05 aolingo

I'm just working on that.

Awan avatar May 22 '20 00:05 Awan

Thanks @aolingo. The only issue with inline HTML is that I'd need to do massive refactor. Having the ability to set the target on all links via a layout file would be amazing.

PaulRBerg avatar May 22 '20 11:05 PaulRBerg

I have it working in blog posts but not in bar

Awan avatar May 22 '20 11:05 Awan

abdullah.today/blog/

Awan avatar May 22 '20 11:05 Awan

I got success opening URLs in new tab but within theme layouts's directory even if I add those custom layouts, I couldn't. I made it working by putting a layout in my site directory.

On 22/05, Paul Razvan Berg wrote:

Thanks @aolingo. The only issue with inline HTML is that I'd need to do massive refactor. Having the ability to set the target on all links via a layout file would be amazing.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/calintat/minimal/issues/105#issuecomment-632638103

Abdullah

https://abdullah.today

C20F 2707 3025 2569 BAC5 534B 7820 6670 C19D 1580

Awan avatar May 22 '20 22:05 Awan

You can always resort to inline HTML for links in your .md files.

<a href="http://example.com/" target="_blank">Hello, world!</a>

If you are doing it this way, depending on your markdown processors, you might have to make some additional changes to your config.toml file.

That worked for me, with Goldmark and "unsafe" - THX!

illupino avatar Jun 08 '20 12:06 illupino

https://gist.github.com/killbus/f47efbd13d96b437b9d218334508bffb

acim avatar Feb 28 '21 00:02 acim