From 3f1bcccbfb247da44ab5410a97576c0bf6da103b Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Tue, 8 Aug 2023 13:38:33 +0200 Subject: [PATCH] #543, Add summary param for section shortcode --- exampleSite/content.en/docs/shortcodes/section/_index.md | 6 +++--- layouts/shortcodes/section.html | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/exampleSite/content.en/docs/shortcodes/section/_index.md b/exampleSite/content.en/docs/shortcodes/section/_index.md index bd5db38b..f3b9ec31 100644 --- a/exampleSite/content.en/docs/shortcodes/section/_index.md +++ b/exampleSite/content.en/docs/shortcodes/section/_index.md @@ -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 -{{}} +{{}} ``` -{{
}} +{{
}} diff --git a/layouts/shortcodes/section.html b/layouts/shortcodes/section.html index a7f45d1b..35fbf9b3 100644 --- a/layouts/shortcodes/section.html +++ b/layouts/shortcodes/section.html @@ -3,8 +3,10 @@
{{ partial "docs/title" . }}
+ {{ if (in $.Params "summary") -}}
{{ default .Summary .Description }}
+ {{ end -}} {{ end }}