Skip to content
Jekyll Plugin to check: if a file exists + else
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
if_file_exists.rb

README.md

Jekyll If File Exists

Installation

Copy file_exists.rb into the /_plugins/ directory of your Jekyll project.

Usage

The plugin adds a new custom liquid tag, which can be used as follows:

{% iffileexists dir/{{ page.var }}/page.html %}
  {% include dir/{{ page.var }}/page.html %}
{% else %}
  {% include dir/default_page.html %}
{% endiffileexists %}
You can’t perform that action at this time.