File: list.html

package info (click to toggle)
hugo 0.155.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,600 kB
  • sloc: javascript: 31,879; ansic: 2,350; xml: 350; makefile: 196; sh: 110
file content (69 lines) | stat: -rw-r--r-- 2,759 bytes parent folder | download | duplicates (3)
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
{{ define "main" }}
  {{ $pages := "" }}
  {{ if .IsPage }}
    {{/* We currently have a slightly odd content structure with no top level /docs section. */}}
    {{ $pages = .CurrentSection.Pages }}
  {{ else }}
    {{ $pages = .Pages }}
    {{ if eq .Section "news" }}
      {{ $pages = $pages.ByPublishDate.Reverse }}
    {{ end }}
  {{ end }}


  <article class="">
    {{ partial "layouts/docsheader.html" . }}
    <div class="mt-6 sm:mt-8 grid grid-cols-2 xl:grid-cols-3 gap-4 min-h-40">
      {{ range $pages }}
        {{ if eq . $ }}
          {{ continue }}
        {{ end }}
        <a
          class="flex col-span-1 a--block cursor-pointer flex-col group border p-3 sm:p-4 hover:shadow-md dark:shadow-slate-800 border-gray-300 dark:border-gray-800 m-0"
          href="{{ or .Params.permalink .RelPermalink }}">
          {{ if .Params.show_publish_date }}
            {{ with .PublishDate }}
              <p
                class="text-gray-500 dark:text-gray-400 text-sm/5 md:text-base/2 mb-2 sm:mb-4">
                {{ partial "layouts/date.html" . }}
              </p>
            {{ end }}
          {{ end }}
          <h3
            class="text-lg/6 md:text-2xl tracking-tight p-0 -mt-1 sm:mt-0 mb-1 sm:mb-2 text-primary group-hover:text-primary/70 overflow-hidden">
            {{ .LinkTitle }}
          </h3>

          {{ with .Params.functions_and_methods.signatures }}
            {{/* Set in functions and methods pages. */}}
            {{ with $signature := index . 0 }}
              {{ if $.Params.functions_and_methods.returnType }}
                {{ $signature = printf "%s ⟼ %s" $signature $.context.Params.functions_and_methods.returnType }}
              {{ end }}
              <div
                class="font-mono font-light text-sm whitespace-nowrap mb-2 sm:mb-4 p-2 bg-slate-50 dark:bg-slate-700 border-0 mr-8 overflow-x-auto">
                {{- $signature -}}
              </div>
            {{ end }}
          {{ end }}
          <p
            class="text-black dark:text-gray-100 leading-6 text-sm md:text-base three-lines-ellipsis">
            {{ if and (eq .Section "commands") .IsPage }}
              {{ $simpleCobraCommandShort := .RawContent | strings.ReplaceRE `(?s)^##\s.+?\n\n(.+?)\n\n.*` "$1" }}
              {{ printf "%s." $simpleCobraCommandShort }}
            {{ else }}
              {{ (or .Params.description .Summary) | plainify | safeHTML }}
            {{ end }}
          </p>
          {{ if and hugo.IsDevelopment site.Params.debug.display_page_metadata }}
            {{ partial "helpers/debug/list-item-metadata.html" . }}
          {{ end }}
        </a>
      {{ end }}
    </div>
  </article>
{{ end }}

{{ define "rightsidebar" }}
  {{ printf "%c" '\u00A0' }}
{{ end }}