From 9630c38cb8bc44844cf55a2211401003113c104f Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 12 Feb 2025 13:56:58 -0800 Subject: [PATCH] theme: Display short command on commands list --- layouts/_default/list.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 0035716ef..76513788f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -49,7 +49,12 @@ {{ end }}

- {{ (or .Params.description .Summary) | plainify | safeHTML }} + {{ 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 }}

{{ end }}