# Attachments

Attachments

- NoTreasure.txt (26 B)

Arrr

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings and stuff.

Th' Attachments shorrrtcode displays a list o' files attached t' a plank.

Attachments

- adivorciarsetoca00cape.pdf (361 KB)
- BachGavotteShort.mp3 (357 KB)
- Carroll_AliceAuPaysDesMerveilles.pdf (175 KB)
- hugo.png (17 KB)
- hugo.txt (20 B)
- movieselectricsheep-flock-244-32500-2.mp4 (340 KB)

## Usage

Th' shortcurt lists files found 'n a specific folder. Currently, it support two implementat'ns fer planks

1. If yer plank be a Marrrkdown file, attachements must be placed 'n a folder named like yer plank an' end'n wit' .files.

   > - rrrambl'n
   >   - _index.md
   >   - plank.files
   >     - attachment.pdf
   >   - plank.md

2. If yer plank be a folder, attachements must be placed 'n a nested ‘files’ folder.

   > - rrrambl'n
   >   - _index.md
   >   - plank
   >     - index.md
   >     - files
   >       - attachment.pdf

Be aware that if ye use a multilingual website, ye will need t' have as many folders as languages.

That’s all!

### Parameters

Parameter | Default | Descript'n
--- | --- | ---
title | “Attachments” | List’s title
sort | “asc” | Sort'n th' output 'n `asc`end'n or `desc`end'n order
style | "" | Choose between `orange`, `grey`, `blue` an' `green` fer nice style
pattern | “.*” | A regular expressions, used t' filter th' attachments by file name. Th' pattern parameter value must be regular expressions.

For example:

- T' match a file suffix o' ‘jpg’, use *.jpg (not *.jpg).
- T' match file names end'n 'n ‘jpg’ or ‘png’, use .*(jpg|png)

### Examples

#### List o' attachments end'n 'n pdf or mp4

    {{%attachments title="Related files" pattern=".*(pdf|mp4)"/%}}

renders as

Related files

- adivorciarsetoca00cape.pdf (361 KB)
- Carroll_AliceAuPaysDesMerveilles.pdf (175 KB)
- movieselectricsheep-flock-244-32500-2.mp4 (340 KB)

#### Colored styled box

    {{%attachments style="orange" /%}}

renders as

Attachments

- adivorciarsetoca00cape.pdf (361 KB)
- BachGavotteShort.mp3 (357 KB)
- Carroll_AliceAuPaysDesMerveilles.pdf (175 KB)
- hugo.png (17 KB)
- hugo.txt (20 B)
- movieselectricsheep-flock-244-32500-2.mp4 (340 KB)

    {{%attachments style="grey" /%}}

renders as

Attachments

- adivorciarsetoca00cape.pdf (361 KB)
- BachGavotteShort.mp3 (357 KB)
- Carroll_AliceAuPaysDesMerveilles.pdf (175 KB)
- hugo.png (17 KB)
- hugo.txt (20 B)
- movieselectricsheep-flock-244-32500-2.mp4 (340 KB)

    {{%attachments style="blue" /%}}

renders as

Attachments

- adivorciarsetoca00cape.pdf (361 KB)
- BachGavotteShort.mp3 (357 KB)
- Carroll_AliceAuPaysDesMerveilles.pdf (175 KB)
- hugo.png (17 KB)
- hugo.txt (20 B)
- movieselectricsheep-flock-244-32500-2.mp4 (340 KB)

    {{%attachments style="green" /%}}

renders as

Attachments

- adivorciarsetoca00cape.pdf (361 KB)
- BachGavotteShort.mp3 (357 KB)
- Carroll_AliceAuPaysDesMerveilles.pdf (175 KB)
- hugo.png (17 KB)
- hugo.txt (20 B)
- movieselectricsheep-flock-244-32500-2.mp4 (340 KB)