#543, Add summary param for section shortcode

This commit is contained in:
Alex Shpak 2023-08-08 13:38:33 +02:00
parent e7155b473a
commit 3f1bcccbfb
2 changed files with 5 additions and 3 deletions

View file

@ -4,12 +4,12 @@ bookCollapseSection: true
# Section # Section
Section renders pages in section as definition list, using title and description. Section renders pages in section as definition list, using title and description. Optional param `summary` can be used to show or hide page summary
## Example ## Example
```tpl ```tpl
{{</* section */>}} {{</* section [summary] */>}}
``` ```
{{<section>}} {{<section summary >}}

View file

@ -3,8 +3,10 @@
<dt> <dt>
<a href="{{ .RelPermalink }}">{{ partial "docs/title" . }}</a> <a href="{{ .RelPermalink }}">{{ partial "docs/title" . }}</a>
</dt> </dt>
{{ if (in $.Params "summary") -}}
<dd class="markdown-inner"> <dd class="markdown-inner">
{{ default .Summary .Description }} {{ default .Summary .Description }}
</dd> </dd>
{{ end -}}
{{ end }} {{ end }}
</dl> </dl>