1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-17 14:45:31 -04:00

image height calculations were wrong

This commit is contained in:
2019-11-18 14:15:04 -05:00
parent afd5e36047
commit d42a00247f
2 changed files with 3 additions and 2 deletions

View File

@@ -1 +1 @@
<iframe height="{{ if .Get "height" }}{{ .Get "height" }}{{ else }}500{{ end }}" style="width: 100%;" scrolling="no" src="https://codepen.io/{{ .Get "username" }}/embed/{{ .Get "id" }}/?height={{ if .Get "height" }}{{ .Get "height" }}{{ else }}500{{ end }}&amp;theme-id=light&amp;default-tab={{ .Get "left-tab" }}{{ if .Get "right-tab" }},{{ .Get "right-tab" }}{{ end }}" frameborder="no" allowtransparency="true" allowfullscreen="true"></iframe>
<iframe height="{{ if .Get "height" }}{{ .Get "height" }}{{ else }}500{{ end }}" style="width: 100%;" scrolling="no" src="https://codepen.io/{{ .Get "username" }}/embed/{{ .Get "id" }}/?height={{ if .Get "height" }}{{ .Get "height" }}{{ else }}500{{ end }}&amp;theme-id=light&amp;default-tab={{ .Get "left-tab" }}{{ if .Get "right-tab" }},{{ .Get "right-tab" }}{{ end }}"></iframe>

View File

@@ -24,8 +24,9 @@
{{- $image := .Scratch.Get "image" -}}
{{- $origRatio := (div (float $image.Height) $image.Width) }}
{{- $displayWidth := $setWidth -}}
{{- $displayHeight := (math.Round (div $image.Height 2)) -}}
{{- $displayHeight := (math.Ceil (mul $origRatio $setWidth)) -}}
{{- if .Get "caption" -}}
<figure>