generated from songquanpeng/blog-theme-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinks.ejs
69 lines (60 loc) · 2.01 KB
/
links.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
<%- include('./partials/header') %>
<div class="index posts-expand">
<article itemscope="" itemtype="http://schema.org/Article" class="post-block" lang="en" style="opacity: 1; display: block;">
<%- include('./partials/page-info') %>
<div class="post-body" itemprop="articleBody" style="opacity: 1; display: block; transform: translateY(0px);">
<% if (linkList && linkList.length){ %>
<% linkList.forEach((link)=>{ %>
<div class="link-card">
<%if(link && link.image ===""){
if(link.link.endsWith("/")) {
link.image = link.link + "favicon.ico";
}else {
link.image = link.link + "/favicon.ico";
}
}%>
<img loading="lazy" class="image" src="<%= link.image %>" alt="⚠️"/>
<div class="info">
<div class="title"><a href="<%= link.link %>"><%= link.title %></a></div>
<div class="description"><%= link.description %></div>
</div>
</div>
<% })} %>
</div>
<footer class="post-footer">
<%- include('./partials/prev-next') %>
</footer>
</article>
</div>
<style>
.link-card {
padding: 1em 0;
border: 2px solid transparent;
display: flex;
align-items: center;
border-bottom: 1px dashed #999;
margin-left: 20px;
margin-right: 20px;
}
.link-card a {
flex-shrink: 0;
}
.link-card img {
width: 4em;
height: 4em;
margin: 0 1em 0 0;
}
.link-card .info {
flex-shrink: 1;
}
.link-card .title {
font-size: 1.1em;
font-weight: bold;
margin: 0.375em 0;
}
.link-card .description {
font-size: 0.875em;
}
</style>
<%- include('./partials/comment') %>
<%- include('./partials/footer') %>