hugo/layouts/shortcodes/figscg.html
raw| 1 | <!-- |
| 2 | Our own shortcode for figures |
| 3 | Features: |
| 4 | Link to image by default |
| 5 | --> |
| 6 | |
| 7 | {{- $src := .Get "src" -}} |
| 8 | |
| 9 | <figure {{ with .Get "class" }}class="{{.}}"{{ end }}> |
| 10 | <a href="{{ $src }}"> |
| 11 | <img src="{{ $src }}" {{ with .Get "width" }}width="{{.}}"{{end}}> |
| 12 | </a> |
| 13 | <figcaption> |
| 14 | <p> {{- .Get "caption" -}} </p> |
| 15 | </figcaption> |
| 16 | </figure> |