<linkhref="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/resources/index.html"rel="canonical"type="text/html"title="Resources :: Hugo Relearn Theme">
<linkhref="/hugo-theme-relearn/shortcodes/resources/index.xml"rel="alternate"type="application/rss+xml"title="Resources :: Hugo Relearn Theme">
<p>The <code>resources</code> shortcode displays the <ahref="https://gohugo.io/methods/resource/title/"target="_blank">titles</a> of resources contained in a <ahref="https://gohugo.io/content-management/page-bundles/"target="_blank">page bundle</a>.</p>
<p>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.</p>
<h3id="parameter">Parameter</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Default</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>style</strong></td>
<td><code>transparent</code></td>
<td>The style scheme used for the box.<br><br>- by severity: <code>info</code>, <code>note</code>, <code>tip</code>, <code>warning</code><br>- by brand color: <code>primary</code>, <code>secondary</code>, <code>accent</code><br>- by color: <code>blue</code>, <code>green</code>, <code>grey</code>, <code>orange</code>, <code>red</code><br>- by special color: <code>default</code>, <code>transparent</code>, <code>code</code></td>
</tr>
<tr>
<td><strong>color</strong></td>
<td>see notes</td>
<td>The <ahref="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value"target="_blank">CSS color value</a> to be used. If not set, the chosen color depends on the <strong>style</strong>. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching color for the severity<br>- for all other styles: the corresponding color</td>
</tr>
<tr>
<td><strong>title</strong></td>
<td>see notes</td>
<td>Arbitrary text for the box title. Depending on the <strong>style</strong> there may be a default title. Any given value will overwrite the default.<br><br>- for severity styles: the matching title for the severity<br>- for all other styles: <code>Resources</code><br><br>If you want no title for a severity style, you have to set this parameter to <code>""</code> (a non empty string filled with spaces)</td>
</tr>
<tr>
<td><strong>icon</strong></td>
<td>see notes</td>
<td><ahref="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> set to the left of the title. Depending on the <strong>style</strong> there may be a default icon. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching icon for the severity<br>- for all other styles: <code>paperclip</code><br><br>If you want no icon, you have to set this parameter to <code>""</code> (a non empty d with spaces)</td>
</tr>
<tr>
<td><strong>sort</strong></td>
<td><code>asc</code></td>
<td>Sorting the output in <code>asc</code>ending or <code>desc</code>ending order.</td>
</tr>
<tr>
<td><strong>pattern</strong></td>
<td><code>.*</code></td>
<td>A <ahref="https://en.wikipedia.org/wiki/Regular_expression"target="_blank">regular expressions</a>, used to filter the resources <ahref="https://gohugo.io/methods/resource/name/"target="_blank">by name</a>. For example:<br><br>- to match a file suffix of ‘jpg’, use <code>.*\.jpg</code> (not <code>*.\.jpg</code>)<br>- to match file names ending in <code>jpg</code> or <code>png</code>, use <code>.*\.(jpg|png)</code></td>
</tr>
</tbody>
</table>
<h2id="examples">Examples</h2>
<h3id="custom-title-list-of-resources-ending-in-png-jpg-or-gif">Custom Title, List of Resources Ending in png, jpg or gif</h3>
<divclass="highlight wrap-code"><pretabindex="0"class="chroma"><codeclass="language-go"data-lang="go"><spanclass="line"><spanclass="cl"><spanclass="p">{{</span><spanclass="o">%</span><spanclass="nx">resources</span><spanclass="nx">color</span><spanclass="p">=</span><spanclass="s">"fuchsia"</span><spanclass="nx">icon</span><spanclass="p">=</span><spanclass="s">"fa-fw fab fa-hackerrank"</span><spanclass="o">/%</span><spanclass="p">}}</span></span></span></code></pre></div>
<h3id="style-color-title-and-icons">Style, Color, Title and Icons</h3>
<p>For further examples for <strong>style</strong>, <strong>color</strong>, <strong>title</strong> and <strong>icon</strong>, see the <ahref="/hugo-theme-relearn/shortcodes/notice/index.html"><code>notice</code> shortcode</a> documentation. The parameter are working the same way for both shortcodes, besides having different defaults.</p>