mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 21:53:37 +00:00
mas efectos secundario de get_front_matter
This commit is contained in:
parent
f465ce3588
commit
97b2f7c87d
2 changed files with 2 additions and 2 deletions
|
@ -278,7 +278,7 @@ class Post
|
||||||
|
|
||||||
# Obtiene metadatos de forma recursiva
|
# Obtiene metadatos de forma recursiva
|
||||||
def get_front_matter(name)
|
def get_front_matter(name)
|
||||||
name = name.to_s if name.is_a? Symbol
|
name = name.to_s unless name.is_a? Array
|
||||||
@front_matter.dig(*name)
|
@front_matter.dig(*name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
-# Genera todos los campos de la plantilla
|
-# Genera todos los campos de la plantilla
|
||||||
- @post.template_fields.each do |template|
|
- @post.template_fields.each do |template|
|
||||||
- next unless type = template.type
|
- next unless type = template.type
|
||||||
- value = @post.new? ? template.values : @post.get_front_matter(template)
|
- value = @post.new? ? template.values : @post.get_front_matter(template.key)
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag "post_#{template}", id: template do
|
= label_tag "post_#{template}", id: template do
|
||||||
= link_to '#' + template.key, class: 'text-muted',
|
= link_to '#' + template.key, class: 'text-muted',
|
||||||
|
|
Loading…
Reference in a new issue