aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/section.media.html
blob: 4fc82fbf2a2dad218e59a778ad002515c1f99c66 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{{- define "styles" -}}
{{- $author := partial "function-authors-data.html" . -}}
{{- $author = $author.user -}}
<style>
  {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }}

  tab-bar a[href*="{{ $author | relURL }}/media"] {
    color: #111;
    color: var(--foreground);
    font-weight: 700;
    text-decoration-color: #014cc6;
    text-decoration-color: var(--link);
    text-decoration: underline;
    border-bottom: 2px solid var(--background);
  }
</style>
{{- end -}}

{{- define "header" -}}
  {{- partial "navigator-middle.html"
    (dict
      "Title"      "Media"
      "Subtitle"   (print (partial "count-media.html" .) " " "Total")
      "Icon"       "arrow-left"
      "IconLabel"  "Back"
      "Href"       ("" | relURL)
      "Id"         "back"
      "Context"    .
    )
  -}}

  {{- partial "profile.html" . -}}
{{- end -}}

{{- define "middle" -}}
  {{- $author := partial "function-authors-data.html" . -}}
  {{- $notFeeds := where .Site.RegularPages "Params.feed" "eq" nil -}}
  {{- $authors := where .Site.RegularPages "Section" $author.user -}}
  {{- $filteredPages := $authors | intersect $notFeeds -}}
  {{- $count := 0 -}}

  {{- range first 100 $filteredPages -}}
    {{- if eq $count 10 -}}
      {{- break -}}
    {{- end -}}
    {{- if or
      (in .Content "</video>")
      (in .Content "</picture>")
      (in .Content "</youtube-video>")
    -}}
      {{- partial "render-embed.html" . -}}
      {{- $count = add $count 1 -}}
    {{- end -}}
  {{- end -}}

  {{- if not $count -}}
  <footer>
    <code>No items found!</code>
  </footer>
  {{- end -}}
{{- end -}}

{{- define "right" -}}
  {{- partial "navigator-right.html" . -}}
{{- end -}}