diff --git a/app/views/admin/communication/websites/pages/preview.html.erb b/app/views/admin/communication/websites/pages/preview.html.erb index 1e119534c08d0ccd9854f1b70e43e731b63de2e2..76adfeda0b7b937f3ab69b97c5a3cf99e84a29e0 100644 --- a/app/views/admin/communication/websites/pages/preview.html.erb +++ b/app/views/admin/communication/websites/pages/preview.html.erb @@ -1,19 +1,3 @@ -<header class="hero"> - <%= kamifusen_tag @page.best_featured_image if @page.best_featured_image.attached? %> - <div class="container"> - <div> - <h1><%= @page.title %></h1> - </div> - <ol class="breadcrumb" itemscope="" itemtype="https://schema.org/BreadcrumbList"> - <li class="breadcrumb-item" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <a itemprop="item"><span itemprop="name">Accueil</span></a> - <meta itemprop="position" content="1"> - </li> - <li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <span itemprop="name"><%= @page.title %></span> - <meta itemprop="position" content="2"> - </li> - </ol> - </div> -</header> +<% content_for :title, @page.title %> +<% content_for :image, kamifusen_tag(@page.best_featured_image) if @page.best_featured_image.attached? %> <%= render 'admin/communication/blocks/preview', about: @page %> diff --git a/app/views/admin/communication/websites/posts/preview.html.erb b/app/views/admin/communication/websites/posts/preview.html.erb index 5b376edcd05469c620c35882b2d074491be90348..14bd7cd482e0666eb021ef6bb70d0732497bf91f 100644 --- a/app/views/admin/communication/websites/posts/preview.html.erb +++ b/app/views/admin/communication/websites/posts/preview.html.erb @@ -1,19 +1,3 @@ -<header class="hero"> - <%= kamifusen_tag @post.featured_image if @post.featured_image.attached? %> - <div class="container"> - <div> - <h1><%= @post.title %></h1> - </div> - <ol class="breadcrumb" itemscope="" itemtype="https://schema.org/BreadcrumbList"> - <li class="breadcrumb-item" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <a itemprop="item"><span itemprop="name">Accueil</span></a> - <meta itemprop="position" content="1"> - </li> - <li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <span itemprop="name"><%= @post.title %></span> - <meta itemprop="position" content="2"> - </li> - </ol> - </div> -</header> +<% content_for :title, @post.title %> +<% content_for :image, kamifusen_tag(@post.featured_image) if @post.featured_image.attached? %> <%= render 'admin/communication/blocks/preview', about: @post %> diff --git a/app/views/admin/layouts/preview.html.erb b/app/views/admin/layouts/preview.html.erb index 791854a7d1449b14f88d8accfbda64a904f7c50d..4cbc9559f699679cb30cef5e9db680802c623fad 100644 --- a/app/views/admin/layouts/preview.html.erb +++ b/app/views/admin/layouts/preview.html.erb @@ -11,6 +11,24 @@ <% end %> </head> <body> + <header class="hero"> + <%= yield :image %> + <div class="container"> + <div> + <h1><%= yield :title %></h1> + </div> + <ol class="breadcrumb" itemscope="" itemtype="https://schema.org/BreadcrumbList"> + <li class="breadcrumb-item" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> + <a itemprop="item"><span itemprop="name">Accueil</span></a> + <meta itemprop="position" content="1"> + </li> + <li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> + <span itemprop="name"><%= yield :title %></span> + <meta itemprop="position" content="2"> + </li> + </ol> + </div> + </header> <main class="page-with-blocks" id="main" role="main" tabindex="-1"> <div class="blocks"> <%= yield %>