mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 11:41:43 +00:00
no repetir los campos que son hashes #51
This commit is contained in:
parent
5f27e09eda
commit
abc4bd6921
1 changed files with 3 additions and 1 deletions
|
@ -13,6 +13,8 @@
|
|||
- else
|
||||
-# Obtenemos todos los valores. Puede ser un Hash o un Array
|
||||
- groups = @post.get_front_matter(template.key)
|
||||
- if groups.is_a? Hash
|
||||
- groups = [ groups ]
|
||||
- groups.each_with_index do |group, i|
|
||||
-# A partir del segundo grupo todos son extra
|
||||
- classes = (i > 0) ? [template.key, 'extra'] : [template.key]
|
||||
|
@ -41,7 +43,7 @@
|
|||
-# Si el campo es un array, groups es un array de hashes
|
||||
-# y group un hash. De lo contrarios, groups va a ser un
|
||||
-# Hash
|
||||
- value = template.array? ? group[nf.key] : groups[nf.key]
|
||||
- value = (template.array? || template.nested?) ? group[nf.key] : groups[nf.key]
|
||||
= render 'posts/template_field/nested',
|
||||
template: nf,
|
||||
value: value,
|
||||
|
|
Loading…
Reference in a new issue