<liitemscopeitemtype="https://schema.org/ListItem"itemprop="itemListElement"class="a11y-only"><aitemprop="item"href="/hugo-theme-relearn/pir/index.html"><spanitemprop="name">Cap'n Hugo Relearrrn Theme</span></a><metaitemprop="position"content="1"> > </li>
<p>This shortcode be deprecated 'n favor o' th' new <ahref="/hugo-theme-relearn/pir/shortcodes/resources/index.html"><code>resources</code> shortcode</a>. See <ahref="/hugo-theme-relearn/pir/shortcodes/attachments/index.html#migration">migrat'n instruct'ns</a> below.</p>
<p>Th' examples on this plank were removed.</p>
</div>
</details>
<p>Th' <code>attachments</code> shortcode displays a list o' files attached t' a plank wit' adjustable color, title an' ay'con.</p>
<h2id="migration">Migrat'n</h2>
<p>While this shortcode will still be avail'ble fer some time, it does not receive support anymore. Start t' migrate early, as it will be removed wit' th' next major update o' th' theme.</p>
<p>Th' <ahref="/hugo-theme-relearn/pir/shortcodes/resources/index.html"><code>resources</code> shortcode</a> leverages Hugo’s resource feature fer plank bundles. It has all th' same parameter as th' <code>attachments</code> shortcode but applies th' <code>pattern</code> directly on a resources <code>Name</code> attribute.</p>
<p>T' migrate yer planks apply th' follow'n steps:</p>
<ol>
<li>If a plank be not already a <ahref="https://gohugo.io/content-management/page-bundles/"rel="external"target="_self">plank bundle</a> convert it</li>
<li>Move yer files t' a valid destinat'n inside o' yer plank bundle (depend'n if ye have a branch or a leaf bundle)</li>
<td>Th' style scheme used fer th' box.<br><br>- by severity: <code>caut'n</code>, <code>important</code>, <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>cyan</code>, <code>green</code>, <code>grey</code>, <code>magenta</code>, <code>orange</code>, <code>red</code><br>- by special color: <code>default</code>, <code>transparent</code>, <code>code</code><br><br>Ye can also <ahref="/hugo-theme-relearn/pir/shortcodes/notice/index.html#defining-own-styles">define yer own styles</a>.</td>
</tr>
<tr>
<td><strong>color</strong></td>
<td>see notes</td>
<td>Th' <ahref="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value"rel="external"target="_self">CSS color value</a> t' be used. If not set, th' chosen color depends on th' <strong>style</strong>. Any given value will overwrite th' default.<br><br>- fer severity styles: a nice match'n color fer th' severity<br>- fer all other styles: th' correspond'n color</td>
</tr>
<tr>
<td><strong>title</strong></td>
<td>see notes</td>
<td>Arbitrary text fer th' box title. Depend'n on th' <strong>style</strong> there may be a default title. Any given value will overwrite th' default.<br><br>- fer severity styles: th' match'n title fer th' severity<br>- fer all other styles: <code>Attachments</code><br><br>If ye want no title fer a severity style, ye have t' set this parameter t' <code>""</code> (a non empty str'n filled wit' spaces)</td>
</tr>
<tr>
<td><strong>ay'con</strong></td>
<td>see notes</td>
<td><ahref="/hugo-theme-relearn/pir/shortcodes/icon/index.html#finding-an-icon">Font Awesome ay'con name</a> set t' th' left o' th' title. Depend'n on th' <strong>style</strong> there may be a default ay'con. Any given value will overwrite th' default.<br><br>- fer severity styles: a nice match'n ay'con fer th' severity<br>- fer all other styles: <code>paperclip</code><br><br>If ye want no ay'con, ye have t' set this parameter t' <code>""</code> (a non empty d wit' spaces)</td>
</tr>
<tr>
<td><strong>sort</strong></td>
<td><code>asc</code></td>
<td>Sort'n th' output 'n <code>asc</code>end'n or <code>desc</code>end'n order.</td>
</tr>
<tr>
<td><strong>pattern</strong></td>
<td><code>.*</code></td>
<td>A <ahref="https://en.wikipedia.org/wiki/Regular_expression"rel="external"target="_self">regular expressions</a>, used t' filter th' attachments by file name. For example:<br><br>- t' match a file suffix o' ‘jpg’, use <code>.*\.jpg</code> (not <code>*.\.jpg</code>)<br>- t' match file names end'n 'n <code>jpg</code> or <code>png</code>, use <code>.*\.(jpg|png)</code></td>
</tr>
</tbody>
</table>
<h2id="setup">Setup</h2>
<h3id="single-language">Single language</h3>
<p>Th' shortcode lists files found 'n a specific directory. Th' name o' th' directory depends on yer plank type (either branch bundle, leaf bundle or page).</p>
<ol>
<li>
<p>If yer plank be a leaf bundle, attachments must be placed 'n a nested <code>index.files</code> directory, accordingly.</p>
<blockquote>
<ul>
<li>rrrambl'n
<ul>
<li>_index.md</li>
<li>plank
<ul>
<li>index.md</li>
<li><strong>index.files</strong>
<ul>
<li>attachment.pdf</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul></blockquote>
</li>
<li>
<p>If yer plank be a branch bundle, attachments must be placed 'n a nested <code>_index.files</code> directory, accordingly.</p>
<p><spanclass="badge cstyle warning badge-with-title"><spanclass="badge-title"><iclass="fa-fw fas fa-exclamation-triangle"></i></span><spanclass="badge-content">Arrr</span></span> This be only avail'ble fer Cap'n Hugo <<code>0.112.0</code></p>
<blockquote>
<ul>
<li>rrrambl'n
<ul>
<li>_index.md</li>
<li>plank
<ul>
<li>_index.md</li>
<li><strong>_index.files</strong>
<ul>
<li>attachment.pdf</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul></blockquote>
</li>
<li>
<p>For simple planks, attachments must be placed 'n a directory named like yer plank an' end'n wit' <code>.files</code>.</p>
<p><spanclass="badge cstyle warning badge-with-title"><spanclass="badge-title"><iclass="fa-fw fas fa-exclamation-triangle"></i></span><spanclass="badge-content">Arrr</span></span> This be only avail'ble fer Cap'n Hugo <<code>0.112.0</code></p>
<blockquote>
<ul>
<li>rrrambl'n
<ul>
<li>_index.md</li>
<li><strong>plank.files</strong>
<ul>
<li>attachment.pdf</li>
</ul>
</li>
<li>plank.md</li>
</ul>
</li>
</ul></blockquote>
</li>
</ol>
<h3id="multilingual">Multilingual</h3>
<p>Be aware that if ye use a multilingual website, ye will need t' have as many directories as languages an' th' language code must be part o' th' directory name.</p>