website/themes/hugo-theme-relearn/exampleSite/content/shortcodes/resources/index.en.md
+++ description = "List resources contained in a page bundle" title = "Resources" [[resources]] name = 'MaybeTreasure.txt' src = 'MaybeTreasure.en.txt' +++
The resources shortcode displays the titles of resources contained in a page bundle.
{{% resources sort="asc" /%}}
While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.
{{< tabs groupid="shortcode-parameter">}} {{% tab title="shortcode" %}}
{{%/* resources sort="asc" /*/%}}
{{% /tab %}} {{% tab title="partial" %}}
{{ partial "shortcodes/resources.html" (dict
"page" .
"sort" "asc"
)}}
{{% /tab %}} {{< /tabs >}}
Multilanguage features are not supported directly by the shortcode but rely on Hugo's handling for resource translations applied when the theme iterates over all available resources.
| Name | Default | Notes |
|---|---|---|
| style | transparent | The style scheme used for the box. |
by severity: info, note, tip, warning
by brand color: primary, secondary, accent
by color: blue, green, grey, orange, red
by special color: default, transparent, code |
| color | see notes | The CSS color value to be used. If not set, the chosen color depends on the style. Any given value will overwrite the default.
for severity styles: a nice matching color for the severity
for all other styles: the corresponding color | | title | see notes | Arbitrary text for the box title. Depending on the style there may be a default title. Any given value will overwrite the default.
for severity styles: the matching title for the severity
for all other styles: Resources
If you want no title for a severity style, you have to set this parameter to " " (a non empty string filled with spaces) |
| icon | see notes | Font Awesome icon name set to the left of the title. Depending on the style there may be a default icon. Any given value will overwrite the default.
paperclipIf you want no icon, you have to set this parameter to " " (a non empty d with spaces) |
| sort | asc | Sorting the output in ascending or descending order. |
| pattern | .* | A regular expressions, used to filter the resources by name. For example:
.*\.jpg (not *.\.jpg)jpg or png, use .*\.(jpg\|png) |{{%/* resources title="Related **files**" pattern=".*\.(png|jpg|gif)" /*/%}}
{{% resources title="Related files" pattern=".*.(png|jpg|gif)" /%}}
{{%/* resources style="info" sort="desc" /*/%}}
{{% resources style="info" sort="desc" /%}}
{{%/* resources color="fuchsia" icon="fa-fw fab fa-hackerrank" /*/%}}
{{% resources color="fuchsia" icon="fa-fw fab fa-hackerrank" /%}}
For further examples for style, color, title and icon, see the notice shortcode documentation. The parameter are working the same way for both shortcodes, besides having different defaults.