2022-03-02 17:01:17 +00:00
|
|
|
- dir = @site.data.dig(params[:locale], 'dir')
|
2020-06-25 20:15:43 +00:00
|
|
|
.row.justify-content-center
|
2023-04-20 21:23:58 +00:00
|
|
|
.col-12.col-lg-8
|
2020-07-22 23:37:26 +00:00
|
|
|
%article.content.table-responsive-md
|
2024-01-17 20:37:02 +00:00
|
|
|
= link_to t('posts.edit_post'),
|
2019-08-14 21:19:01 +00:00
|
|
|
edit_site_post_path(@site, @post.id),
|
2024-01-12 17:11:29 +00:00
|
|
|
class: 'btn btn-secondary btn-block'
|
2020-11-26 16:24:03 +00:00
|
|
|
|
2020-07-22 23:37:26 +00:00
|
|
|
%table.table.table-condensed
|
2019-08-14 21:19:01 +00:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th.text-center{ colspan: 2 }= t('.front_matter')
|
|
|
|
%tbody
|
2019-08-23 18:29:07 +00:00
|
|
|
- @post.attributes.each do |attr|
|
2020-08-05 15:29:11 +00:00
|
|
|
- metadata = @post[attr]
|
2019-08-23 18:29:07 +00:00
|
|
|
- next unless metadata.front_matter?
|
2018-01-31 20:29:27 +00:00
|
|
|
|
2021-05-10 17:27:47 +00:00
|
|
|
- cache [metadata, I18n.locale] do
|
2020-11-11 20:00:09 +00:00
|
|
|
= render("posts/attribute_ro/#{metadata.type}",
|
|
|
|
post: @post, attribute: attr,
|
|
|
|
metadata: metadata,
|
|
|
|
site: @site,
|
|
|
|
locale: @locale,
|
|
|
|
dir: dir)
|
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|
|
2020-11-11 22:49:44 +00:00
|
|
|
- metadata = @post[attr]
|
2020-11-11 20:00:09 +00:00
|
|
|
- next if metadata.front_matter?
|
2019-08-14 21:19:01 +00:00
|
|
|
|
2021-05-10 17:27:47 +00:00
|
|
|
- cache [metadata, I18n.locale] do
|
2022-11-08 23:19:53 +00:00
|
|
|
%section.content.pb-3{ id: attr, dir: dir }
|
2023-02-01 20:12:27 +00:00
|
|
|
= @post.public_send(attr).to_s.html_safe
|