layout | title | permalink | gallery-key |
---|---|---|---|
gallery |
A Gallery! |
/a-gallery/ |
my-holiday-photos |
Created
January 13, 2018 12:04
-
-
Save joshdavenport/cfb2df657f0357fa8d44a0fbc92431be to your computer and use it in GitHub Desktop.
Basic reusable jekyll gallery utilising variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
--- | |
# placed in /_layouts/ | |
{% capture gallery_path %}assets/gallery/{{ page.gallery-key }}{% endcapture %} | |
{% for image in site.static_files %} | |
{% if image.path contains gallery_path %} | |
<img src="{{ site.baseurl }}{{ image.path }}" alt="image" /> | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you 😊 @joshdavenport