Jekyll: Get number of files in front matter specified sub-directories? -


imagine directory specified in pages' front matter:

--- ... assets: "/assets/<project-name>" ... --- 

how can 1 determine number of files in assets' sub-directories? example:

{% assign img_dir = page.assets | append: "img/" %}  {% if <files-in-img_dir>.length > 1 %}     // render multiple images {% else %}     // render single images {% end if %} 

as of right i'm using below, able optimize (imports, build, etc.) based on number of assets render.

{% asset in site.static_files %}     {% if asset.path contains img_dir %}          // render     {% endif %} {% endfor %} 

thanks.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -