forked from drowl87/hextra_mirror
fix: process static image url correctly
This commit is contained in:
parent
b283227046
commit
79883dc7cc
@ -10,7 +10,7 @@
|
||||
{{- if and $dest $isRemote -}}
|
||||
{{- if $startsWithSlash -}}
|
||||
{{/* Images under static directory */}}
|
||||
{{- $dest = (relURL $dest) -}}
|
||||
{{- $dest = (relURL (strings.TrimPrefix "/" $dest)) -}}
|
||||
{{- else if and $isPage (not $startsWithRelative) -}}
|
||||
{{/* Images that are sibling to the individual page file */}}
|
||||
{{ $dest = (printf "../%s" $dest) }}
|
||||
|
@ -31,7 +31,9 @@
|
||||
{{- $image = $processed.RelPermalink -}}
|
||||
{{- else -}}
|
||||
{{/* Otherwise, use relative link of the image */}}
|
||||
{{- $image = ($image | relURL) -}}
|
||||
{{- if hasPrefix $image "/" -}}
|
||||
{{- $image = relURL (strings.TrimPrefix "/" $image) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user