Merge pull request #211 from soofaloofa/allow-relative-bigimg-paths

Allow relative paths for bigimg.
This commit is contained in:
Michael Romero 2018-10-30 22:39:00 -07:00 committed by GitHub
commit a5c9ede88f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,15 @@
{{ if or $bigimg $title }}
{{ if $bigimg }}
<div id="header-big-imgs" data-num-img={{len $bigimg}} {{range $i, $img := $bigimg}}data-img-src-{{add $i 1}}="{{$img.src | absURL }}" {{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}{{end}}></div>
<div id="header-big-imgs" data-num-img={{len $bigimg}}
{{range $i, $img := $bigimg}}
{{ if (fileExists $img.src)}}
data-img-src-{{add $i 1}}="{{$img.src | absURL }}"
{{else}}
data-img-src-{{add $i 1}}="{{$img.src}}"
{{end}}
{{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}
{{end}}></div>
{{ end }}
<header class="header-section {{ if $bigimg }}has-img{{ end }}">