| 1 |
{{ define "main" }} |
| 2 |
{{ $pages := "" }} |
| 3 |
{{ if .IsPage }} |
| 4 |
{{/* We currently have a slightly odd content structure with no top level /docs section. */}} |
| 5 |
{{ $pages = .CurrentSection.Pages }} |
| 6 |
{{ else }} |
| 7 |
{{ $pages = .Pages }} |
| 8 |
{{ if eq .Section "news" }} |
| 9 |
{{ $pages = $pages.ByPublishDate.Reverse }} |
| 10 |
{{ end }} |
| 11 |
{{ end }} |
| 12 |
|
| 13 |
|
| 14 |
<article class=""> |
| 15 |
{{ partial "layouts/docsheader.html" . }} |
| 16 |
<div class="mt-6 sm:mt-8 grid grid-cols-2 xl:grid-cols-3 gap-4 min-h-40"> |
| 17 |
{{ range $pages }} |
| 18 |
{{ if eq . $ }} |
| 19 |
{{ continue }} |
| 20 |
{{ end }} |
| 21 |
<a |
| 22 |
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" |
| 23 |
href="{{ or .Params.permalink .RelPermalink }}"> |
| 24 |
{{ if .Params.show_publish_date }} |
| 25 |
{{ with .PublishDate }} |
| 26 |
<p |
| 27 |
class="text-gray-500 dark:text-gray-400 text-sm/5 md:text-base/2 mb-2 sm:mb-4"> |
| 28 |
{{ partial "layouts/date.html" . }} |
| 29 |
</p> |
| 30 |
{{ end }} |
| 31 |
{{ end }} |
| 32 |
<h3 |
| 33 |
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"> |
| 34 |
{{ .LinkTitle }} |
| 35 |
</h3> |
| 36 |
|
| 37 |
{{ with .Params.functions_and_methods.signatures }} |
| 38 |
{{/* Set in functions and methods pages. */}} |
| 39 |
{{ with $signature := index . 0 }} |
| 40 |
{{ if $.Params.functions_and_methods.returnType }} |
| 41 |
{{ $signature = printf "%s ⟼ %s" $signature $.context.Params.functions_and_methods.returnType }} |
| 42 |
{{ end }} |
| 43 |
<div |
| 44 |
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"> |
| 45 |
{{- $signature -}} |
| 46 |
</div> |
| 47 |
{{ end }} |
| 48 |
{{ end }} |
| 49 |
<p |
| 50 |
class="text-black dark:text-gray-100 leading-6 text-sm md:text-base three-lines-ellipsis"> |
| 51 |
{{ if and (eq .Section "commands") .IsPage }} |
| 52 |
{{ $simpleCobraCommandShort := .RawContent | strings.ReplaceRE `(?s)^##\s.+?\n\n(.+?)\n\n.*` "$1" }} |
| 53 |
{{ printf "%s." $simpleCobraCommandShort }} |
| 54 |
{{ else }} |
| 55 |
{{ (or .Params.description .Summary) | plainify | safeHTML }} |
| 56 |
{{ end }} |
| 57 |
</p> |
| 58 |
{{ if and hugo.IsDevelopment site.Params.debug.display_page_metadata }} |
| 59 |
{{ partial "helpers/debug/list-item-metadata.html" . }} |
| 60 |
{{ end }} |
| 61 |
</a> |
| 62 |
{{ end }} |
| 63 |
</div> |
| 64 |
</article> |
| 65 |
{{ end }} |
| 66 |
|
| 67 |
{{ define "rightsidebar" }} |
| 68 |
{{ printf "%c" '\u00A0' }} |
| 69 |
{{ end }} |