diff --git a/assets/sass/custom.scss b/assets/sass/custom.scss index 55600d2..2e34894 100644 --- a/assets/sass/custom.scss +++ b/assets/sass/custom.scss @@ -38,4 +38,8 @@ display: inline-block; padding-right: 1em; font-size: 1rem; -} \ No newline at end of file +} + +#content article img { + width: 100%; +} diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..51fd594 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,22 @@ +{{- $u := urls.Parse .Destination -}} +{{- $src := $u.String -}} +{{- if not $u.IsAbs -}} + {{- $path := strings.TrimPrefix "./" $u.Path }} + {{- with or (.PageInner.Resources.Get $path) (resources.Get $path) -}} + {{- $src = (.Resize "1400x jpg q50").RelPermalink -}} + {{- with $u.RawQuery -}} + {{- $src = printf "%s?%s" $src . -}} + {{- end -}} + {{- with $u.Fragment -}} + {{- $src = printf "%s#%s" $src . -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- $attributes := merge .Attributes (dict "alt" .Text "src" $src "title" (.Title | transform.HTMLEscape)) -}} + +{{- /**/ -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 010bbfa..b8731cd 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -27,7 +27,7 @@ {{- if in $rasters $img.MediaType.SubType -}} {{- $img = $img.Resize (printf "x%d" $maxHeight) -}} - {{ .Params.image_alt }} + {{ .Params.image_alt }} {{ else }} {{ .Params.image_alt }} {{ end }}