Skip to content
Permalink
Browse files

feat: add Markdown render hook to parse links

Adds support for opening external links in new tabs in Hugo v0.62+.

BREAKING CHANGE:
Requires Hugo v0.62

See #1514
  • Loading branch information
gcushen committed Jan 11, 2020
1 parent d995e4d commit db716b2349ed952a341818abe7c5ca1ac726a7db
Showing with 4 additions and 2 deletions.
  1. +2 −0 layouts/_default/_markup/render-link.html
  2. +1 −1 netlify.toml
  3. +1 −1 theme.toml
@@ -0,0 +1,2 @@
{{/* A Hugo Markdown render hook to parse links, opening external links in new tabs. */}}
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
@@ -5,7 +5,7 @@

[build.environment]
HUGO_THEME = "repo"
HUGO_VERSION = "0.60.1"
HUGO_VERSION = "0.62.2"
HUGO_ENABLEGITINFO = "true"

[context.production.environment]
@@ -3,7 +3,7 @@ license = "MIT"
licenselink = "https://github.com/gcushen/hugo-academic/blob/master/LICENSE.md"
description = "The website builder for Hugo. Build *anything* with widgets and deploy with one click! Fully personalize your site with themes, plugins, and language packs."
homepage = "https://sourcethemes.com/academic/"
min_version = "0.60"
min_version = "0.62"
tags = ["widgets",
"resume",
"portfolio",

0 comments on commit db716b2

Please sign in to comment.
You can’t perform that action at this time.