subtitulo para las secciones

This commit is contained in:
f 2019-04-22 16:42:03 -03:00
parent e894af7c83
commit 5f357673fb
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 6 additions and 0 deletions

View file

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

View file

@ -119,6 +119,8 @@
- next unless type = template.type
- if template.title.present?
%h1{id: template.title.tr(' ', '_').titleize}= template.title
- if template.subtitle.present?
%p= template.subtitle
- value = @post.new? ? template.values : @post.get_front_matter(template.key)
.form-group
= label_tag "post_#{template}", id: template do