HOW TO OPEN LINKS IN A NEW TAB IN MAINROAD HUGO THEME

HOW TO OPEN LINKS IN A NEW TAB IN MAINROAD HUGO THEME

I bet that many of you would like to open site links not in the same window, but in a background tab.
Such behavior is restricted by default settings of most Hugo themes. Mainroad is restricting it also.
Here is a solution on how to overcome weird limitation.

Create file render-link.html in _default folder of the theme.

Name_of_your_site\themes\mainroad\layouts\_default\_markup\render-link.html 

Contents of render-link.html should be like this:

<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>