2 changed files with 21 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||
<!-- This shortcode renders an HTML figure based on a page resource --> |
|||
{{ $filename := .Get "src" }} |
|||
{{ $image := .Page.Resources.GetMatch (printf "%s" $filename) }} |
|||
<figure> |
|||
<img src="{{ $image.Permalink }}"> |
|||
{{ with .Get "title" }} |
|||
<figcaption> |
|||
{{ . }} |
|||
</figcaption> |
|||
{{ end }} |
|||
</figure> |
|||
@ -0,0 +1,10 @@ |
|||
<!-- This shortcode renders an HTML figure based on a file dropped in the /public folder --> |
|||
{{ $url := .Get "src" }} |
|||
<figure> |
|||
<img src="{{ $url }}"> |
|||
{{ with .Get "title" }} |
|||
<figcaption> |
|||
{{ . }} |
|||
</figcaption> |
|||
{{ end }} |
|||
</figure> |
|||
Loading…
Reference in new issue