sutty/app/views/posts/template_field/_image.haml

13 lines
461 B
Text

- if @post.url? name
.row
- [@post.get_front_matter(name)].flatten.each do |url|
.col
%img.img-fluid{src: @site.get_url_for_sutty(url)}
- name = [name,''] if template.multiple?
= file_field_tag field_name_for_post_as_string(name),
class: 'form-control',
required: template.required? && value.blank?,
multiple: template.multiple?,
accept: 'image/*'
- if template.multiple?
%small.text-muted.form-text= raw t('posts.image.multiple')