mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
link: resolve fragments #775
This commit is contained in:
parent
07542867aa
commit
4278578bda
1 changed files with 3 additions and 1 deletions
|
@ -16,7 +16,9 @@
|
|||
{{- $u := urls.Parse $url }}
|
||||
{{- $href := $u.String }}
|
||||
{{- $path := $u.Path }}
|
||||
{{- if $u.IsAbs }}
|
||||
{{- if strings.HasPrefix $href "#" }}
|
||||
{{- $href = printf "%s#%s" $page.Page.RelPermalink $u.Fragment }}
|
||||
{{- else if $u.IsAbs }}
|
||||
{{- $target = "_blank" }}
|
||||
{{- if isset $page.Site.Params "externallinktarget" }}
|
||||
{{- $target = $page.Site.Params.externalLinkTarget }}
|
||||
|
|
Loading…
Reference in a new issue