From cdae1081764fc1b8407598a26b0aff862eb4d438 Mon Sep 17 00:00:00 2001 From: groundh0g Date: Sat, 28 Feb 2015 07:03:06 -0600 Subject: [PATCH] Added new JB/file_exists helper. Useful for things like using a larger image if available and conditionally including files. (e.g. "avatar_64x64.png" vs "avatar_256x256.png") --- _includes/JB/file_exists | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 _includes/JB/file_exists diff --git a/_includes/JB/file_exists b/_includes/JB/file_exists new file mode 100644 index 0000000000..f40080f1e7 --- /dev/null +++ b/_includes/JB/file_exists @@ -0,0 +1,26 @@ +{% comment %}{% endcomment %} + +{% assign file_exists_result = false %} + +{% if include.file %} + {% for static_file in site.static_files %} + {% if static_file.path == include.file %} + {% assign file_exists_result = true %} + {% break %} + {% endif %} + {% endfor %} +{% endif %}