mostrar el título de la sección
This commit is contained in:
parent
667e3d252c
commit
cdfb66791e
2 changed files with 6 additions and 0 deletions
|
@ -16,6 +16,10 @@ class Post
|
||||||
@contents = contents
|
@contents = contents
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def title
|
||||||
|
contents.dig('title') if complex?
|
||||||
|
end
|
||||||
|
|
||||||
# Obtiene el valor
|
# Obtiene el valor
|
||||||
def value
|
def value
|
||||||
complex? ? contents.dig('value') : contents
|
complex? ? contents.dig('value') : contents
|
||||||
|
|
|
@ -93,6 +93,8 @@
|
||||||
-# 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
|
||||||
|
- if template.title.present?
|
||||||
|
%h1= template.title
|
||||||
- value = @post.new? ? template.values : @post.get_front_matter(template.key)
|
- 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
|
||||||
|
|
Loading…
Reference in a new issue