calintat / minimal

Personal blog theme powered by Hugo
https://themes.gohugo.io/minimal/
MIT License
404 stars 222 forks source link

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

Open PaulRBerg opened 4 years ago

PaulRBerg commented 4 years ago

Is this possible without a PR or a fork?

aolingo commented 4 years ago

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 yourconfig.toml file.

Awan commented 4 years ago

I'm just working on that.

PaulRBerg commented 4 years ago

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.

Awan commented 4 years ago

I have it working in blog posts but not in bar

Awan commented 4 years ago

abdullah.today/blog/

Awan commented 4 years ago

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

illupino commented 4 years ago

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 yourconfig.toml file.

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

acim commented 3 years ago

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