photo.html 944 B

123456789101112131415161718192021
  1. <!-- Photo -->
  2. {% if include.id %}
  3. {% assign id = include.id | default: 1 %}
  4. {% if include.horizontal %}
  5. {% assign photos = site.data.photos | where: 'horizontal', true %}
  6. {% else %}
  7. {% assign photos = site.data.photos %}
  8. {% endif %}
  9. {% assign photo = photos[id] %}
  10. {% if include.background %}
  11. <div{% if include.class %} class="{{ include.class }}"{% endif %} style="background-image: url({{ site.base }}/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({{ site.base }}/static/photos/{{ photo.file }})"></div>
  14. {% else %}
  15. <img src="{{ site.base }}/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 %}