-
Notifications
You must be signed in to change notification settings - Fork 13
/
listing-grid.ejs
87 lines (77 loc) · 3.23 KB
/
listing-grid.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
```{=html}
<%
// Number of columns
const cols = 4;
// Card alignment
const align = "left";
// Borders
const hideBorders = false;
// Cap Options
const imgHeight = "100%";
%>
<div class="list grid quarto-listing-cols-<%=cols%>">
<% for (const item of items) { %>
<div class="g-col-1" <%= metadataAttrs(item) %>>
<a href="<%= item.slides.url %>" target="_blank" rel="noopener" class="grid-item-link"> <!-- Added link wrapper -->
<div class="quarto-grid-item card h-100 <%-`card-${align}`%><%= hideBorders ? ' borderless' : '' %>">
<% if (item.image) { %>
<p class="card-img-top">
<img src="<%= item.image %>" class="thumbnail-image card-img" style="height: auto;" alt="<%= item['image-alt'] %>">
</p>
<% } else { %>
<div class="card-img-bg" <%= imgHeight ? ` style="height: ${imgHeight};"` : '' %>> </div>
<% } %>
<% if ('title' || 'subtitle' || 'description' || 'author' || 'date' || otherFields.length > 0) { %>
<div class="card-body post-contents">
<% if ('title') { %><h5 class="no-anchor card-title listing-title"><%= item.title %></h5><% } %>
<% if ('subtitle') { %><div class="card-subtitle listing-subtitle"><%= item.subtitle %></div><% } %>
<% if ('description') { %>
<div class="card-text listing-description delink"><%= item.description %></div>
<% } %>
<%
const flexJustify = 'author' && 'date' ? "justify" : 'author' ? "start" : "end";
%>
<% if ('author' || 'date') { %>
<div class="card-attribution card-text-small <%-flexJustify%>">
<% if ('author') { %><div class="listing-author"><%= item.author %></div><% } %>
</div>
<% } %>
<style>
.listing-categories .listing-category .listing-href {
color: inherit; /* blue colors for links too */
text-decoration: none; /* Remove underline */
}
</style>
<div class="listing-categories" style="padding-top: 1em;">
<% if ('slides') { %>
<div class="listing-category">
<% if (item.slides.url) { %>
<a class="listing-href" href="<%= item.slides.url %>" target="_blank" rel="noopener">
<% if (item.slides.text) { %>
<%= item.slides.text %>
<% } else { %>
Slides
<% } %>
</a>
<% } else { %>
<a class="listing-href" href="<%= item.code %>" target="_blank" rel="noopener">Slides</a>
<% } %>
</div>
<% } %>
</div>
</div>
<% } %>
<!-- <div class="card-footer">
<div class="card-filename listing-filename">
<%= item.filename ? item.filename : " " %>
</div>
<div class="card-file-modified listing-file-modified">
<%= item['file-modified'] ? item['file-modified'] : " "%>
</div>
</div> -->
</div>
</a> <!-- Added link wrapper -->
</div>
<% } %>
</div>
```