mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 04:26:22 +00:00
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
|
||||
end
|
||||
|
||||
def title
|
||||
contents.dig('title') if complex?
|
||||
end
|
||||
|
||||
# Obtiene el valor
|
||||
def value
|
||||
complex? ? contents.dig('value') : contents
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue