| 1 |
{{ define "main" }} |
| 2 |
{{ $ttop := debug.Timer "single" }} |
| 3 |
<article class="max-w-5xl lg:max-w-3xl" id="article"> |
| 4 |
{{ partial "layouts/docsheader.html" . }} |
| 5 |
<div class="content"> |
| 6 |
{{ with .Params.description }} |
| 7 |
<div class="lead"> |
| 8 |
{{ . | markdownify }} |
| 9 |
</div> |
| 10 |
{{ end }} |
| 11 |
{{ if .Params.show_publish_date }} |
| 12 |
{{ with .PublishDate }} |
| 13 |
<p |
| 14 |
class="text-gray-500 dark:text-gray-400 text-sm/5 md:text-base/2 mb-2 sm:mb-4"> |
| 15 |
{{ partial "layouts/date.html" . }} |
| 16 |
</p> |
| 17 |
{{ end }} |
| 18 |
{{ end }} |
| 19 |
{{ $t := debug.Timer "single.categories" }} |
| 20 |
{{ $categories := .GetTerms "categories" }} |
| 21 |
{{ with $categories }} |
| 22 |
<div class="mb-4 sm:mb-6 flex flex-wrap gap-2"> |
| 23 |
{{ range . }} |
| 24 |
{{ $text := .LinkTitle }} |
| 25 |
{{ $class := "" }} |
| 26 |
{{ range (slice true false) }} |
| 27 |
{{ $color := partial "helpers/funcs/color-from-string.html" (dict "text" $text "dark" . "--single" "green") }} |
| 28 |
|
| 29 |
{{ $prefix := "" }} |
| 30 |
{{ if . }} |
| 31 |
{{ $prefix = "dark:" }} |
| 32 |
{{ end }} |
| 33 |
{{ $class = printf "%sbg-%s-%d %stext-%s-%d border %sborder-%s-%d" |
| 34 |
$prefix $color.color $color.shade1 |
| 35 |
$prefix $color.color $color.shade2 |
| 36 |
$prefix $color.color $color.shade3 |
| 37 |
}} |
| 38 |
{{ end }} |
| 39 |
|
| 40 |
|
| 41 |
<a |
| 42 |
href="{{ .RelPermalink }}" |
| 43 |
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"> |
| 44 |
{{ .LinkTitle }} |
| 45 |
</a> |
| 46 |
{{ end }} |
| 47 |
</div> |
| 48 |
{{ end }} |
| 49 |
{{ $t.Stop }} |
| 50 |
|
| 51 |
{{ if .Params.functions_and_methods.signatures }} |
| 52 |
<div class="mb-4 not-prose"> |
| 53 |
{{- partial "layouts/functions-and-methods-metadata.html" . -}} |
| 54 |
</div> |
| 55 |
{{ end }} |
| 56 |
{{ $t := debug.Timer "single.content" }} |
| 57 |
{{ .Content }} |
| 58 |
{{ $t.Stop }} |
| 59 |
{{ $t := debug.Timer "single.page-edit" }} |
| 60 |
{{ partial "layouts/page-edit.html" . }} |
| 61 |
{{ $t.Stop }} |
| 62 |
</div> |
| 63 |
</article> |
| 64 |
{{ $ttop.Stop }} |
| 65 |
{{ end }} |
| 66 |
|
| 67 |
{{ define "rightsidebar_content" }} |
| 68 |
{{/* in-this-section.html depends on these being reneredc first. */}} |
| 69 |
{{ $related := partial "layouts/related.html" . }} |
| 70 |
{{ $toc := partial "layouts/toc.html" . }} |
| 71 |
{{ if not .Params.hide_in_this_section }} |
| 72 |
{{ partial "layouts/in-this-section.html" . }} |
| 73 |
{{ end }} |
| 74 |
{{ $related }} |
| 75 |
{{ if $.Store.Get "hasToc" }} |
| 76 |
{{ $toc }} |
| 77 |
{{ end }} |
| 78 |
{{ end }} |