2019-09-04 16:50:27 +00:00
|
|
|
= render 'layouts/breadcrumb',
|
2019-09-12 16:57:25 +00:00
|
|
|
crumbs: [link_to(t('sites.index.title'), sites_path),
|
2019-09-04 16:50:27 +00:00
|
|
|
@site.name,
|
|
|
|
link_to(t('posts.index'), site_posts_path(@site)),
|
|
|
|
@post.title.value]
|
2018-02-05 17:27:12 +00:00
|
|
|
|
2018-01-30 15:20:19 +00:00
|
|
|
.row
|
2018-02-03 22:37:09 +00:00
|
|
|
.col
|
2019-08-14 21:19:01 +00:00
|
|
|
%article.content
|
|
|
|
= link_to t('posts.edit'),
|
|
|
|
edit_site_post_path(@site, @post.id),
|
2019-09-12 16:55:20 +00:00
|
|
|
class: 'btn btn-block'
|
2018-01-30 15:20:19 +00:00
|
|
|
|
2019-09-12 17:09:43 +00:00
|
|
|
%table.table.table-condensed.table-responsive
|
2019-08-14 21:19:01 +00:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th.text-center{ colspan: 2 }= t('.front_matter')
|
|
|
|
%tbody
|
|
|
|
-#
|
|
|
|
TODO: Cambiar por un método que nos deje interactuar
|
|
|
|
directamente con los metadatos
|
2019-08-23 18:29:07 +00:00
|
|
|
- @post.attributes.each do |attr|
|
|
|
|
- metadata = @post.send(attr)
|
|
|
|
- next unless metadata.front_matter?
|
2018-01-31 20:29:27 +00:00
|
|
|
|
2019-08-23 18:29:07 +00:00
|
|
|
= render("posts/attribute_ro/#{metadata.type}",
|
|
|
|
post: @post, attribute: attr,
|
|
|
|
metadata: metadata,
|
2020-01-28 21:05:59 +00:00
|
|
|
site: @site,
|
2019-08-23 18:29:07 +00:00
|
|
|
tags: all_html_tags)
|
2018-01-30 15:20:19 +00:00
|
|
|
|
2019-08-14 21:19:01 +00:00
|
|
|
-# Mostrar todo lo que no va en el front_matter (el contenido)
|
|
|
|
- @post.attributes.each do |attr|
|
|
|
|
- next if @post.send(attr).front_matter?
|
|
|
|
|
|
|
|
%section{ id: attr }
|
2019-11-22 16:41:59 +00:00
|
|
|
= raw @post.send(attr).value
|