support for images in page bundles as relative paths
This commit is contained in:
parent
bedcf7a212
commit
e4a10bab22
7 changed files with 55 additions and 11 deletions
|
|
@ -17,7 +17,11 @@
|
|||
{{ if .Site.Params.imageInArticlePreview }}
|
||||
{{ if .Params.Image }}
|
||||
<a class="unstyledLink" href="{{ .Permalink }}">
|
||||
<img src="{{ .Params.Image }}" />
|
||||
{{ if or (hasPrefix .Params.Image "/") (hasPrefix .Params.Image "http://") (hasPrefix .Params.Image "https://") }}
|
||||
<img src="{{ .Params.Image }}" />
|
||||
{{ else }}
|
||||
<img src="/{{ path.Join .File.Dir .Params.Image }}" />
|
||||
{{ end }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{end}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue