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 | |
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
-rw-r--r-- | generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html | 19 | ||||
-rw-r--r-- | public/css/tdro.css | 4 |
2 files changed, 22 insertions, 1 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> diff --git a/public/css/tdro.css b/public/css/tdro.css index 395f9f7..157f94a 100644 --- a/public/css/tdro.css +++ b/public/css/tdro.css @@ -4574,7 +4574,9 @@ figcaption { font-size: 0.9em; margin-top: 1.5em; } color: #333; } -.sidenote code, .marginnote code { overflow-wrap: break-word; display: inline-block; word-break: break-all; } +.sidenote, .marginnote { overflow-wrap: break-word; word-break: break-all; word-break: break-word; } + +.sideimage a { border-bottom: 1px solid transparent; } @media (min-width: 769px) { .rightnote { padding-right: 1.125em; } .leftnote { text-align: right; padding-left: 1.125em; } .leftnote, .rightnote { max-width: 22em; } } @media (min-width: 2000px) { .leftnote { margin-left: -28em; } .rightnote { margin-right: -28em; } } |