Skip to content

Commit

Permalink
Use relURL for post-cover
Browse files Browse the repository at this point in the history
Use relURL instead of statically adding a / in front of the path.  
Otherwise, this would give issues with external URLs. Also assumes user would know that a / is added in front of the path, making it relative to the root.
  • Loading branch information
TheGroundZero authored Jul 24, 2020
1 parent 6fa58f6 commit f9ccae8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{- end }}

{{ with .Params.Cover }}
<img src="/{{ . }}" class="post-cover" />
<img src="{{ . | relURL }}" class="post-cover" />
{{ end }}

<div class="post-content">
Expand Down

0 comments on commit f9ccae8

Please sign in to comment.