hugo/docs/layouts/partials/boxes-section-summaries.html
2023-08-30 19:24:34 +02:00

38 lines
1.1 KiB
HTML

<div class="relative {{ .classes }} weight-{{ .context.Weight }}">
<div class="bg-white mb2 pa3 pa4-l gray">
{{ $href := .context.RelPermalink }}
{{ if eq .context.Section "news" }}
{{ $href = .context.Permalink }}
<time class="f6 db" datetime="{{ .context.Date.Format `2006-01-02T15:04:05Z07:00` }}">
{{ .context.Date.Format "January 2, 2006" }}
</time>
{{ end }}
<h1 class="near-black f3">
<a href="{{ $href }}" class="link primary-color dim">
{{- if eq .context.Section "functions" -}}
{{ .context.LinkTitle }}
{{- else -}}
{{ .context.Title }}
{{- end -}}
</a>
</h1>
<div class="lh-copy links">
{{ if eq .context.Section "commands" }}
{{ replaceRE `(?s).*?##\s.*?\n\n(.*?)\n.*` "$1" .context.RawContent }}
{{ else }}
{{ if .context.Params.description }}
{{ .context.Params.description | markdownify }}
{{ else }}
{{ .context.Summary }}
{{ end }}
{{ end }}
<a href="{{ $href }}" class="f6 mt2 db link primary-color dim">
Read More &raquo;
</a>
</div>
</div>
</div>