diff options
Diffstat (limited to 'themes/default/layouts/shortcodes/react.html')
-rw-r--r-- | themes/default/layouts/shortcodes/react.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/themes/default/layouts/shortcodes/react.html b/themes/default/layouts/shortcodes/react.html new file mode 100644 index 0000000..7eb7920 --- /dev/null +++ b/themes/default/layouts/shortcodes/react.html @@ -0,0 +1,29 @@ +{{- $text := default "react" (.Get "text" | default (.Get 0)) -}} +{{- $source := default "" (.Get "source" | default (.Get 1)) -}} +{{- $title := default $text (.Get "title" | default (.Get 2)) -}} +{{- $alternate := default $title (.Get "alternate" | default (.Get 3)) -}} + +{{- $author := .Page.Section -}} + +{{- $image := partial "function-caches-images.html" + (dict + "Source" $source + "Fit" "100x100" + "Target" (print (partial "function-paths.html" "media") "/" $author "/") + "Copy" (print (partial "function-paths.html" "media") "/" $author "/react-" (path.Base $source)) + "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author "/react-" (path.BaseName $source) ".webp") + ) +-}} + +<reaction-hover title="{{ $title }}"> + {{ $text | markdownify }} + <a href="{{ $image.Permalink }}"> + <img + width="{{ $image.Width }}" + height="{{ $image.Height }}" + title="{{ $title }}" + alt="{{ $alternate }}" + src="{{ $image.Permalink }}" + /> + </a> +</reaction-hover> |