no ofrecer la renderización de layouts ignorados

This commit is contained in:
f 2021-04-07 17:46:37 -03:00
parent 77904dc473
commit ee881e22ab
2 changed files with 11 additions and 6 deletions

View file

@ -28,6 +28,11 @@ Layout = Struct.new(:site, :name, :meta, :metadata, keyword_init: true) do
meta[:hidden].present?
end
# Detecta si el layout no es renderizable
def ignored?
@ignored ||= site.config['ignored_layouts']&.include? name.to_s
end
# Los metadatos del Layout.
#
# TODO: Inicializar con valores por defecto o usar Hash#default_proc

View file

@ -12,12 +12,12 @@
edit_site_post_path(@site, @post.id),
class: 'btn btn-block'
= link_to t('posts.preview.btn'),
site_post_preview_path(@site, @post.id),
class: 'btn btn-block',
target: '_blank',
rel: 'noopener'
.alert.alert-info= t('posts.preview.alert')
- 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