aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes/react.html
blob: e7c260d9c38fbde637fdfa94a47f65be389ab581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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-tip title="{{ $title }}">
  {{ $text | markdownify }}
  <a href="{{ $image.Permalink }}">
    <img
      width="{{ $image.Width }}"
      height="{{ $image.Height }}"
      title="{{ $title }}"
      alt="{{ $alternate }}"
      src="{{ $image.Permalink }}"
    />
  </a>
</reaction-tip>