Navigation:
attachments
The Attachments shortcode displays a list of files attached to a page.
Example :
role="alert">
<li>
<a href="https://workshops.nuevofoundation.org/guidelines/shortcodes/attachments.files/BachGavotteShort.mp3" >
BachGavotteShort.mp3
</a>
(357 kB)
</li>
<li>
<a href="https://workshops.nuevofoundation.org/guidelines/shortcodes/attachments.files/Carroll_AliceAuPaysDesMerveilles.pdf" >
Carroll_AliceAuPaysDesMerveilles.pdf
</a>
(175 kB)
</li>
<li>
<a href="https://workshops.nuevofoundation.org/guidelines/shortcodes/attachments.files/adivorciarsetoca00cape.pdf" >
adivorciarsetoca00cape.pdf
</a>
(361 kB)
</li>
<li>
<a href="https://workshops.nuevofoundation.org/guidelines/shortcodes/attachments.files/hugo.png" >
hugo.png
</a>
(17 kB)
</li>
<li>
<a href="https://workshops.nuevofoundation.org/guidelines/shortcodes/attachments.files/movieselectricsheep-flock-244-32500-2.mp4" >
movieselectricsheep-flock-244-32500-2.mp4
</a>
(340 kB)
</li>
Usage
The shortcurt lists files found in a specific folder.
Currently, it support two implementations for pages
If your page is a markdown file, attachements must be place in a folder named like your page and ending with .files.
- content
- _index.md
- page.files
- page.md
If your page is a folder, attachements must be place in a nested ‘files’ folder.
That’s all !
role="alert">Tip : Look at this documentation source code on github
parameters
Parameter | Default | Description |
---|
title | “Attachments” | List’s title |
pattern | “.*” | A regular expressions, used to filter the attachments by file name.
<div class="alert |
alert-warning” | | |
role="alert">The pattern parameter value must be regular expressions.
For example:
- To match a file suffix of ‘jpg’, use *.jpg (not *.jpg).
- To match file names ending in ‘jpg’ or ‘png’, use .*(jpg|png)