diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-11-28 14:14:53 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-11-28 14:14:53 -0500 |
commit | 2b5e9f201f0e31fa1664fd1974136b2213577c3f (patch) | |
tree | ec8b7fb72c6554e435e8ee2ddd063522fe459b12 /generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html | |
parent | ba7cd6c830b4d0c56f9c11d5da9a054471c40c3d (diff) | |
download | thedroneely.com-2b5e9f201f0e31fa1664fd1974136b2213577c3f.tar.gz thedroneely.com-2b5e9f201f0e31fa1664fd1974136b2213577c3f.tar.bz2 thedroneely.com-2b5e9f201f0e31fa1664fd1974136b2213577c3f.zip |
hugo/layouts/shortcodes/sideimage: Add footnote figure shortcode
Diffstat (limited to 'generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html')
-rw-r--r-- | generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html b/generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html new file mode 100644 index 0000000..f60fc08 --- /dev/null +++ b/generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html @@ -0,0 +1,19 @@ +<label for="{{ .Get `mark` }}" class="sidenote-toggle sidenote-mark">{{ .Get `mark` }}</label> +<input type="checkbox" id="{{ .Get `mark` }}" class="sidenote-toggle"> + +<span class="sans-serif sidenote sideimage {{ .Get `set` }}note"> + +{{ safeHTML "<?php" }} +$width = getimagesize($_SERVER['DOCUMENT_ROOT'] . '{{.Get `source`}}')[0]; +$height = getimagesize($_SERVER['DOCUMENT_ROOT'] . '{{.Get `source`}}')[1]; +$ratio = ((($height / $width) * 100) > 100) ? $height . 'px' : $height / $width * 100 . '%'; +{{ safeHTML "?>" }} + + <a href="{{.Get `source`}}" onclick="return false;"> + <img data-image-zoom src="{{.Get `source`}}" alt="{{ .Inner }}" title="{{.Get `title`}}" + {{ safeHTMLAttr `<?php echo 'width=' . '"' . $width . '"'; ?>` }} + {{ safeHTMLAttr `<?php echo 'height=' . '"' . $height . '"'; ?>` }} /> + </a> + + <span class="sideimage-footer is-block has-text-centered has-text-grey-dark">{{ .Inner }}</span> +</span> |