details: add shortcode #957
Some checks failed
docs-build-deployment / Run deploy (push) Has been cancelled
docs-build / Run build (push) Has been cancelled

This commit is contained in:
Sören Weber 2024-12-15 15:34:50 +01:00
parent 16d4de84be
commit 66f4fbf5f0
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
5 changed files with 40 additions and 2 deletions

View file

@ -0,0 +1,13 @@
+++
disableToc = false
hidden = true
title = "Version 7.3"
type = "releasenotes"
weight = -3
+++
## 7.3.0 (XXXX-XX-XX) {#7-3-0}
### New
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Support for Hugos built-in [`details` shortcode](https://gohugo.io/content-management/shortcodes/#details) by mapping it to the theme's [`expand` shortcode](shortcodes/expand).

View file

@ -62,6 +62,8 @@ That's some more text with a footnote.[^someid]
The [`notice` shortcode](shortcodes/notice) is also capable of displaying expandable/collapsible sections of text but with additional parameter for color and additional icons. The [`notice` shortcode](shortcodes/notice) is also capable of displaying expandable/collapsible sections of text but with additional parameter for color and additional icons.
The theme supports Hugos built-in [`details` shortcode](https://gohugo.io/content-management/shortcodes/#details) by mapping the parameter to the theme's `expand` shortcode.
### Parameter ### Parameter
| Name | Position | Default | Notes | | Name | Position | Default | Notes |

View file

@ -11,9 +11,9 @@
{{- partial "shortcodes/notice.html" (dict {{- partial "shortcodes/notice.html" (dict
"page" .Page "page" .Page
"content" $text "content" $text
"expanded" (cond (eq $alertsign "+") true (cond (eq $alertsign "-") false ""))
"style" $alerttype "style" $alerttype
"title" $alerttitle "title" $alerttitle
"expanded" (cond (eq $alertsign "+") true (cond (eq $alertsign "-") false ""))
) }} ) }}
{{ else -}} {{ else -}}
<blockquote> <blockquote>

View file

@ -1 +1 @@
7.2.1 7.2.1+16d4de84becfa2d2e6bdb2394a2f4fa411bc0007

View file

@ -0,0 +1,23 @@
{{- $summary := (.Get "summary") | default (T "Details") }}
{{- $open := false }}
{{- if in (slice "false" false 0) (.Get "open") }}
{{- $open = false }}
{{- else if in (slice "true" true 1) (.Get "open")}}
{{- $open = true }}
{{- end }}
{{- $params := dict }}
{{- with (.Get "class") }}
{{- $params = $params | merge (dict "class" .) }}
{{- end }}
{{- with (.Get "title") }}
{{- $params = $params | merge (dict "title" .) }}
{{- end }}
{{- partial "shortcodes/notice.html" (dict
"page" .Page
"content" .Inner
"expanded" $open
"groupid" (.Get "name")
"params" $params
"style" "transparent"
"title" $summary
) }}