summaryrefslogtreecommitdiffstats
path: root/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/showcase/single.html
blob: 5ae1e07a7cc5021b08bb6100b1662c6fc233f803 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{{ define "title" }}
Showcase: {{ .Title }}
{{ end }}

{{ define "main" }}
  <article class="center ph3 ph4-ns pv3 pv5-ns mw9">

    <!-- header spans the full width -->
    <div class="flex flex-wrap">

      <div class="w-100 w-20-l order-1 order-0-l">
        {{template "sc-details" .}}
      </div>

      <div class="w-100 w-60-l order-0 order-1-l ph4-l">
        {{template "sc-main-column" .}}
      </div>

      <aside class="dn mid-gray w-100 w-20-ns flex-l justify-center order-2">
        {{template "sc-navigation" .}}
      </aside>

    </div>

    <div class="f6 gray mv6">{{/* bottom row */}}
      Last Update: {{ .Lastmod.Format "January 2, 2006" }} <br>
      {{ partial "page-edit.html" . }}
    </div>
    <div class="b">The Showcase articles are copyright the content authors. Any open source license will be attached.</div>
  </article>
{{ end }}



{{define "sc-main-column"}}
  {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
  {{ with $img }}
    {{ $big := .Fill "1024x512 top" }}
    {{ $small := $big.Resize "512x" }}
    <img
      alt="{{ $img.Title }}"
      src="{{ $big.RelPermalink }}"
      srcset="{{ $small.RelPermalink }} 512w, {{ $big.RelPermalink }} 1024w"
      sizes="(min-width: 1570px) 822px, (max-width: 1569px) and (min-width: 960px) 50vw, 93vw"
      width="{{ $big.Width }}"
      class="mw-100 b--light-gray ba"
    >
  {{ end }}
   <div class="mid-gray nested-copy-line-height nested-img nested-links">
  {{with .Params.byline }}
     <div style="margin-top: 20px; font-style: italic;">By {{ . | markdownify -}}</div>
  {{ end }}
  {{with .Content}}
      {{- . -}}
  {{end}}
  </div>

{{end}}

{{define "sc-details"}}
  <div class="mt4 mt0-ns nested-links">
    <div class="ba b--light-gray bg-white pa3">
      <h1 class="f2-fluid mt0">{{.Title}}</h1>
      {{ with .Params.siteURL }}
      <a href="{{ . }}" class="db f5 mb1">{{ . | replaceRE "^https?://(www\\.)?([^/]+).*" "$2"}} {{ partial "svg/link-ext.svg" (dict "size" "10") }}</a>
      {{ end }}
      {{ with .Params.siteSource }}
      <a href="{{ . }}" class="db mb4">source {{ partial "svg/link-ext.svg" (dict "size" "10") }}</a>
      {{ end }}
      {{ $bio := (.Resources.ByType "page").GetMatch "bio*" }}
      {{ with $bio }}
        <div class="f6 mid-gray nested-copy-line-height nested-links">
          {{- .Content -}}
        </div>
      {{ end }}
    </div>
    <div class="b--light-gray bt dn-l pt3">
      <div class="f6 gray mb2">Previous/Next</div>
      {{- partial "previous-next-links-in-section-with-title.html" . -}}
    </div>
  </div>
{{end}}

{{define "sc-navigation"}}
  {{$section := where .Site.RegularPages "Section" .Section}}
  {{$number_of_entries := $section | len}}
  <ul class="pa0 list">
  <li class="b f5 blTK b--light-gray pb2 pl2">
      More Sites
  </li>
    {{range first 20 $section}}
      <li class="bl b--light-gray pl2 f6 hover-bg-light-gray hover-accent-color-light {{if eq $ .}} bg-light-gray{{end}}">
        <a href="{{.RelPermalink}}" class="db link w-100 pv1 ph1 {{ if eq $ . }} b  primary-color{{else}} mid-gray {{end}}">
          {{- .Title -}}
        </a>
      </li>
    {{end}}
    {{if gt $number_of_entries 20}}
      <li class="mt3">
        <a href="/showcase/page/2/" class="link blue">
          See More &raquo;
        </a>
      </li>
    {{end}}
  </ul>
{{end}}