5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 02:11:42 +00:00

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? meta[:hidden].present?
end end
# Detecta si el layout no es renderizable
def ignored?
@ignored ||= site.config['ignored_layouts']&.include? name.to_s
end
# Los metadatos del Layout. # Los metadatos del Layout.
# #
# TODO: Inicializar con valores por defecto o usar Hash#default_proc # TODO: Inicializar con valores por defecto o usar Hash#default_proc

View file

@ -12,12 +12,12 @@
edit_site_post_path(@site, @post.id), edit_site_post_path(@site, @post.id),
class: 'btn btn-block' class: 'btn btn-block'
- unless @post.layout.ignored?
= link_to t('posts.preview.btn'), = link_to t('posts.preview.btn'),
site_post_preview_path(@site, @post.id), site_post_preview_path(@site, @post.id),
class: 'btn btn-block', class: 'btn btn-block',
target: '_blank', target: '_blank',
rel: 'noopener' rel: 'noopener'
.alert.alert-info= t('posts.preview.alert')
%table.table.table-condensed %table.table.table-condensed
%thead %thead