mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 14:21:18 +00:00
Merge pull request #3567 from zubron/render-fragments-in-markdown
Correctly render links with fragments on docs pages
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
{{ $link := .Destination }}
|
||||
{{ if not (strings.HasPrefix $link "http") }}
|
||||
{{ $link = (.Page.GetPage .Destination).RelPermalink }}
|
||||
{{ $url := urls.Parse .Destination }}
|
||||
{{- if $url.Path -}}
|
||||
{{ $fragment := "" }}
|
||||
{{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}}
|
||||
{{- with .Page.GetPage $url.Path }}{{ $link = printf "%s%s" .RelPermalink $fragment }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<a href="{{ $link | safeURL }}">{{ .Text | safeHTML }}</a>
|
||||
Reference in New Issue
Block a user