File: single.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 (80 lines) | stat: -rw-r--r-- 2,763 bytes parent folder | download | duplicates (2)
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
{{ define "main" }}
  {{ $ttop := debug.Timer "single" }}
  <article class="max-w-5xl lg:max-w-3xl" id="article">
    {{ partial "layouts/docsheader.html" . }}
    <div class="content">
      {{ with .Params.description }}
        <div class="lead">
          {{ . | markdownify }}
        </div>
      {{ end }}
      {{ 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 }}
      {{ $t := debug.Timer "single.categories" }}
      {{ $categories := .GetTerms "categories" }}
      {{ with $categories }}
        <div class="mb-4 sm:mb-6 flex flex-wrap gap-2">
          {{ range . }}
            {{ $text := .LinkTitle }}
            {{ $class := "" }}
            {{ range (slice true false ) }}
              {{ $color := partial "helpers/funcs/color-from-string.html" (dict "text" $text "dark" . "--single" "green" ) }}

              {{ $prefix := "" }}
              {{ if . }}
                {{ $prefix = "dark:" }}
              {{ end }}
              {{ $class = printf "%sbg-%s-%d %stext-%s-%d border %sborder-%s-%d"
                $prefix $color.color $color.shade1
                $prefix $color.color $color.shade2
                $prefix $color.color $color.shade3
              }}
            {{ end }}


            <a
              href="{{ .RelPermalink }}"
              class="{{ $class }} text-xs h-auto tracking-widest uppercase font-light not-prose no-underline inline-block py-1 px-3 rounded-xl shadow-xs hover:opacity-80 hover:shadow-none">
              {{ .LinkTitle }}
            </a>
          {{ end }}
        </div>
      {{ end }}
      {{ $t.Stop }}

      {{ if .Params.functions_and_methods.signatures }}
        <div class="mb-4 not-prose">
          {{- partial "docs/functions-signatures.html" . -}}
          {{- partial "docs/functions-return-type.html" . -}}
          {{- partial "docs/functions-aliases.html" . -}}
        </div>
      {{ end }}
      {{ $t := debug.Timer "single.content" }}
      {{ .Content }}
      {{ $t.Stop }}
      {{ $t := debug.Timer "single.page-edit" }}
      {{ partial "layouts/page-edit.html" . }}
      {{ $t.Stop }}
    </div>
  </article>
  {{ $ttop.Stop }}
{{ end }}

{{ define "rightsidebar_content" }}
  {{/* in-this-section.html depends on these being reneredc first. */}}
  {{ $related := partial "layouts/related.html" . }}
  {{ $toc := partial "layouts/toc.html" . }}
  {{ if not .Params.hide_in_this_section }}
    {{ partial "layouts/in-this-section.html" . }}
  {{ end }}
  {{ $related }}
  {{ if $.Store.Get "hasToc" }}
    {{ $toc }}
  {{ end }}
{{ end }}