Skip to content

Commit

Permalink
#543, Add summary param for section shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-shpak committed Aug 8, 2023
1 parent e7155b4 commit 3f1bccc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exampleSite/content.en/docs/shortcodes/section/_index.md
Expand Up @@ -4,12 +4,12 @@ bookCollapseSection: true

# 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

```tpl
{{</* section */>}}
{{</* section [summary] */>}}
```

{{<section>}}
{{<section summary >}}
2 changes: 2 additions & 0 deletions layouts/shortcodes/section.html
Expand Up @@ -3,8 +3,10 @@
<dt>
<a href="{{ .RelPermalink }}">{{ partial "docs/title" . }}</a>
</dt>
{{ if (in $.Params "summary") -}}
<dd class="markdown-inner">
{{ default .Summary .Description }}
</dd>
{{ end -}}
{{ end }}
</dl>

0 comments on commit 3f1bccc

Please sign in to comment.