5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 09:56:21 +00:00

mostrar el título de la sección

This commit is contained in:
f 2018-09-05 16:18:09 -03:00
parent 667e3d252c
commit cdfb66791e
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
2 changed files with 6 additions and 0 deletions

View file

@ -16,6 +16,10 @@ class Post
@contents = contents
end
def title
contents.dig('title') if complex?
end
# Obtiene el valor
def value
complex? ? contents.dig('value') : contents

View file

@ -93,6 +93,8 @@
-# Genera todos los campos de la plantilla
- @post.template_fields.each do |template|
- next unless type = template.type
- if template.title.present?
%h1= template.title
- value = @post.new? ? template.values : @post.get_front_matter(template.key)
.form-group
= label_tag "post_#{template}", id: template do