aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/summary.html
blob: 356d0d90a9374603b884c7790c76ae6d18c1a5b0 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
{{- $wordLimit := gt .WordCount 75 -}}
{{- $content := partial "function-content.html" . | safeHTML -}}
{{- $expired := and .ExpiryDate (ge now.Unix .ExpiryDate.Unix) -}}
{{- $limit := and $wordLimit (not $expired) -}}

{{- if $limit -}}
  <input hidden type="checkbox" id="expand-{{ partial "card-id.html" . }}" />
{{- end -}}

<micro-card
  id="{{ partial "card-id.html" . }}"
  {{ if .Weight }}pinned{{ end }}
  {{ if $limit }}limit{{ end }}
  {{ if .Draft }}draft{{ end }}
  {{ if .ExpiryDate }}data-expires{{ end }}
>
  <micro-summary title="{{- partial "meta-title.html" . -}}">
    <micro-thumbnail>
      {{ partial "profile-picture.html" . }}
    </micro-thumbnail>
    <micro-content>
      {{ if $limit }}
        <micro-overlay>
          <micro-expand>
            <label for="expand-{{ partial "card-id.html" . }}">Click to Show</label>
          </micro-expand>
        </micro-overlay>
      {{ end }}
      <micro-metadata>
        {{ partial "card-meta-header.html" . }}
      </micro-metadata>
      {{ if .Params.unsafe }}
        {{ partial "card-unsafe.html" "begin" }}
          {{- $content -}}
        {{ partial "card-unsafe.html" "end" }}
      {{ else }}
        {{- $content -}}
      {{ end }}
      <micro-tags>{{ partial "meta-tags.html" . }}</micro-tags>
    </micro-content>
  </micro-summary>
</micro-card>