mirror of https://github.com/docker/docs.git
Merge pull request #20386 from dvdksn/fix-404-imgs
hugo: fix invalid image refs for section pages
This commit is contained in:
commit
6cb12cc24e
|
@ -2,7 +2,11 @@
|
|||
{{- $src := $u.String -}}
|
||||
{{ if not (or $u.IsAbs (strings.HasPrefix $u.String "/")) }}
|
||||
{{ $base := urls.Parse .Page.Permalink }}
|
||||
{{ $src = $base.JoinPath "../" $u.Path -}}
|
||||
{{ if eq .Page.Kind "section" }}
|
||||
{{ $src = $base.JoinPath $u.Path -}}
|
||||
{{ else }}
|
||||
{{ $src = $base.JoinPath "../" $u.Path -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $params := $u.Query }}
|
||||
|
|
Loading…
Reference in New Issue