mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 09:16:22 +00:00
47 lines
1.5 KiB
Text
47 lines
1.5 KiB
Text
= render 'layouts/breadcrumb',
|
|
crumbs: [link_to(t('sites.index.title'), sites_path),
|
|
@site.name,
|
|
link_to(t('posts.index'), site_posts_path(@site)),
|
|
@post.title.value]
|
|
|
|
- dir = t("locales.#{@locale}.dir")
|
|
.row.justify-content-center
|
|
.col-md-8
|
|
%article.content.table-responsive-md
|
|
= link_to t('posts.edit'),
|
|
edit_site_post_path(@site, @post.id),
|
|
class: 'btn btn-block'
|
|
|
|
- unless @post.layout.ignored?
|
|
= link_to t('posts.preview.btn'),
|
|
site_post_preview_path(@site, @post.id),
|
|
class: 'btn btn-block',
|
|
target: '_blank',
|
|
rel: 'noopener'
|
|
|
|
%table.table.table-condensed
|
|
%thead
|
|
%tr
|
|
%th.text-center{ colspan: 2 }= t('.front_matter')
|
|
%tbody
|
|
- @post.attributes.each do |attr|
|
|
- metadata = @post[attr]
|
|
- next unless metadata.front_matter?
|
|
|
|
- cache metadata do
|
|
= render("posts/attribute_ro/#{metadata.type}",
|
|
post: @post, attribute: attr,
|
|
metadata: metadata,
|
|
site: @site,
|
|
tags: all_html_tags,
|
|
locale: @locale,
|
|
dir: dir)
|
|
|
|
-# Mostrar todo lo que no va en el front_matter (el contenido)
|
|
- @post.attributes.each do |attr|
|
|
- metadata = @post[attr]
|
|
- next if metadata.front_matter?
|
|
|
|
- cache metadata do
|
|
%section.editor{ id: attr, dir: dir }
|
|
= @post.public_send(attr).to_s.html_safe
|