mirror of
https://github.com/maikka39/Personal-Website.git
synced 2026-09-27 20:46:25 +00:00
Set html size attributes for images
This commit is contained in:
@@ -37,11 +37,14 @@
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<figure class="post-cover">
|
||||
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
|
||||
|
||||
{{ if .Params.UseRelativeCover }}
|
||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}"
|
||||
alt="{{ .Title | plainify | default " " }}" />
|
||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Title | plainify | default " " }}"
|
||||
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||
{{ else }}
|
||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}" />
|
||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}"
|
||||
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.CoverCaption }}
|
||||
|
||||
@@ -34,9 +34,11 @@
|
||||
<hr />
|
||||
{{- end }}
|
||||
|
||||
{{ with .Params.Cover }}
|
||||
<img src="/{{ . }}" class="post-cover" />
|
||||
{{ end }}
|
||||
{{- if .Params.Cover }}
|
||||
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
|
||||
<img src="/{{ .Params.Cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}"
|
||||
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||
{{- end }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ .Content }}
|
||||
|
||||
Reference in New Issue
Block a user