photo.html 972 B

12345678910111213141516171819202122
  1. <!-- Photo -->
  2. {% if include.id %}
  3. {% assign id = include.id | default: 1 %}
  4. {% if include.horizontal %}
  5. {% assign filtered-photos = photos | where: 'horizontal', true %}
  6. {% else %}
  7. {% assign filtered-photos = photos %}
  8. {% endif %}
  9. {% assign photo = filtered-photos[id] %}
  10. {% if include.background %}
  11. <div{% if include.class %} class="{{ include.class }}"{% endif %} style="background-image: url({{ page | relative }}/static/photos/{{ photo.file }})"></div>
  12. {% elsif include.ratio %}
  13. <div class="img-responsive img-responsive-{{ include.ratio }}{% if include.class %} {{ include.class }}{% endif %}" style="background-image: url({{ page | relative }}/static/photos/{{ photo.file }})"></div>
  14. {% else %}
  15. <img src="{{ page | relative }}/static/photos/{{ photo.file }}"{% if include.class %} class="{{ include.class }}"{% endif %} alt="{{ photo.title }}" />
  16. {% endif %}
  17. {% else %}
  18. {% include "ui/svg.html" width=640 height=480 border=true class=include.class %}
  19. {% endif %}