Try to fix the images path that need to be absoluts

This commit is contained in:
Alexis Tacnet
2017-03-07 12:44:31 +01:00
parent bd6e2052d4
commit 7b2fd7ea78
2 changed files with 4 additions and 2 deletions

View File

@@ -5,7 +5,8 @@
{{ partial "page-heading.html" . }}
<div class="markdown">
{{ if .Site.Params.progressively }}
{{ .Content | replaceRE "<img src=(.*)\\/(.*) alt=(.*)>" "<figure class=\"progressive\"><img class=\"progressive__img progressive--not-loaded\" data-progressive=$1/high/$2 src=$1/low/$2 alt=$3></figure>" | safeHTML }}
{{ $newImage := (print "<figure class=\"progressive\"><img class=\"progressive__img progressive--not-loaded\" data-progressive=\"" .Site.BaseURL "$1/high/$2\" src=\"$1/low/$2\" alt=$3></figure>") }}
{{ .Content | replaceRE "<img src=\"/(.*)\\/(.*)\" alt=(.*)>" $newImage | safeHTML }}
{{ else }}
{{ .Content }}
{{ end }}