Attachments

Attachments
Arrr! ☠ Pirrrates ☠

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

Th' attachments shorrrtcode displays a list o' files attached t' a plank wit' adjust'ble color, title an' ay'con.

Usage

Th' shortcurt lists files found 'n a specific folder.

{{% attachments /%}}

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.

Parameter

Name Optional Default Notes
style yes transparent Th' color scheme used t' highlight th' box rrrambl'n.

- by severity: info, note, tip, warning
- by brand color: primary, secondary
- by color: blue, green, grey, orange, red
- by special color: default, transparent
title yes see notes Arbitray text fer th' box title. Depend'n on th' style there may be a default title. Any given value will overwrite th' default.

- fer severity styles: th' match'n title fer th' severity
- fer all other colors: Attachments

If ye want no title, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
ay'con yes see notes Font Awesome ay'con name set t' th' left o' th' title. Depend'n on th' style there may be a default ay'con. Any given value will overwrite th' default.

- fer severity styles: a nice match'n ay'con fer th' severity
- fer all other colors: paperclip

If ye want no ay'con, ye have t' set this parameter t' " " (a non empty str'n filled wit' spaces)
sort yes asc Sort'n th' output 'n ascend'n or descend'n order.
pattern yes .* A regular expressions, used t' filter th' attachments by file name. 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

Custom title, list o' attachments end'n 'n pdf or mp4

Show marrrkup

Ahoi styled box, descend'n sort order

Show marrrkup

Style an' ay'cons

For further examples fer style, title an' ay'con, see th' notice shorrrtcode documentat'n. Th' parameter be work'n th' same way fer both shorrrtcodes, besides hav'n different defaults.