summaryrefslogtreecommitdiff
path: root/layouts/partials/reviews/metrics.html
blob: 87ade7138c04e44e38b27aa977446c22a11704a6 (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
  <div class="poster">
    {{- $path := .Params.image }}
    {{- $img := resources.Get $path }}
    {{- $img1x := $img.Resize "170x webp" }}
    {{- $img2x := $img.Resize "340x webp" }}

    <img 
      alt="Cover" 
      src="{{ $img1x.Permalink }}" 
      srcset="
              {{ $img1x.Permalink }} 1x,
              {{ $img2x.Permalink }} 2x
              "
      width="{{ $img1x.Width }}" 
      height="{{ $img1x.Height }}"
      >
  </div>

  <div class="rating">
{{ $rating := .Params.rating}}
    My rating:<br>

    {{- range $i, $sequence :=  (seq 15) }}
      {{- if le (mul $sequence 25) (mul (sub $rating 1) 100)}}█{{- else}}░{{- end }}
    {{- end }}
    <br>
    <b>{{ $rating }}/5</b> 
    </div>