Redirecting…

Files

All Files

Returns a hash of files attached to the page.

Usage

{{ page.files }}

Example

{% for file in page.files %}
  {% if file.extension == 'mp3' %}
    <a href="{{ file.src }}" class="jquery-mp3-player">{{ file.title }}</a>
  {% endif %}
{% endfor %}

The attributes available for an individual file are

  • file.title, the title the file was given when uploaded;
  • file.filename, the actual name of the file;
  • file.extension, the file type;
  • file.src, the URL to the file.