mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 18:56:21 +00:00
no ofrecer la renderización de layouts ignorados
This commit is contained in:
parent
77904dc473
commit
ee881e22ab
2 changed files with 11 additions and 6 deletions
|
@ -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
|
||||||
|
|
|
@ -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'
|
||||||
|
|
||||||
= link_to t('posts.preview.btn'),
|
- unless @post.layout.ignored?
|
||||||
site_post_preview_path(@site, @post.id),
|
= link_to t('posts.preview.btn'),
|
||||||
class: 'btn btn-block',
|
site_post_preview_path(@site, @post.id),
|
||||||
target: '_blank',
|
class: 'btn btn-block',
|
||||||
rel: 'noopener'
|
target: '_blank',
|
||||||
.alert.alert-info= t('posts.preview.alert')
|
rel: 'noopener'
|
||||||
|
|
||||||
%table.table.table-condensed
|
%table.table.table-condensed
|
||||||
%thead
|
%thead
|
||||||
|
|
Loading…
Reference in a new issue