aboutsummaryrefslogtreecommitdiff
path: root/www/layouts/shortcodes/link-group.html
blob: b16c2bc855f11eec3b140a8fad94666a49e4431f (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
<div class="mono link-group">
  {{ $self := . }}
  {{ $lines := slice }}
  {{ range split .Inner "\n" }}
    {{ if strings.ContainsNonSpace . }}
      {{ $lines = $lines | append (strings.TrimSpace .) }}
    {{ end }}
  {{ end }}
  {{ $notitle := false }}
  {{ if .IsNamedParams }}
    {{ $notitle = .Get "notitle" }}
  {{ else }}
    {{ $notitle = in .Params "notitle" }}
  {{ end }}
  {{ if not $notitle }}
    {{ $title := index $lines 0 }}
      <div class="link-group-title">{{ $title | $self.Page.RenderString }}</div>
      {{ $lines = $lines | after 1 }}
  {{ end }}
  <div class="link-group-list">
    {{ range $lines }}
      <div class="link-group-item">{{ . | $self.Page.RenderString }}</div>
    {{ end }}
  </div>
</div>