-
Notifications
You must be signed in to change notification settings - Fork 57
/
listing.ejs
81 lines (69 loc) · 2.97 KB
/
listing.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
```{=html}
<%
// Number of columns
const cols = 3;
// Card alignment
const align = "left";
// Borders
const hideBorders = false;
// Cap Options
const imgHeight = "100%";
%>
<link href="/assets/css/all.css" rel="stylesheet">
<div class="list grid quarto-listing-cols-<%=cols%>">
<% for (const item of items) { %>
<div class="g-col-1" <%= metadataAttrs(item) %>>
<a href="<%= item.exercise %>" 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><% } %>
<% if ('date') { %><div class="listing-date"><%= item.date %></div><% } %>
</div>
<% } %>
<style>
.listing-categories .listing-category .listing-href {
color: inherit; /* blue colors for links too */
text-decoration: inherit; /* no underline */
}
</style>
<div class="listing-categories" style="padding-top: 1em;">
<% if (item.website) { %>
<div class="listing-category">
<a class="listing-href" href="<%= item.website %>" 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>
```