feature/share-libs
erb 76 lines 2.52 KB
Raw
1 <% content_for :meta_head do %>
2 <title><%= @meta_title %></title>
3 <meta name="description" content="<%= @meta_description %>">
4 <meta property="og:title" content="<%= @meta_title %>" />
5 <meta property="og:description" content="<%= @meta_description %>" />
6 <meta property="og:url" content="<%= artist_url %>" />
7 <% end %>
8 <% content_for :breadcrumb do %>
9 <script type="application/ld+json">
10 {
11 "@context": "http://schema.org",
12 "@type": "BreadcrumbList",
13 "itemListElement": [{
14 "@type": "ListItem",
15 "position": 1,
16 "item": {
17 "@id": "<%= root_url %>",
18 "name": "<%= t("site_name") %>"
19 }
20 },{
21 "@type": "ListItem",
22 "position": 2,
23 "item": {
24 "@id": "<%= artist_url %>",
25 "name": "<%= t("nav_artists") %>"
26 }
27 }]
28 }
29 </script>
30 <% end %>
31 <main>
32 <div class="row g-5">
33 <div class="col-md-12">
34 <h1><%= @page.title if @page %></h1>
35 <%= render('shared/flash_message', object: flash) %>
36 <%= raw @page.page_content if @page %>
37 </div>
38 </div>
39 <div class="row g-5">
40 <div class="col-sm-9">
41 <h2><%= t("h2_find_new_artists") %></h2>
42 <div class="row mb-3">
43 <% @artists.each_with_index do |artist, index| %>
44 <div class="col-6 col-md-4 mb-3">
45 <div class="card p-2 text-center">
46 <%= link_to(
47 image_pack_tag(
48 "image-placeholder-#{rand(0...3)}.jpg",
49 alt:"#{artist.name} image",
50 class: "img-thumbnail rounded-circle mx-auto d-block"
51 ),
52 artist_detail_path(artist.slug)
53 )
54 %>
55 <%= link_to(artist.name, artist_detail_path(artist.slug), class: 'mt-2') %>
56 <div class="card-body">
57 <p class="card-text"><%= strip_tags artist.description.truncate 60 %></p>
58 </div>
59 <div class="card-body">
60 <span class="badge rounded-pill bg-primary"><%= artist.updated_at.strftime("%B %-d, %Y") %></span>
61 </div>
62 </div>
63 </div>
64 <% end %>
65 </div>
66 <%= will_paginate @artists, class: 'flickr_pagination' %>
67 </div>
68 <div class="col-sm-3">
69 <div class="position-sticky" style="top: 1rem;">
70 <%= render("partial_aside") %>
71 </div>
72 </div>
73 <%= render "shared/partial_breadcrumbs" do %>
74 <li class="breadcrumb-item"><%= link_to t("nav_artists"), artist_path %></li>
75 <% end %>
76 </main>