mostrar todas las imagenes
This commit is contained in:
parent
e0ce6700f7
commit
9fd73d0c38
2 changed files with 8 additions and 3 deletions
|
@ -262,9 +262,11 @@ class Post
|
|||
# Detecta si un valor es un archivo
|
||||
def url?(name)
|
||||
path = get_front_matter(name)
|
||||
return false unless path.is_a? String
|
||||
return false unless path.is_a?(String) || path.is_a?(Array)
|
||||
# El primer valor es '' porque la URL empieza con /
|
||||
path.split('/').second == 'public'
|
||||
[path].flatten.map do |p|
|
||||
p.split('/').second == 'public'
|
||||
end.all?
|
||||
end
|
||||
|
||||
def image?(name)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
- if @post.url? name
|
||||
%img.img-fluid{src: @site.get_url_for_sutty(@post.get_front_matter(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',
|
||||
|
|
Loading…
Reference in a new issue