backy/docs/themes/hugo-theme-relearn/exampleSite/content/shortcodes/expand.en.md
Andrew Woodlee 4b382bddd9 v0.3.0
* Getting environment variables and passwords from Vault (not tested
yet)
* Vault configuration to config (not tested yet)
* Ability to run scripts from file on local machine on the remote host
* Ability to get ouput in the notification of a list for individual
commands or all commands
* Make SSH connections close after all commands have been run; reuse
previous connections if needed
2023-07-01 21:46:54 -05:00

2.8 KiB

+++ description = "Expandable/collapsible sections of text" title = "Expand" +++

The expand shortcode displays an expandable/collapsible section of text.

{{% expand title="Expand me..." %}}Thank you!

That's some text with a footnote1

That's some more text with a footnote.2

{{% notice note %}} This only works in modern browsers flawlessly. While Internet Explorer 11 has issues in displaying it, the functionality still works. {{% /notice %}}

Usage

While the examples are using shortcodes with named parameter you are free to use positional as well or also call this shortcode from your own partials.

{{< tabs groupId="shortcode-parameter">}} {{% tab title="shortcode" %}}

{{%/* expand title="Expand me..." */%}}Thank you!{{%/* /expand */%}}

{{% /tab %}} {{% tab title="shortcode (positional)" %}}

{{%/* expand "Expand me..." */%}}Thank you!{{%/* /expand */%}}

{{% /tab %}} {{% tab title="partial" %}}

{{ partial "shortcodes/expand.html" (dict
  "context" .
  "title" "Expand me..."
  "content" "Thank you!"
)}}

{{% /tab %}} {{< /tabs >}}

Parameter

Name Position Default Notes
title 1 "Expand me..." Arbitrary text to appear next to the expand/collapse icon.
open 2 false When true the content text will be initially shown as expanded.
<content> <empty> Arbitrary text to be displayed on expand.

Examples

All Defaults

{{%/* expand */%}}Yes, you did it!{{%/* /expand */%}}

{{% expand %}}Yes, you did it!{{% /expand %}}

Initially Expanded

{{%/* expand title="Expand me..." open="true" */%}}No need to press you!{{%/* /expand */%}}

{{% expand title="Expand me..." open="true" %}}No need to press you!{{% /expand %}}

Arbitrary Text

{{%/* expand title="Show me almost **endless** possibilities" */%}}
You can add standard markdown syntax:

- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- etc.

```plaintext
...and even source code
```

> the possibilities are endless (almost - including other shortcodes may or may not work)
{{%/* /expand */%}}

{{% expand title="Show me almost endless possibilities" %}} You can add standard markdown syntax:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold and even bold emphasized text
  • links
  • etc.
...and even source code

the possibilities are endless (almost - including other shortcodes may or may not work) {{% /expand %}}


  1. And that's the footnote. ↩︎

  2. Anything of interest goes here.

    Blue light glows blue. {{% /expand %}} ↩︎