aboutsummaryrefslogtreecommitdiff
path: root/generators/hugo/themes/tdro/layouts/shortcodes/sideimage.html
blob: 0e18a561d44d20aba95454f861ad55b401a2f51c (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
{{- $mark   := (.Get `mark`)   -}}
{{- $set    := (.Get `set`)    -}}
{{- $source := (.Get `source`) -}}
{{- $title  := (.Get `title`)  -}}
{{- $id := md5 (printf $mark .Inner) -}}
{{- $imageFile := print "public" $source -}}
{{- $image := imageConfig $imageFile -}}

<side-note-aside>
  <label for="{{ $id }}" title="{{ .Inner | replaceRE "\n" " " | markdownify }}"><span>{{ $mark | markdownify }}</span></label>
  <input type="checkbox" id="{{ $id }}" name="toggle">
  <side-note title="{{ $mark }}" image {{ $set }}>
    <a href="{{ $source }}">
      <img
        loading="lazy"
        data-image-zoom=""
        src="{{ $source }}"
        title="{{ $title }}"
        width="{{ $image.Width }}"
        height="{{ $image.Height }}"
        alt="{{ .Inner | markdownify }}"
      />
    </a>
    <mark>{{ .Inner | markdownify }}</mark>
  </side-node>
</side-note-aside>